Mobile App Apis

Use mobile app apis to sync events and customer data with Growlytics platform.

post
App Launch API

https://dc.growlytics.in/mcrs_appl_v1
Request
Response
Request
Headers
x-growlytics-key
optional
string
Growlytics Api key.
Body Parameters
timestamp
optional
number
Event time. Unix Timestamp in milli seconds.
info
optional
object
A JSON with device details like device type, app version etc. Structure of the info is mentioned below.
did
optional
string
Device id. If device id is specified, app launch event will be tracked against given device id. If device id not specified, a new device profile will be created and device profile id will be returned in response to use it for next requests.
Response
200: OK
Success
{
"did": "--device-id--goes-here",
"sid": "--session id goes here"
}
422: Unprocessable Entity
Invalid input. Request payload is not in valid format.
{
"type": "ValidationError",
"details": [
{
"message": "type is required",
"path": [
"type"
],
"type": "any.required",
"context": {
"key": "type",
"label": "type"
}
}
]
}

The structure of the info object is mentioned below.

Structure of Info object in request body
Example of info object
Structure of Info object in request body
{
appVersionCode: number, required
appVersionName: string, required
sdkVersion: number, required
// Is First Time
firstTime: boolean, required
deviceType: string, required
deviceManufacturer: string, required
deviceModel: string, required
deviceCarrier: string, required
osName: string, required
osVersion: string, required
platform: string, required, valid('ANDROID', 'IOS')
language: string, required
referrer: string, optional, // Traffic Source
utmInfo: {
us: string, required, optional, allow(null) // UTM source
um: string, required, optional, allow(null) // UTM medium
uc: .string, required, optional, allow(null) // UTM campaign
}
}
Example of info object
{
"appVersionCode": 16,
"appVersionName": "4.2.11",
"osName": "Android",
"osVersion": "Android 9",
"language": "en",
"platform": "ANDROID",
"deviceType": "MOBILE",
"deviceManufacturer": "OnePlus",
"deviceModel": "ONEPLUS A5000",
"deviceCarrier": "Vodafone IN",
"sdkVersion": 1,
"firstTime": false,
"referrer": "https://facebook.com",
"utmInfo": {
"us": "google",
"um": "email",
"uc": "Diwali Campaign"
}
}

post
Track Event API

https://dc.growlytics.in/msv_cevt
Use this API to track events from your mobile app.
Request
Response
Request
Headers
x-growlytics-key
optional
string
Growlytics API key.
Body Parameters
did
optional
string
Device id. Required.
name
optional
string
Event Name. Required, Max 120 characters.
timestamp
optional
number
Unix timestamp in milli-seconds. Required.. 13 digits.
info
optional
array
List of event attributes. Detailed structure of the array is mentioned below seperetely.
Response
200: OK
Success. Event Tracked Successfully.
{ success: true }
422: Unprocessable Entity
Invalid Input. Request payload is not in valid format.
{
"type": "ValidationError",
"details": [
{
"message": "type is required",
"path": [
"type"
],
"type": "any.required",
"context": {
"key": "type",
"label": "type"
}
}
]
}

The structure of the info object for event tracking is mentioned below.

Structure of Info object in request body
Example of info object
Structure of Info object in request body
info: [
{
"name": Required, Max 120 characters
"value": Required, null allowed, Max 100 characters
"type": Required, Allowed: 'integer', 'float', 'double', 'long', 'boolean', 'date', 'string'
}
]
Example of info object
info: [
{
"name": "Product Name",
"value": "Macbook Pro 2020",
"type": "string"
},
{
"name": "Category",
"value": "Electronics",
"type": "string"
},
{
"name": "SubCategory",
"value": "Laptops",
"type": "string"
},
{
"name": "Price",
"value": 139000,
"type": "integer"
},
{
"name": "Is Under Warranty",
"value": true,
"type": "boolean"
},
{
"name": "Product Expiry Date",
"value": "2020-01-20 19:14:15",
"type": "date"
}
]

post
Identify Customer API

https://dc.growlytics.in/msv_cs_id
Request
Response
Request
Headers
x-growlytics-key
optional
string
Growlytics API Key.
Body Parameters
did
optional
string
Device id. Required.
clientCustomerId
optional
string
Customer identifier of your system/app. For example, if you are using Shopify, it will be sShopify customer id.
timestamp
optional
string
Unix timestamp in milliseconds. Required, 13 digits.
info
optional
array
List of customer attributes. The detailed structure of the array is mentioned below seperetely.
Response
200: OK
Success. Customer details saved successfully.
{ success: true }
422: Unprocessable Entity
Invalid input. Request payload is not in valid format.
{
"type": "ValidationError",
"details": [
{
"message": "type is required",
"path": [
"type"
],
"type": "any.required",
"context": {
"key": "type",
"label": "type"
}
}
]
}

The structure of the info object for identifying customers is mentioned below.

Structure of Info object in request body
Example of info object
Structure of Info object in request body
info: [
{
"name": Required, Max 120 characters
"value": Required, null allowed, Max 100 characters
"type": Required, Allowed: 'integer', 'float', 'double', 'long', 'boolean', 'date', 'string'
}
]
Example of info object
info: [
{ name: 'name', type: 'string', value: '-My-Name-' },
{ name: 'email', type: 'string', value: '[email protected]' },
{ name: 'mobile', type: 'string', value: 9876543210 },
{ name: 'Department', type: 'string', value: 'Test Department' },
{ name: 'Test Number', type: 'integer', value: 72305 },
{ name: 'Test Float', type: 'float', value: 7230554.345 },
{ name: 'Test Double', type: 'double', value: 723055465462.345 },
{ name: 'Test Long', type: 'long', value: 723055465462345678 },
{ name: 'Test Boolean', type: 'boolean', value: true },
{ name: 'Test Date', type: 'date', value: '2020-01-01 05:05:05' }
]

post
Save Mobile Push Token

https://dc.growlytics.in/mpush_token
Use this API to save the mobile push firebase token
Request
Response
Request
Headers
x-growlytics-key
optional
string
Growlytics API key.
Body Parameters
did
optional
string
Device id. Required.
type
optional
string
Type of token. Valid values are "fcm" and "apns".
token
optional
string
FCM or APNS Token
timestamp
optional
number
Unix timestamp in milliseconds. Required, 13 digits.
Response
200: OK
Success. Mobile push token saved successfully.
{ success: true }
422: Unprocessable Entity
Invalid Input. Request body is not in acceptable format.
Example Of Invalid Input JSON
{
"type": "ValidationError",
"details": [
{
"message": "type is required",
"path": [
"type"
],
"type": "any.required",
"context": {
"key": "type",
"label": "type"
}
}
]
}