Create SMS Callback Profiles using Dynamic Variables

You can create an SMS callback profile for the SMS status update in the Kaleyra platform. While creating a callback profile for the SMS channel, the interface also provides a list of SMS related dynamic variables to select for which you want to receive information through the callback. The dynamic variables’ list serves as a ‘ready reckoner’ to add the callback variables without having to know the variable names. For each of the variables selected from the list, the callback will fetch the latest value for the given SMS into your system.

For information on how to use a callback profile in an SMS API request, see Callback Request using callback profile.

📘

Note:

  • If you have multiple callback profiles created for different purposes, make sure you add the appropriate callback profile Id while calling the SMS API requests.
  • A callback profile created for the SMS channel cannot be used for other channels.
  • Once a callback profile is created for SMS, you can only edit the dynamic variables or delete the profile, but you cannot change the profile to a different channel.

To create a callback profile for receiving updates about SMS status :

  1. Navigate to the profile settings drop-down list and select the Callback Profiles option.

The Callback Profiles page appears.

  1. On the Callback Profiles page, click the Add New Profile button.
    The New Callback Profile page appears.
  1. Perform the following steps to add all the relevant information in the ‘New Callback Profile’ page.
    1. In the Title field, enter a title for the callback profile. This is a mandatory field.

    2. From the Channel drop-down list, select the option ‘SMS - callback dynamic variables and types from SMS’ to create a callback profile to be used to receive back updated information about the SMS status.

    3. Once you select the option ‘SMS - callback dynamic variables and types form SMS’ in the previous step, the Events for the selected channel field is automatically set to the option ‘sms-send’.

    4. In the HTTP Method field, select a method for which the callback is created.
      The options are POST, GET, PUT, and DELETE.

      📘

      Note:

      The suggested methods to be used for callback are GET and POST.

    5. In the Enter Endpoint field, enter the URL at which the callback information should be received.

    6. From the Dynamic Variables section, click View to view and select the dynamic variables for the selected channel. The dynamic variables represent all the possible information that you can retrieve about the SMS as part of the callback that kaleyra.io to your system. You may select all of them, or only the fields you are interested in.
      The Dynamic Variables pane appears on the right side of the page.

