Using External API as a webhook

Options
heydj23
heydj23 Member
edited October 2022 in ? Working with APIs

Hi, I am trying to use this endpoint as a trigger point for a webhook. When the endpoint is hit with the input, we get a record from Xano DB that hits the match and use that record's callback URL field to send the external API request that acts like a webhook.


When we send the external API to the URL, the other party receives it the screenshot I attached below. It does show in the form values, but for the raw content, it's not coming out right. How can I do so that raw content comes out like this below in a JSON format??

{

"events": {

"event_id": "144114ea-4509-11ed-b878-0242ac120002",

"event_name": "pricing changed"

},

"customer": {

"customerId": "5373fa2c0-fded-4541-8298-ff0032d1c0d0",

"installerId": "000021",

"status": "design completed",

"designURL": "test.com/design/YP1A7O18IC?client_id=fd76df5441e511edb87280242ac120002",

"proposalURL": "test.com/1665423978420x483953935259731000?client_id=fd76df5441e511edb8780242ac120002",

"firstName": "Jane",

"lastName": "Joe",

"email": "joe@gmail.com",

"phoneNumber": "615232,

"monthlyUsage": {

"jan": "550",

"feb": "550",

"march": "550",

"apr": "550",

"may": "550",

"june": "550",

"jul": "550",

"aug": "550",

"sep": "550",

"oct": "550",

"nov": "550",

"dec": "550"

}

}

}

Thanks

Answers

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options

    @heydj23 I think it'd be best to see your function stack and how you're mapping variables.

    You should just be able to map the variable of the data you want to send as the entire params line in your external API request function. It's possible you might be required to set your content-type header.