User events

The payload object

{
   "app":"DemoApp",
   "timestamp":1580142086287,
   "version":2,
   "type":"user-event",
   "payload":{
      "phone":"callbackSetPhone"|"918x98xx21x4",
      "type":"sandbox-start"|"opted-in"|"opted-out"
   }
}
KeyDescriptionExample
phoneThe phone number of the customer who has sent the message on WhatsApp, number is in E.164 format918x98xx21x4
typeThe type of user-event received on your webhook.

Must be one of these: sandbox-start, opted-in, opted-out.
Refer to the description given below.

The types of user-events

{
   "app":"DemoApp",
   "timestamp":1580142086287,
   "version":2,
   "type":"user-event",
   "payload":{
      "phone":"callbackSetPhone",
      "type":"sandbox-start"
   }
}
{
   "app":"DemoApp",
   "timestamp":1580227393386,
   "version":2,
   "type":"user-event",
   "payload":{
      "phone":"918x98xx21x4",
      "type":"sandbox-start"
   }
}
{
   "app":"DemoApp",
   "timestamp":1584541505908,
   "version":2,
   "type":"user-event",
   "payload":{
      "phone":"918x98xx21x4",
      "type":"opted-in"
   }
}
{
   "app":"DemoApp",
   "timestamp":1584541505908,
   "version":2,
   "type":"user-event",
   "payload":{
      "phone":"918x98xx21x4",
      "type":"opted-out"
   }
}
TypeDescription
sandbox-startThis event is received when the app is in Sandbox mode and you have set a callback URL
sandbox-startThis event is received when the app is in Sandbox mode and you have used Gupshup proxy bot to invoke your App using command Proxy {{app_name}}.
opted-inThis event is received when an end user opt-in to receive notification from a business
opted-outThis event is received when an end user opt-out from receiving notification from a business

What’s Next

In the next chapter of this guide, you'll learn about inbound event type: System events