all webhooks have type and timestamp in them
{
"type": "subscribe",
"timestamp": "2017-04-24T12:43:59-04:00",
"account_id": 123,
"campaign_id": 123,
"opt_id": 123,
"phone_number": "4173962846",
carrier_id: 77,
carrier_name: Verizon,
tag_list: ["tag_a", "tag_b"],
// Custom fields (if any configured)
"first_name": "John",
"email": "[email protected]",
"gender": null,
"zip": null,
"birthdate": null,
"first_opt_in_timestamp": "2017-04-24T12:43:59-04:00",
"last_opt_in_method": "keyword", // or API
"last_opt_in_keyword": "HELLO",
}
// pretty much as subscribe
{
"type": "unsubscribe",
"timestamp": "2017-04-24T12:43:59-04:00",
"account_id": 123,
"campaign_id": 123,
"opt_id": 123,
"phone_number": "4173962846",
"carrier_id": 77,
"carrier_name": Verizon,
"tag_list": ["tag_a", "tag_b"],
// Custom fields (if any configured)
"first_name": "John",
"email": "[email protected]",
"gender": null,
"zip": null,
"birthdate": null,
"first_opt_in_timestamp": "2017-04-24T12:43:59-04:00",
"last_opt_in_method": "keyword", // or API
"last_opt_in_keyword": "HELLO",
// Note, this field is added to unsubscribe webhook
"total_messages_received": 63,
}
{
"type": "message_sent",
"timestamp": "2017-04-24T12:43:59-04:00",
"account_id": 123,
"campaign_id": 123,
"message_id": 123,
"sent_timestamp": "2017-04-24T12:43:59-04:00",
"content": "Christmas sale, hurry up boys and girls!"
"recipient_count": 2000,
"success_count": 1900,
"bounce_count": 50,
"clean_count": 50,
"unsubscribe_count": 0
}
{
"type": "campaign_response",
"timestamp": "2017-04-24T12:43:59-04:00",
"account_id": 123,
"campaign_id": 123,
"message_id": 123,
"sent_timestamp": "2017-04-24T12:43:59-04:00",
"content": "Christmas sale, hurry up boys and girls!",
"response_timestamp": "2017-04-24T12:43:59-04:00",
"reply_content": "I'll be in your shop in 5 minutes",
"is_mms": true,
"attachment_urls": ["http://tatango-mms-attachments-production.s3.amazonaws.com/attachments/images/000/001/432/medium/x.png"]
"opt_id": 123,
"phone_number": "4173962846",
"carrier_id": 77,
"carrier_name": Verizon,
"tag_list": ["tag_a", "tag_b"],
// Custom fields (if any configured)
"first_name": "John",
"email": "[email protected]",
"gender": null,
"zip": null,
"birthdate": null,
"first_opt_in_timestamp": "2017-04-24T12:43:59-04:00",
"last_opt_in_method": "keyword", // or API
"last_opt_in_keyword": "HELLO",
}