Callbacks User Guide

From Social ID Developers
Jump to: navigation, search

Contents

Introduction

This channel will send a HTTP POST to the configured URL.

The payload will be JSON encoded and will contain the id of the user for whom the trigger was generated, the authorization token, a hash with the configured user fields, a hash with the configured profile fields, a hash with the configured datastore fields and a hash with the trigger parameters, according to the following structure:

 {
     "user_id": 123,
     "authorization_token": "cffgif5gfi4o6odpy4ca9",
     "profile": {},
     "datastore": {},
     "user": {},
     "event":
     {
         "event_type": "sign_up",
         "event_attrs": {},
         "triggered_at": "2023-08-17T00:03:35Z"
     }
 }

How to configure

Automation-engine-callback.png

  • Channel type: Callback
  • URL: inform the URL that will receive a HTTP POST request with the trigger data
  • Authorization Token: inform a token to be sent within the POST payload. When you receive the request in your URL endpoint you must validate the token to ensure the request is valid.
  • User Fields: select the fields you want to receive in the POST payload.
  • Social Profile Fields: select the fields you want to receive in the POST payload.
  • Datastore Fields: select the fields you want to receive in the POST payload.

Examples

Payload examples for some of the triggers generated by the CoffeeBean platform:

Trigger: Sign Up

Event triggered when a user is created into the platform.

Example including profile, datastore and user fields:

 {
     "user_id": 324336,
     "authorization_token": "cffgif5gfi4o6odpy4ca9",
     "profile":
     {
         "about_me": null,
         "addresses":
         [],
         "birthday": null,
         "certifications":
         [],
         "courses":
         [],
         "current_location": null,
         "display_name": null,
         "educations":
         [],
         "emails":
         [],
         "gender": null,
         "hometown": null,
         "honors": null,
         "ims":
         [],
         "industry": null,
         "interested_in_meeting":
         [],
         "interests":
         [],
         "languages_spoken":
         [],
         "locale": null,
         "name":
         {
             "formatted": null,
             "family_name": null,
             "given_name": null,
             "middle_name": null,
             "honorific_prefix": null,
             "honorific_suffix": null
         },
         "nickname": null,
         "organizations":
         [],
         "phone_numbers":
         [],
         "picture_url": null,
         "political_views": null,
         "preferred_username": null,
         "professional_headline": null,
         "profile_url": null,
         "quotes":
         [],
         "relationship_status": null,
         "religion": null,
         "significant_other": null,
         "specialties": null,
         "status": null,
         "updated": null,
         "urls":
         [],
         "utc_offset": null,
         "verified_account": null,
         "verified_email": null,
         "providers":
         {},
         "picture_urls":
         {}
     },
     "datastore":
     {
         "user_data":
         []
     },
     "user":
     {
         "id": 324336,
         "signed_up_at": "2023-08-16T23:54:58Z",
         "signed_in_at": null,
         "updated_at": "2023-08-16T23:54:58Z",
         "username": "john.doe",
         "email_address": "john.doe@coffeebeantech.com",
         "active": true,
         "confirmed": true,
         "locked": false
     },
     "event":
     {
         "event_type": "sign_up",
         "event_attrs":
         {},
         "triggered_at": "2023-08-16T23:54:58Z"
     }
 }

Trigger: Group Add

Event triggered when a user is added to a group.

Example without profile and datastore fields:

 {
     "user_id": 324336,
     "authorization_token": "cffgif5gfi4o6odpy4ca9",
     "profile":
     {},
     "datastore":
     {},
     "user":
     {
         "id": 324336,
         "signed_up_at": "2023-08-16T23:54:58Z",
         "signed_in_at": null,
         "updated_at": "2023-08-16T23:54:58Z",
         "username": "john.doe",
         "email_address": "john.doe@coffeebeantech.com",
         "active": true,
         "confirmed": true,
         "locked": false
     },
     "event":
     {
         "event_type": "user_group_create",
         "event_attrs":
         {
             "group_id": 464,
             "group_name": "Data Analyst"
         },
         "triggered_at": "2023-08-17T00:03:35Z"
     }
 }
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox