Get Flows by WABA ID
GET Method
Kaleyra Platform's Get Flows by WABA ID API allows you to retrieve the flows details associated with a given WABA ID. The details include flow ID, flow name, flow status, flow categories, and validation error related to the flow (if any).
Prerequisites
- Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on Kaleyra platform. - To set up a WhatsApp account on Kaleyra platform, see Manual Signup
and Embedded Signup. - An active WhatsApp for Business API plan that includes:
- A WhatsApp business number.
- An associated profile with the business number.
- A WhatsApp verified and approved profile.
- A WABA ID onboarded on Kaleyra WhatsApp API V2.
Base URL
https://<api_domain>/v2/<SID>
API Domain and Value
api_domain | Value |
---|---|
IN pod | api.in.kaleyra.io |
SG Pod | api.kaleyra.io |
EU Pod | api.eu.kaleyra.io |
NA pod | api.na.kaleyra.ai |
API request to get Flows by WABA ID
To get Flows details by WABA ID, use the following endpoint with the request method: https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/flows
.
Request Format
The following is the request format to get Flows details by WABA ID:
curl --location --request GET 'https://<api_domain>/v2/<sid>/whatsapp/<waba_id>/flows?fields=<fields>' \
--header 'api-key: <api-key>'\
--header 'Content-Type: <Content-Type>'
Sample Request Format
The following is the sample request format to get Flows details by WABA ID:
curl --location --request GET 'https://api.in.kaleyra.io/v2/HXAP16XXXXXX97IN/whatsapp/112xxxxxxxxxx207/flows?fields=id%252Cname%252Cstatus%252Ccategories%252Cvalidation_errors' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3'\
--header 'Content-Type: application/json'
URL Parameters and Headers
Following is the list of parameters and headers to get Flow details by WABA ID:
Parameter / Headers | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
sid | String | Account SID (Security Identifier). | HXAP16XXXXXX97IN | Yes |
waba_id | String | The WABA ID for which you want to get flows details. | 112xxxxxxxxxx207 | Yes |
api-key | String | API key generated from Kaleyra account. | Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3 | Yes |
Content-Type | String | Indicates the format of the content the API will be processing. | The only allowed value is application/json. | Yes |
Fields | String | To retrieve further filtered down list. | See the specific table for details. | No |
Note:
Optional parameter
fields
are added to this API. The possible values are:id
,name
,status
,categories
,validation_errors
, andupdated_at
. This is introduced to display the necessary information on the UI. If not passed, the response will be similar to the one attached in the sample response.
Following is the list of query parameters to get Flow details by WABA ID:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
id | String | The unique ID of the Flow. | flow-1 | Optional |
name | String | The user-defined name of the Flow which is not visible to users. | flow 1 | Optional |
status | String | DRAFT: This is the initial status. The Flow is still under development. The Flow can only be sent with mode : draft for testing.PUBLISHED: The Flow has been marked as published by the developer so now it can be sent to customers. This Flow cannot be deleted or updated afterwards. DEPRECATED: The developer has marked the Flow as deprecated (since it cannot be deleted after publishing). This prevents sending and opening the Flow, to allow the developer to retire their endpoint. Deprecated Flows cannot be deleted or undeprecated. BLOCKED: Monitoring detected that the endpoint is unhealthy and set the status to Blocked. The Flow cannot be sent or opened in this state; the developer needs to fix the endpoint to get it back to the Published state. THROTTLED: Monitoring detected that the endpoint is unhealthy and set the status to Throttled. Flows with a throttled status can be opened, however, only 10 messages of the Flow can be sent per hour. The developer needs to fix the endpoint to get it back to the PUBLISHED state. | DRAFT | Optional |
categories | Array | A list of flow categories. | CONTACT_US | Optional |
validation_errors | Array | A list of errors in the Flow. Note: All errors must be fixed before the Flow can be published. | Optional |
Sample Success Response
The following success message appears with the status 200 Accepted:
{
"data": [
{
"id": "flow-1",
"name": "flow 1",
"status": "DRAFT",
"categories": [ "CONTACT_US" ],
"validation_errors": []
},
{
"id": "flow-2",
"name": "flow 2",
"status": "PUBLISHED",
"categories": [ "SURVEY" ],
"validation_errors": []
},
{
"id": "flow-3",
"name": "flow 3",
"status": "DRAFT",
"categories": [ "LEAD_GENERATION" ],
"validation_errors": []
}
],
"paging": {
"cursors": {
"before": "QVFI...",
"after": "QVFI..."
}
}
}
Sample Failure Response
The following are the failure responses:
401 Unauthorized
{
"code": "RBC001",
"message": "Incorrect SID or API key.",
"data": [],
"error": {
"error": "Incorrect SID or API key."
}
}
400 Incorrect payload
{
"code": "WA-400",
"message": "Refer to correct payload format",
"data": {},
"error": {
"payload": "Incorrect payload format"
}
}
500 Internal Server Error
{
"code": "WA-500",
"message": "Please try again later",
"data": {},
"error": {
"error": "Internal server error"
}
}
Updated about 4 hours ago