Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Nudge Webhook

Send the nudge payload (similar to rewards) to your servers in case of not configuring direct nudges from CustomerGlu to End User Device using Firebase/APNS

A webhook url can be provided to CustomerGlu to receive the nudges to be shown to users in real-time

The app can be configured to open the url present in "clickAction" property in a webview.

A POST request will be made to the specified Webhook URL . Example request body is as follows:

{
   "client":"xyzc-b2e0-4927-8653-cba2babc2",
   "campaignId":"acxscx26-5437-4b37-855f-a3f6edqccqc4",
   "userId":"glutest-1",
   "notificationType":"push",
   "pageType":"full-default",
   "content":{
      "button":{
         "text":"Go to Reward",
         "action":"https://xyz.customerglu.net"
      },
      "title":"Scratch card unlocked! 😍",
      "body":"Check to see how much you've won 🙌",
      "clickAction":"https://xyz.customerglu.net",
      "image":""
   },
   "timeRemaning":"",
   "expiry":""
}

Optionally, to verify the authenticity of request, a secret token can be provided to CustomerGlu.

When you set a token, you'll receive the X-CG-SIGNATURE header in the webhook POST request. value of this header will be a hmac hexdigest of the request body with the provided token. See on how to validate the requests

Validating Nudge Webhook

Note: CustomerGlu requires the raw body of the request to perform signature verification. If you are using a framework/library, make sure it doesn't manipulate the raw body. Any manipulation to the raw body of the request will cause the verification to fail.

Last updated