API

The API system supports profile and event updates. This document describes authentication, endpoints and the api in detail

Authentication and Endpoints

To obtain the API Key, On the dashboard, Navigate to Menu > Settings. You will find API Key as shown in the below screen shot.

API Key

All HTTP Requests must use following headers with each request.

  • Content-Type must always be set to application/json
  • X-Api-Key must be set the API key you obtain as described above

All requests must be sent to https://api.livepinch.com/api/1.0/ All requests accept parameters as JSON POST body

Profile Update API

  • Endpoint: https://api.livepinch.com/api/1.0/profile/update
  • HTTP Method: POST

Required parameters

  • profile_key - Should be any identifier through which you identify the user. Customer ID, email, phone are all good identifiers
  • profile_data - An object containing, key value pairs of attributes to be set

Example payload

1
2
3
4
5
6
7
8
9
 {
   "profile_key": "19087123984",
   "profile_data": {
     "first_name": "John",
     "last_name": "Doe",
     "email": "john.doe@gmail.com",
     "gender": "male"
   }
 }

Example successful response

1
2
3
4
 {
   "success": true,
   "profile_id": "<profile_id>"
 }

Example error response

1
2
3
4
 {
   "success": false,
   "message": "Invalid API Key"
 }

Event Push API

  • Endpoint: https://api.livepinch.com/api/1.0/events/push
  • HTTP Method: POST

Required parameters

  • profile_key - Should be any identifier through which you identify the user. Customer ID, email, phone are all good identifiers
  • event_name - Event name. Good examples would be, “Delivery Made”, “Added to Cart”
  • event_data - An object containing, key value pairs of attributes to be set

Optional parameters

  • _ip - IP Address, If given, the the location data will be inferred through this
  • _ua - User Agent String, if given technographical details such as browser, os etc.. will be inferred from this
  • event_ts - Should be integer UNIX timestamp. This time is considered in UTC timezone.

Example payload

1
2
3
4
5
6
7
8
 {
   "profile_key": "19087123984",
   "event_name": "Added to Cart",
   "event_data": {
     "cart_size": 3,
     "amount": 25.5
   }
 }

Example successful response

1
2
3
4
 {
   "success": true,
   "event_id": "<event_id>"
 }

Example failure response response

1
2
3
4
 {
   "success": false,
   "message": "Invalid API Key"
 }

Postman Collection

Here is a Postman Collection of the API