Integrating with Program UI

Download the postman collection for demo environment US clients

​

Download the postman collection for demo environment Asia clients

​

post
Register a device

https://api.customerglu.com/user/v1/user/sdk?token=true
Every single user must first be registered with CustomerGlu to create segments, run campaigns and report. To register a new device (Eg: Can be called during user sign up, app Install, firebase token refresh etc) Returns a JWT token in response The token needs to be passed in all the subsequent API calls To be called on firebase token refresh to update the token. Custom user attributes can be registered/updated by using customAttributes object.
Request
Response
Request
Headers
Content-Type
required
string
application/json
Body Parameters
userId
required
string
​
writeKey
required
string
Write key provided by CustomerGlu
sessionId
optional
string
​
userName
optional
string
​
email
optional
string
​
phone
optional
string
​
deviceId
optional
string
​
deviceType
optional
string
Accepted values: android/ios/default
deviceName
optional
string
​
firebaseToken
optional
string
Firebase token for enabling push notification
cookieId
optional
string
​
appVersion
optional
string
​
referredBy
optional
string
Id of the referred user (referral programs)
customAttributes
optional
object
Custom key-value pair. Can be used for segmentation
profile
optional
object
​
profile.age
optional
string
​
profile.city
optional
string
​
profile.country
optional
string
​
profile.timezone
optional
string
​
identities
optional
object
​
identities.facebook_id
optional
string
​
identities.google_id
optional
string
​
identities.android_id
optional
string
​
identities.ios_id
optional
string
​
identities.clevertap_id
optional
string
​
identities.mparticle_d
optional
string
​
identities.segment_id
optional
string
​
identities.moengage_id
optional
string
​
Response
200: OK
Cake successfully retrieved.
{
"success": true,
"data": {
"user": {
"id": "6022d697eb895132d430a803",
"userId": "test2081",
"gluId": "d6aeadf1-7131-4bb9-8c67-e3b003683b1f",
"userName": "Test User 2077",
"email": "[email protected]",
"phone": "977777252222",
"cookieId": "asdhbfkjsdv",
"appVersion": "1.0.3",
"client": "c27ecb52-0f00-443e-8dfe-01585b426ca7",
"referralLink": null,
"referredBy": "testuser36",
"customAttributes": {
"guruLevel": 2
},
"profile": {
"age": "29",
"city": "Bangalore",
"country": "India",
"timezone": "America/Los_Angeles"
},
"identities": {
"facebook_id": "asdf",
"google_id": "asdf",
"android_id": "asdf",
"ios_id": "asdf",
"clevertap_id": "asdfa",
"mparticle_id": "asdfasdf",
"segment_id": "asdf",
"moengage_id": "asdf"
},
"sessionId": "tempSessionId",
"deviceId": "xampT",
"deviceType": "ios",
"deviceName": "Samsung Note 07"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ0ZXN0MjA4MSIsImdsdUlkIjoiZDZhZWFkZjEtNzEzMS00YmI5LThjNjctZTNiMDAzNjgzYjFmIiwiY2xpZW50IjoiYzI3ZWNiNTItMGYwMC00NDNlLThkZmUtMDE1ODViNDI2Y2E3IiwiZGV2aWNlSWQiOiJ4YW1wVCIsImRldmljZVR5cGUiOiJpb3MiLCJpYXQiOjE2MTI4OTU4OTUsImV4cCI6MTY0NDQzMTg5NX0.bzW0HWbeI1hAIJN1xuuP5y3zUkzlSWn7fn6lDMxb_eM"
}
}
​

get
Load Campaigns

https://api.customerglu.com/reward/v1.1/user
To fetch all the ongoing campaigns that can be used to create banners or load the program UI using URLs. The response can be filtered using query params like: status: [pristine,clicked,completed] type: [memorygame,referral,slotmachine,spinthewheel,quiz] Following properties from response object can be used based on the user story defaultUrl: the URL for CustomerGlu wallet page which contains all the ongoing campaigns and rewards -banner: contains the banner text, image and styles if a banner is to be placed in the app
Request
Response
Request
Headers
Authorization
required
string
Bearer <token>
Content-Type
required
string
application/json
Query Parameters
status
optional
string
values can be [pristine,clicked,completed,in-progress]
type
optional
string
values can be any of this [spinthewheel,referral,quiz,slotmachine,memorygame,scratchcard]
Response
200: OK
{
"success": true,
"defaultUrl": "https://customerglu-previews-2.vercel.app/quiz?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ0ZXN0MjUiLCJjbGllbnQiOiIxN2E5MjNhMS04NGJjLTQwZTYtYWFiZi03YTNkZWE4Nzg0MDEiLCJkZXZpY2VJZCI6ImRldmljZWIiLCJkZXZpY2VUeXBlIjoiYW5kcm9pZCIsImlhdCI6MTYxMDU2MjY0MSwiZXhwIjoxNjQyMDk4NjQxfQ.XDVk0T7GoFgYozj9J17L7LdYtaJbjhpL1DOmF3VPWBw",
"campaigns": [
{
"campaignId": "3b6a9735-7255-4d38-b186-861b185d22a7",
"url": "https://customerglu-xyz.com",
"type": "quiz",
"status": "clicked",
"banner": {
"title": "Food Trivia",
"body": "Answer these questions based on cuisines from around the world to win rewards",
"image": "https://customerglu.com/assets/food.png"
}
},
{
"campaignId": "8eaf889d-e806-4fef-953e-419f1c620ad8",
"url": "https://customerglu-abc.com",
"type": "activityProgram",
"status": "in-progress",
"completed": 4,
"pending": 7,
"banner": {
"title": "First 100",
"body": "Get $100 on completing all tasks.",
"image": "https://customerglu.com/assets/first-100.png"
}
}
]
}

Use the defaultUrl or url parameter to load in the app webview