RCS Typing Indicator (Agent to User)
POST Method
The RCS Typing Indicator (Agent to User) API allows you to indicate when an agent is typing a response to an end user in an RCS conversation. This helps improve user experience by providing real-time feedback during interactions.
Prerequisites
- After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in kaleyra.io.
- Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
- Before sending the RCS, you must configure the RCS channel in the Kaleyra platform. To configure the RCS channel in your account, please contact your local Kaleyra representative.
API Request to indicate the Typing Indicator (Agent to User)
To indicate the typing indicator for agent to user, use the https://rcs-api.<pod>.kaleyra.io/v1/<sid>/rcs/events with the following request method:
The following is the request format to check RCS capability for single number:
curl --location 'https://<api_domain>/v1/<sid>/rcs/events' \
--header 'Authorization: Basic <base64-encoded-credentials>' \
--header 'Content-Type: <content-type>' \
--header 'api-key: <api-key>' \
--data '{
"from": "<from>",
"to": "<to>",
"composing": {}
}'The following is the sample request that describes how to indicate typing indicator for agent to user:
curl --location 'https://rcs-api.na.kaleyra.io/v1/XXXXX6913850XXXX/rcs/events' \
--header 'Authorization: Basic {BASIC_BASE64}' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'api-key: XXXXX3b8497f58a94e84b671aca43XXXX' \
--data '{
"from": "kio_rcs",
"to": "+1XXXXXXXX90",
"composing": {}
}'URL Parameters and Headers
The following is the list of parameters and headers to send the outgoing message request:
| Parameter/Headers | Data Type | Description | Example | Mandatory? |
|---|---|---|---|---|
authorization | String | Basic authentication header encoded in Base64 format using credentials. | Basic {BASIC_BASE64} | Yes |
sid | String | Account SID (Security Identifier). | XXXXX6913850XXXX | Yes |
Content-Type | String | Indicates the format of the content the API will be processing. | The only allowed value is application/JSON | Yes |
api-key | String | API key generated from kaleyra.io account. | XXXXX3b8497f58a94e84b671aca43XXXX | Yes |
Following is the list of attributes to be used in the payload to indicate typing indicator for agent to user:
| Parameter | Data Type | Description | Example | Mandatory? |
|---|---|---|---|---|
from | String | Sender identifier (agent/bot ID configured in Kaleyra RCS channel). | kio_rcs | Yes |
to | String | Recipient mobile number in E.164 format. | +1XXXXXXXX90 | Yes |
composing | Object | Indicates that the agent is currently typing. Must be an empty object to trigger the typing indicator event. | Yes |
Sample Success Response
The following is the sample success response:
{
"code": "RCS1002",
"message": "Event published successfully",
"data": {
"requestId": "33ae7082-aa71-4159-a8df-93XXXXXXXX1a",
"to": "+1XXXXXXXX90",
"messageId": "f5d689e0-6c01-46d0-XXXX-b2c4XXXXXXf2"
},
"error": {}
}
Response Fields
The following table outlines the key fields returned in the API response. Each field provides information about the status of the typing indicator event that was published, including identifiers for tracking and delivery reference. These fields help in monitoring and correlating the request with the resulting event.
| Response | Description | Example |
|---|---|---|
requestId | Unique identifier assigned to the API request for tracking purposes. | 33ae7082-aa71-4159-a8df-93XXXXXXXX1a |
to | Recipient mobile number to whom the typing indicator event is sent. | +1XXXXXXXX90 |
messageId | Unique identifier of the published typing event. | f5d689e0-6c01-46d0-XXXX-b2c4XXXXXXf2 |
Sample Failure Response
The following is the sample failure response:
{
"code": "RCS1004",
"message": "Event publish failed",
"data": [],
"error": {
"error_code": "PROV_ERROR",
"error_message": "{\n \"status\": \"ERROR\",\n \"errorText\": \"Access Denied\"\n}"
}
}Updated about 3 hours ago
