API Documentation
Chat
Endpoint to send messages and receive responses in a conversation.
The Chat API endpoint allows you to send messages to a conversation and receive responses.
Method: POST
URL: https://api.trypopcorn.ai/chat
Headers
- POPCORN-API-KEY (string, required) - Your API key, provided by the Popcorn team.
Parameters
- Body Parameters:
userId
(string, required) - A unique identifier for the user, such as an email, phone number, or another predefined ID used by your system.message
(string, required) - The message to be sent in the conversation. TheuserId
is used to identify which conversation the new message belongs to.
Example Request
Example Response
If there’s an error, the response may look like:
Errors
- 400 - Invalid request, e.g., missing recipientNumber or templateId.
- 500 - Internal server error.