Introduction
Onextel’s 365cx.io RCS APIs offer robust, secure, and flexible integrations with your system, allowing seamless incorporation of RCS capabilities into your applications. With the Onextel RCS API, you can efficiently send messages, ensuring reliable communication with your users globally.
To start using the API, you will need to generate a token using the Generate token API and pass the same token as authentication for the send message API.
1. Generate token API #
Request URL: https://365cx.io/account/enterprise/login
HTTP Method: POST
Parameters | Description |
Indicates the email id used for logging in to the 365cx.io platform. | |
password | Indicates the password used for logging in to the 365cx.io platform. |
longTermToken | Indicates if the authentication token remains valid indefinitely otherwise it will be valid for 1 hour. By default it is 1 hour only |
Sample Curl Request:
curl --location 'https://365cx.io/account/enterprise/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'email=xxxxxxxx' \
--data-urlencode 'password=xxxxxxxx' \
--data-urlencode 'longTermToken=true'
Success Response:
{
"response": {
"uId": 100,
"token": "VFl6Zz6ZMezrz+12+8CqIHRZdtxxxxxxxxxxxxxxxxEMLuKFgxM9RtZPcl"
},
"message": {
"code": 0,
"message": "Login success"
},
"status": true
}
Failure Response:
{
"message": {
"code": 1403,
"message": "Login failed! wrong email id and password combination"
},
"status": false
}
Send message API Mandatory Parameters #
Parameters | Description |
from | Specifies the sender’s contact id. |
to | Specifies the recipient’s phone number. |
journeyId | Represents the unique identifier for the journey associated with the message. |
templateId | Identifies the specific template for the message. |
Note – To get value for ‘from’ parameter, follow these steps:
1. Log in to the 365cx.io platform.
2. Go to Channels and click on the RCS channel.
3. Under Edit Channel, copy value given for Contact Number with +. For eg: +AYXxxxxxxxxU3
To get journeyId, follow these steps:
1. Log in to the 365cx.io platform.
2. Go to Flow Builder -> Streams and click on the stream.
3. Under Configurations, copy journey id from the webhook URL.
Eg: If webhook URL is https://365cx.io/chatbird/message/66c3054f9xxxxxxx61f5501e/send, journey id is 66c3054f9xxxxxxx61f5501e.
To get templateId, follow these steps:
1. Log in to the 365cx.io platform.
2. Go to Channels -> Templates -> RCS Template and select channel and submit.
3. Copy the name of the template and pass it as templateId in the API.
2. Send message API #
Request URL: https://365cx.io/chatbird/api/message/send
HTTP Method: POST
Headers: Add a new key referring to the table below.
Key | Value |
authentication-token | Token generated from Generate Token API |
Sample Curl Request:
{
"from": "xxxxxxxx",
"to": "xxxxxxxx",
"journeyId": "xxxxxxxx",
"message": {
"template": {
"templateId": "xxxxxxxx",
"parameterValues": {
"0": "xxxx"
}
}
},
"callbackUrl": "xxxxxxxx",
"metaData": {
"tag1": "xxxxxxxx",
"tag2": "xxxxxxxx",
"tag3": "xxxxxxxx"
}
}
Parameters | Description |
parameterValues | Identifies variable values in Body content |
callbackUrl | Indicates the URL used for receiving callbacks |
metaData | It contains custom tags (tag1, tag2, tag3) that provide additional context or categorization for each message. tag1, tag2, tag3: These are customizable fields where you can specify extrainformation for the particular message. Info! By including these tags while sending a message, you can easily filtermessages in the Delivery Report section of the 365cx.io platform based on these tags. This allows for efficient categorization andretrieval of messages according to your specific criteria. |
Success Response:
{
"message": null,
"code": 100,
"status": true,
"data": {
"id": "669e55c8a8f5d50aad723e73"
}
}
Failure Responses:
Wrong Journey ID
{
"message": "Journey not found",
"code": 101,
"status": false,
"data": null
}