API Documentation
Send Template
Endpoint to send a template message to a recipient.
Method: POST
URL: https://api.trypopcorn.ai/template/:templateId
Headers
- POPCORN-API-KEY (string, required) - API key provided by the Popcorn team.
Parameters
-
Path Parameter:
templateId
(string) - Unique ID of the template to send.
-
Body Parameters:
recipientNumber
(string, required) - Phone number of the recipient.variables
(array, optional) - Custom variables to be used in the template. Include this only if the template is dynamic and requires variables. The array of values should be ordered, with each variable corresponding sequentially to the placeholders in the template.
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.