Unsubscribe Webhook¶
Talkable Unsubscribe Webhook provides notification of a user unsubscribing from Talkable sent referral email.
Use cases for the Unsubscribe Webhook include:
Unsubscribing users from in-house marketing newsletters when user unsubscribes from Talkable referral emails
Any event that should be triggered when a user unsubscribes from Talkable referral emails
When does Talkable call the Unsubscribe Webhook?
Talkable Unsubscribe Webhook is called any time a user unsubscribes from a Talkable sent email.
Payload parameters provided
person — subhash of parameters describing the person
email — person’s email address
phone_number — person’s phone number (optional)
first_name — person’s first name (optional)
last_name — person’s last name (optional)
username — person’s username (optional)
sub_choice — subscription choice (optional, present only if the form included subscription checkbox)
subscribed_at — date person has subscribed (deprecated; use
opted_in_at
instead)opted_in_at — date person has subscribed (optional)
phone_opted_in_at — date person has subscribed with email (optional)
unsubscribed_at — date person has unsubscribed with phone number (optional)
custom_properties — hash of person’s custom properties (optional)
is_loyalty_member — whether the person participates in loyalty program
loyalty_member — details of the person as a loyalty program participant (optional)
referral_counts — referral counts of person as Advocate
total — created referrals count
approved — approved referrals count
pending — count of waiting for approval referrals
gender [deprecated]
Sample payload
{
"person": {
"first_name": "Bob",
"last_name": "Smith",
"email": "referrer@example.com",
"phone_number": "+12025551111",
"username": "username",
"unsubscribed_at": null,
"subscribed_at": "2018-09-27T22:55:13.860+03:00",
"opted_in_at": "2018-09-27T22:55:13.860+03:00",
"phone_opted_in_at": "2018-09-27T22:55:13.860+03:00",
"sub_choice": true,
"referral_counts": {
"total": 0,
"approved": 0,
"pending": 0
},
"custom_properties": {},
"is_loyalty_member": false,
"loyalty_member": null,
"gender": null
}
}
cURL example
curl <url> \
-d "key=<key>" \
-d "site=<site>" \
-d "type=unsubscribe_web_hook" \
-d "extras={}" \
-d 'payload={"person":{"first_name":"Bob","last_name":"Smith","email":"referrer@example.com","phone_number":"+12025551111","username":"username","unsubscribed_at":null,"subscribed_at":"2018-09-27T22:55:13.860+03:00","opted_in_at":"2018-09-27T22:55:13.860+03:00","phone_opted_in_at":"2018-09-27T22:55:13.860+03:00","sub_choice":true,"referral_counts":{"total":0,"approved":0,"pending":0},"custom_properties":{},"is_loyalty_member":false,"loyalty_member":null,"gender":null}}'