Callback Profile for Fallback Flow

Using the 'Callback Profiles' feature, you can receive essential information and updates about various aspects of the Fallback Flow. The Fallback result will be sent using a callback once the flow is completed.

This document will guide you through creating callback profiles for Fallback flows.

Creating a Callback Profile for Fallback Flow

To create a callback profile, perform the following steps:

  1. On the profile settings drop-down list, select the Callback Profiles option.

The Callback Profiles page appears.

  1. Click Add New.
    The Add Callback Profile page appears.
  1. In the Title field, enter the title of the Callback profile.

📘

Note:

You can use the Title field to search for callback profiles.

  1. From the Select Channel API list, select Default—No channel selected.
  2. From the HTTP Method dropdown list, select the POST method for your configured endpoint.
  3. In the Enter Endpoint textbox, enter the webhook URL where you want to receive the callback calls. Ensure that the endpoint is available over the public internet.
  4. The request body must be configured as follows: {"workflowevent":""}.
  5. Click Save to save the callback profile in your kaleyra.io account.

The saved profiles are listed on the Callback Profile page. You can filter the data on the listing page with Callback Profile Name, HTTP Method, and Created Date range for accurate results.

📘

Note:

Each Callback profile created has a unique ID (as shown in the following image) that is used in the Fallback Flow to trigger the callback.

Sample Callback Response

{
    "workflowInvocationId": "4AhJXi67XXXXXXXXXXFyQT ",
    "executionStatus": "COMPLETED",
    "timestamp": "2024-05-24T16:18:01.379310507Z",
    "result": {
        "channel1": { 
            "createdAt": "2024-05-24T16:17:51.479884794Z",
            "from": "wasender",
            "to": "919620838XXX",
            "messageId": "9db24eba-eeae-41be-97a5-3ac45551ec1b",
            "clientMessageId": "0f6da8f1-923d-4995-a274-4830d09d8287",
            "channel": "whatsapp",
            "statusCode": "TIMEOUT",
            "timeout": "PT5S"
        },
        "channel2": {
            "createdAt": "2024-05-24T16:18:01.126686174Z",
            "from": "smssender",
            "to": "919620838XXX",
            "messageId": "5599165f-3122-474f-8298-4177a24e326a",
            "clientMessageId": "e66aa985-6587-42d5-81e5-4e32b37a5252",
            "channel": "sms",
            "statusCode": "DELIVERED",
            "channelMessageId": "83c09c45-240d-4aae-95ae-5925f82e86ea:1",
            "statusDetails": "Delivered: DELIVRD: Message Delivered",
            "acceptedAt": "2024-05-24T16:18:00.463204465Z"
        }
    }
}

Response Parameters and Description

The following table contains the details of the parameters you receive in the Callback response:

ParameterData TypeDescriptionExample
workflowInvocationIdStringA unique internal invocation ID is assigned when the invocation is requested.4AhJXi67XXXXXXXXXXFyQT
executionStatusStringThe Callback is sent only when the execution status is COMPLETED, indicating that the workflow has successfully executed and reached its final state.COMPLETED
timestampStringTimestamp when the response was created.2024-05- 24T16:18:01.379310507 Z
resultJSON objectThis object contains the channel information.See the specific table for details.

The following table describes the different attributes of the result object:

ParameterData TypeDescriptionExample
channel1JSON objectThis object contains the callback information of channel1.See the specific table for details.
channel2JSON objectThis object contains the callback information of channel2.See the specific table for details.

The following table describes the different attributes of the channel1 and channel2 objects:

ParameterData TypeDescriptionExample
workflowInvocationIdStringA unique internal invocation ID is assigned when the invocation is requested.4AhJXi67XXXXXXXXXXFyQT
executionStatusStringThe Callback is sent only when the execution status is COMPLETED, indicating that the workflow has successfully executed and reached its final state.COMPLETED
timestampStringTimestamp when the response was created.2024-05- 24T16:18:01.379310507 Z
createdAtStringTimestamp when the receipt was created. It is not the same as the created_at timestamp that you can find in the channel’s logs.2024-05- 24T16:17:51.479884794 Z
fromStringSender used to send the message (for example, SenderID for SMS, Display Name for WhatsApp).wasender
toStringA unique ID of the recipient used for that channel. For example, the mobile number to which SMS or WA messages have been sent.919620838XXX
messageIdStringInternal message ID at Fallback application level.9db24eba-eeae-41be-597a5-3ac45551ec1b
clientMessageIdStringGlobally unique Client Message ID that the caller has to set.0f6da8f1-923d-4995- a274-4830d09d8287
channelStringThe channel this message receipt refers to (for example, whatsapp, sms).whatsapp
statusCodeStringA normalized, channel-agnostic status code to which channel-specific status codes are mapped. Possible values include:

- TIMEOUT: When the IE timeout configured for that channel expires.
- NOT-SENT: When an outgoing message fails at the channel level and is never submitted to the downstream entity or carrier for delivery.
- DELIVERED: When an outgoing message reaches its final destination.
- UNDELIVERED: When the downstream entity or carrier fails to deliver the message to its final destination.
Note: Status codes starting with ERROR indicate internal errors at the Fallback application level.
TIMEOUT
channelMessageIdStringChannel Message ID that can be found in the channel log.
This is available only for statusCodes received from the channel.
83c09c45-240d-4aae-595ae-5925f82e86ea
statusDetailsStringThe actual status and status trace received by the channel. This is applicable only for statusCodes received from the channel.Delivered: DELIVRD: Message Delivered
acceptedAtStringTimestamp indicating when the message was accepted by the service responsible for submitting it to the channel. This is applicable only for statusCodes received from the channel.2024-05- 24T16:18:00.463204465 Z