In the Dynamic Variables pane,

  • To select all the dynamic variables, click Select All or manually select the dynamic variables check-boxes that you want to receive in the callback sent from Kaleyra to your system.
  • After selecting the variables, click Copy to Clipboard.
  • Click ‘X’ (CLOSE) button on the top right side of the pane.
  • For POST method, using the mouse, right click and paste the dynamic variables in the Request Body field (POST method).
  • For GET method, using the mouse, right-click and paste the dynamic variables at the end of the Endpoint URL as query parameters. For example, `https://customer-endpoint/kaleyra/callbacks?
  1. From the Retry drop-down, select the number of retries that Kaleyra Platform will perform in case the first callback receives a failure response or no response from your endpoint. You have the option for 0, 1, and 2. If you select either 1 or 2 retries, then you must enter the Time Interval in secs and the Timeout in milli-secs values. For assistance with more than two retry attempts, you can contact the Support team.
    📘

    Note:

    The following are the retries according to channels:

    • SMS - max 3 retries, 10s interval between retries.
    • WhatsApp - max 4 retries, 60s interval between retries.
    • Voice - max 4 retries, 60s interval between retries.
    • Email - max 4 retries, 60s interval between retries.

For the Default priority, the Time Interval increases exponentially after each failed attempt. The formula for the delay: Delay = Initial Delay×(2^retry_count).

If the initial delay is 60 seconds and we allow up to 2 retries:

Retry AttemptDelay (in seconds)Cumulative Wait Time
1st Try60×2^0=6060s
1st Retry60×2^1=120180s
2nd Retry60×2^2=240420s
📘

Note:

Click Test to send a callback to your endpoint based on the configuration just set in the callback profile to see if the callback is working as expected. The confirmation message Callback profile tested appears in the bottom left of the screen.

  1. Click Next.
    The Advanced Configuration step appears.
  1. Perform the following:

    1. (Optional) From the Data Format drop-down, select one of the following options:
      • Form Data - To view the callback data through fields.
      • URL Encoded - To view the callback data in URL encoded format. The URL encoded data can be replaced using special characters and spaces in data with a format that can be transmitted over the internet using URLs.
      • JSON - To view the data in JSON format. JSON is a lightweight data format used to store and exchange data between a client (like a browser) and a server.
    2. In the Header field, enter values as Key-Value pairs.
      Use the Header fields to include additional information on the HTTPS request generated by Kaleyra for your system.
      • Use the Headers field for authentication purposes. For example: API-KEY-based authentication or Basic authentication. For more information on basic authentication, see Basic Authentication.
      • Use the Headers field to indicate how the callback response should be presented using the “Content Type”.
    3. Click the Enable Encryption toggle button. The fields related to encryption are displayed. This is an optional field. The Algorithm, Key, Initialization Vector, and Parameters fields appear. To know more about these fields, see Callback Encryption.
  2. Click Save.
    The confirmation message appears and the callback gets listed to the Callback Profile page.

    Once you save the callback profile on the UI, you can see the callback profile ID that can be used in the SMS API requests to receive updates about the SMS status.

    The following table shows the field descriptions on the Add Callback profile window.

ColumnDescriptionExample
TitleThe name of the SMS callback profile.
You can use the callback title for searching the callback profiles.
SMS-campaignSMS - callback dynamic variables and values
Selected Channel APIThe channel for which the callback profile is created.
Events for the selected channelThe events of the selected channel for which the callback information is obtained.
The relevant information for the selected event will be received using the callback.
sms-send
HTTP MethodThis section provides the options to select the HTTP methods for the SMS channel APIs.
Select MethodThe options are: GET, POST, PUT, and DELETE.
Note:
The dynamic variables that you select get added as the query string parameters in the endpoint for the GET method.
The dynamic variables get added in the body of the JSON request for the POST method.
PUT or DELETE methods are for internal purposes for SMS callback profiles.
POST
Enter endpointThis is the URL to which the callback data is returned.https://webhook.site/aeXXXXb3-aXX4-4XX9-8XXc-efXXXXXXXX35
Dynamic variablesAll the relevant dynamic variables for the SMS channel are listed here.
You can select the dynamic variables for which you want to receive the values through the callback.
The list of dynamic variables is the same for POST, GET methods.
Note: See the table below for dynamic variables descriptions.
status
Headers (Optional)

The header information should be given as a key-value pair.
Use these fields to add any additional HTTP headers and related values you want to receive in the callback.

For example:
1)Use Headers for authentication purposes using the api-key.
2)Use Headers to indicate how the callback response should be presented using the content_type.

api-key:A71151xxxxxxxxxxxxxxx083d40a178a
Enable EncryptionThis toggle button is to enable encryption for the callback information. When this option is enabled, the callback data is encrypted. Use this feature to secure the callback data.

For information on encryption algorithm and the related fields for this feature, see:

Callback Profiles

page.

Enable Callback Required OptionThis toggle button is to enable and enter the response message for the chatbot services.
The chatbots can be controlled using the APIs and the API callback information can be used for message customization, status reporting and so on.
"The callback option is enabled.".

The following table shows the dynamic variables' descriptions with examples.

Dynamic variableDescriptionExample
flashIndicates if the SMS is a flash message or not (1/0). ‘1’ means the SMS is sent as a flash message and ‘0’ means the SMS is not a flash message.1
sent_timeIndicates the time at which the SMS is sent. This is based on the country specified using the iso_code.2023-05-17 12:05:14
totalThe total SMS units sent on a given day.1
sourceThe source of the request to send the SMS.
For example, API or campaign.
API
senderThis is the sender ID. A Sender ID is a unique name or standard mobile number that shows in the “from” field of your text messages on your phone. It could be a phone number, an alpha-numeric, an alphabetic, or a numeric alias.TCL
priceThe unit price charged for the SMS based on the currency of the account.0
iso_codeThe country specific code of the SMS recipient.IN
country_nameThe country name(region) to which recipient's mobile number is associated.India
campaign_nameThe name of the campaign through which the SMS is sent.
Note: If the SMS is sent through a campaign, the campaign name is shown; if the SMS is sent through an API request, the value provided in the campaign_name field will be shown in this field.
test_camp
lengthThe length of the SMS in characters.12
unitsThe number of units billed for SMS service. The value '1' means that the whole text has been sent as one single SMS and a value more than '1' means that the SMS text has been sent in several concatenated SMS.1
typeThe SMS type. The options are OTP, TXN, or MKT.OTP
idThe ID represents the campaign part of the message.
If the same API request has multiple mobile numbers, the id field represents all the mobile numbers to which the message is sent.
e0xxxx2a-cxx5-4xx0-axxf-b7xxxxxxxxf8
descriptionThe description of the message.Message successfully delivered to the user
statusThe delivery status of the SMS.Delivered
message_idThe message id represents the ID> :
<order_of_mobile_in_campaign>
(id : order of the mobile number in the campaign) as shown in the example column.
e0XXXX2a-cXX5-4XX0-af4f-b7b1433347f8:1
recipientThe recipient phone number to which the message has been sent.9170227xxxxx
status_traceThis is the sub-status of the SMS that further helps understand more about the delivery status.DELIVRD
ref, ref1, & ref2These are the additional parameters the customers can use for their reference. These parameter values will be returned in the ‘callback response’.product name
message_bodyIndicates the content of the message sent by the user in the request.
Note: The message_ body needs to be enabled by Admin. Contact support team for assistance.
Hello {{user_name}}, your order {{order_id}} has been successfully processed on {{current_date}}.
deliveredIndicates the DLR received time from the operator.
Note: This will be an empty string if the message is undelivered or has the NOT_SENT status.
2024-10-14 16:28:29
submittimeIndicates the submission time to the operator.
Note: This field will be empty for the NOT_SENT status but will contain values for Delivered and Undelivered statuses.
2024-10-14 21:58:26


Did this page help you?



© 2026 Kaleyra Inc. All rights reserved.
Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.