Skip to main content

How to Send Template Messages Using the Atom API?

Connect your system and send WhatsApp Template Messages via API. Learn the parameters, endpoints and responses to automate your official notifications. 🚀

🛠️ Sending Template Messages via API
From Atom, we enabled our Endpoint within Cloud Functions to allow automated sending of templates using your official WhatsApp number and your template identifier (templateId).
How does send confirmation work?

  • Existing contacts: If the number is already linked to a conversation in Atom, the message will be sent on the same conversation and confirmation will be immediate.

  • New contacts: If the number has no history, confirmation from the official WhatsApp provider will be awaited, so the initial status will be reported as pending.

📝 Request Parameters
Below, we detail the parameters you must include in your code to structure the sending:

Parameter

Description

Data Type

Required

templateId

Identifier (Id) of the AtomChat Template Message.

string

Yes

phoneNumber

Destination phone number. Must include country code without using the + sign.
✅ Correct: 50755667788
❌ Incorrect: +50555667788, 55667788

string

Yes

clientName

Name of the client who will receive the message.

string

No (Default: phone number)

groupName

Name of the group to which the chat will be assigned.

string

No (Default: first group of the integration)

assign

Indicates if it is directly assigned to an Agent (true).

boolean

No (Default: false, assigned to Bot)

params

Collection of variables and values required by the template.

object

No


🌐 Request Structure


To perform the sending through our API, use the following technical structure:

Headers:

Content-type: application/json
Charset: utf-8
Authorization: Bearer (your_public_token)

Request Body (JSON Body):

{
"templateId": "id_del_template",
"phoneNumber": "50755667788",
"clientName": "Client Name",
"groupName": "Group Name",
"assign": true,
"params": {
"param1": "valor_1",
"param2": "valor_2"
}
}

📨 Expected Responses


When executing the request successfully (HTTP Code 200), the system will return one of the following JSON, depending on the contact status:


Scenario 1: New number (Awaiting provider confirmation)

{
"success": true,
"message": "Pending"
}

Scenario 2: Existing number (Immediate send confirmation)

{
"success": true,
"message": "Sent",
"data": {
"conversation_id": "conversation.id"
}
}

Automate your communication at scale! 🚀

By integrating template sending through Atom's API, you ensure that your notifications and alerts reach your customers safely. Use this structure to connect your CRM or internal system and optimize your contact flows. ✅

Did this answer your question?