Zigchat - API PAYLOADs
1. Format for triggering event based workflow
This is an api in which custom params can be sent in context
variables,corresponding to which a workflow will be configured
Sample payload
curl --location --request POST '[Link] \
--header 'access-key: XXXXmbLXi6y1c9VmwlFKVXa0Kuci3yhiL6XXXX' \
--header 'access-secret:
jtNIF7aKCaiMIWbpeVU2Lxxxxxj1b7Xq9UUE4FEZ5jSCOvavsuafruQAt6igE7BDueEEoFJoWlJ' \
--header 'ts: 1681xx14572' \
--header 'Input-token:
7c19c9fac91890ce5bxxxxxx1ce92b42d0a95e48649aa57158cb9acb804075e16b8b265550d31009ab6df7d9a914a
ea077eb8060c427xxxxxxb061e' \
--header 'Content-Type: application/json' \
--data-raw '{
"company_handle": "9188XXXXXXXX",
"channel_type": "WA_XXXX",
"send_now": "true",
"event_name": "tgowa_51",
"to": "918829971661",
"context_variables": {
"name":"test"
}
}'
–
2. Format for sending Whatsapp message (Pre Approved template
Sample payload
curl --location --request POST '[Link]
template' \
--header 'access-key: 8rY6jacohxxxxxxxMYRIz2nnNW0W88k33ZXh6' \
--header 'access-secret:
RkTnE4I2fZsEMBkxxxxxxxgYGhOZPGZZQavOiqB1XBoS2v5zF' \
--header 'ts: 1683xxx6121' \
--header 'Input-token:
21ba1f8c227b7665d02xxxxxxdde13257c4d931bb32c741b9a17f91dada564368
c77eb4af3f0bfbf1c4d7f73b1824caxx0903999357' \
--header 'Content-Type: application/json' \
--data-raw '{
"template_id": 4684,
"to": "9188296*****",
"company_handle": "918xxxx7694",
"channel_type": "WA_INFOBIP",
"header": {
"placeholder":
"[Link]
cvhROBJzPUlDYCcF9h9DBB7LQ90aWdR846iX7pOu1683890668031/
dreamcast_m-[Link]"
},
"data_attributes": {
"1": "test1",
“2”:”var 2”
},
"buttons": [
{
"index": 1,
"Follow us on Insta": "[Link]
}
]
}'
Responses:
Success
–
{
"timestamp": 1684321258695,
"status": 200,
"message": null,
"error": null,
"result": null,
"transaction_id": "14a0761f-33be-4f33-9186-d700deb3bac1",
"http_status": "OK"
}
—
Failure
–
"timestamp": 1684321344291,
"status": 400,
"error": "Bad Request",
–
3. ZigChat Webhook Curl(Stylespeaks)
curl --location --request POST '[Link] \
--header 'content-type: application/json' \
--header 'organization-id: 368' \
--data-raw '{
"name": "Anuj",
"customer number": 918829971661
}'