Integrating with HTTP Request Endpoint

Modified on Thu, 9 Nov, 2023 at 10:49 PM

For each AI project, the system will provide one endpoint for the HTTP Request integration:

  • POSThttps://payload.vextapp.com/hook/${endpoint_id}/catch/${channel_token}


You will have to replace the ${channel_token} with your own token. It is recommended to use a user ID or a unique identifier as your channel token. 


For example, when a query is posted, a custom function generates a new token "hello" for the endpoint: 

  • POST: https://payload.vextapp.com/hook/${assigned_http_token}/catch/hello


POST

In order to send a POST request to the assigned endpoint, you will have to generate an API key first. To learn how to generate an API key, check out this article.


The interface will provide a simple curl example for your reference:

curl -XPOST 
-H 'Content-Type: application/json'
-H 'Apikey: Api-Key <API_KEY>' 
-d '{
     "payload": {your_message_here}
}' 'https://payload.vextapp.com/hook/${endpoint_id}/catch/${channel_token}'
Generic

Code logic and method may vary depending on what language you use.



POST request JavaScript example:

const response = await fetch(`https://payload.vextapp.com/hook/${endpoint_id}/catch/${channelToken}`, {
    method: "POST",
    headers: {
        "Content-Type": "application/json",
        "Apikey": `Api-Key ${API_KEY}`
    },
    body: JSON.stringify({
        "payload": ${your_message_here}
    })
});
JavaScript


Result Example

{"text":"Hello! How can I assist you today?"}
Generic

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article