LogoLogo
HomeDashboardProduct Docs
  • Introduction
  • Core Concepts
    • Events
    • Sessions
    • User/Customer Profile
  • PLATFORM INTEGRATIONS
    • Shopify Integration
  • Sdk Integrations
    • Browser SDK
      • Integrate SDK
      • Track Events
      • Track Users
      • Configure Web Push
      • Reading Session Identifer
      • Syncing Cart Items
    • Android SDK (Coming Soon)
      • Install Android Sdk
      • Identify Customers
      • Push Notification Integration
    • iOS SDK
      • Install iOS Sdk
      • Tracking User
      • Tracking Events
      • Push Notification Settings
        • Configure APNS In Growlytics
        • Configure Mobile App For Push
        • Handling Push Click
    • Other
      • Upload Customers using CSV
  • Channel Integrations
    • Email
      • Amazon SES
      • SendGrid
      • Custom SMTP
    • Mobile Push Notifications
      • Configure FCM Channel
    • Web Push Notifications
    • Ad Networks
      • Facebook Audiences
      • Google Ad Audiences
  • REST APIs
    • Overview
    • Tracking Users (Shopify Only)
    • Tracking Users (Non-shopify)
    • Tracking Events (Shopify Only)
    • Tracking Events (Non-shopify)
    • Syncing Products
    • Mobile App Apis
  • Webhooks
    • Coupon Webhook
    • Connector Webhooks
Powered by GitBook
On this page
  • App Launch API
  • App Launch
  • Event Tracking API
  • Track Event API
  • Customer Login API
  • Identify Customer API
  • Customer Logout API
  • Logout User
  • Save Mobile Push Token API
  • Save Mobile Push Token

Was this helpful?

  1. REST APIs

Mobile App Apis

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

App Launch API

Call this api everytime when app is launched. This API will require a device id. Pass null if you don't have the device id (case when the app launched for the first time). If you won't pass the device id, this API will return a newly generated device id in response. Store that device id locally for all subsequest requests.

App Launch

POST https://dc.growlytics.in/mcrs_appl_v1

Headers

Name
Type
Description

x-growlytics-key

string

Growlytics Api key.

Request Body

Name
Type
Description

timestamp

number

Event time. Unix Timestamp in milli seconds.

info

object

A JSON with device details like device type, app version etc. Structure of the info is mentioned below.

did

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.

{
    "did": "--device-id--goes-here",
    "sid": "--session id goes here"
}
{
    "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.

{
    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
    }
}
{
    "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"
    }
}

Event Tracking API

Call this API when you want to track a particular event.

Track Event API

POST https://dc.growlytics.in/msv_cevt

Use this API to track events from your mobile app.

Headers

Name
Type
Description

x-growlytics-key

string

Growlytics API key.

Request Body

Name
Type
Description

did

string

Device id. Required.

name

string

Event Name. Required, Max 120 characters.

timestamp

number

Unix timestamp in milli-seconds. Required.. 13 digits.

info

array

List of event attributes. Detailed structure of the array is mentioned below seperetely.

{ success: true }
{
    "type": "ValidationError",
    "details": [
        {
            "message": "type is required",
            "path": [
                "type"
            ],
            "type": "any.required",
            "context": {
                "key": "type",
                "label": "type"
            }
        }
    ]
}

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

info: [
    {
        "name": Required, Max 120 characters
        "value": Required, null allowed, Max 100 characters
        "type": Required, Allowed: 'integer', 'float', 'double', 'long', 'boolean', 'date', 'string'
    }
]
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"
    }
]

Customer Login API

Call this API when a customer logs in to your mobile app.

Identify Customer API

POST https://dc.growlytics.in/msv_cs_id

Headers

Name
Type
Description

x-growlytics-key

string

Growlytics API Key.

Request Body

Name
Type
Description

did

string

Device id. Required.

clientCustomerId

string

Customer identifier of your system/app. For example, if you are using Shopify, it will be sShopify customer id.

timestamp

string

Unix timestamp in milliseconds. Required, 13 digits.

info

array

List of customer attributes. The detailed structure of the array is mentioned below seperetely.

{ success: true }
{
    "type": "ValidationError",
    "details": [
        {
            "message": "type is required",
            "path": [
                "type"
            ],
            "type": "any.required",
            "context": {
                "key": "type",
                "label": "type"
            }
        }
    ]
}

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

info: [
    {
        "name": Required, Max 120 characters
        "value": Required, null allowed, Max 100 characters
        "type": Required, Allowed: 'integer', 'float', 'double', 'long', 'boolean', 'date', 'string'
    }
]
info: [
    { name: 'name', type: 'string', value: '-My-Name-' },
    { name: 'email', type: 'string', value: 'myemail@gmail.com' },
    { 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' }
]

Customer Logout API

Call this API when a customer logs out of the app. Make sure after the logout API is successful, you need to generate a new device id by calling AppLaunched API.

Logout User

POST https://dc.growlytics.in/logout

Request Body

Name
Type
Description

did*

String

Device id. Required.

{
    // Response
}

Save Mobile Push Token API

Call this API when customer subscribes to push notifications. You will need to pass the device id which you have got in the app launch API response.

Save Mobile Push Token

POST https://dc.growlytics.in/mpush_token

Use this API to save the mobile push firebase token

Headers

Name
Type
Description

x-growlytics-key

string

Growlytics API key.

Request Body

Name
Type
Description

did

string

Device id. Required.

type

string

Type of token. Valid values are "fcm" and "apns".

token

string

FCM or APNS Token

timestamp

number

Unix timestamp in milliseconds. Required, 13 digits.

{ success: true }
Example Of Invalid Input JSON
{
    "type": "ValidationError",
    "details": [
        {
            "message": "type is required",
            "path": [
                "type"
            ],
            "type": "any.required",
            "context": {
                "key": "type",
                "label": "type"
            }
        }
    ]
}

PreviousSyncing ProductsNextCoupon Webhook

Last updated 2 years ago

Was this helpful?