🌐 Atom Templates API (Template Messages)
The Templates API allows you to connect your internal applications with Atom to automate the sending of WhatsApp pre-approved messages.
Available environments:
Production: For end customers and real operations.
•https://us-central1-atomchat-io.cloudfunctions.net/templatesAI: Alternative environment for specific integrations.
•https://us-central1-atom-ai.cloudfunctions.net/templates
1️⃣ Send a Template (Template Message)
This service sends a message using your official number and the template ID. If the client already has an active chat, the send is confirmed instantly; if it is a new contact, the message remains "pending" until Meta confirms it.
Method:
POSTHeaders:
•Content-type: application/json
•Charset: utf-8
•Authorization: Bearer (your_public_token)
Body Parameters (JSON):
Parameter | Description | Type | Required |
templateId | ID of the AtomChat Template Message. | string | Yes |
phoneNumber | Destination phone with country code, without the + sign or spaces (Ex: 50755667788). | string | Yes |
clientName | Client name (defaults to phone number). | string | Optional |
groupName | Group to which the chat will be assigned. | string | Optional |
assign | true to assign to an agent, false for the bot. | boolean | Optional |
params | Object with template variables (Ex: {"param1": "value"}). | object | Optional |
Common Responses (HTTP Codes):
200: Sent successfully.
202: Pending send (new contact).
400: Missing parameters or incorrect data in the request.
401: Channel not connected, invalid token, or conversation limit reached.
500: Internal server error.
2️⃣ List Templates
Allows you to retrieve a list of all active templates available in the channel associated with your token.
Method:
GETEndpoint (Production Example):
https://us-central1-atomchat-io.cloudfunctions.net/templates?page=1&size=1000&sort=ascURL Parameters (Optional):
page(current page),size(number of results), andsort(orderascordesc).Headers: Same as the POST method.
3️⃣ Get Template by ID
Retrieves the complete details of a specific template.
Method:
GETEndpoint (Production Example):
https://us-central1-atomchat-io.cloudfunctions.net/templates/{templateId}(Replace {templateId} with the actual ID).Headers: Same as the POST method.
⚠️ Final Considerations
Validate the environment: Make sure you are using the correct endpoint (Production vs. AI) depending on your development stage.
Phone format: The most common error occurs when sending the phoneNumber. Remember: no + sign and no spaces.
Error reading: If you receive a 400 or 401 error, check the response body, as the system will tell you exactly which parameter is missing or if there are issues with your authorization token.
Take your communication to the next level! 🚀
By using the Templates API, you can integrate Atom directly with your CRM, ERP, or internal system to trigger alerts, confirmations, and mass reminders without manual intervention. Make sure to structure your JSON well and always validate your connection tokens. ✅