Toplyne API

API Headers

HeaderDescriptionData type
AuthorizationGenerated Toplyne API token

eg: Bearer 'ToplyneAPIToken'
str
Content-TypeRequest content-type is always set to application/json; charset=utf-8str

Generating Toplyne API tokem

  1. From your Toplyne dashboard, navigate to Settings > API Settings and click on + Generate new token.

  2. Enter a name for your token, and select 'Does not expire' under Expiration. Then click Generate new token.

  3. Copy the access token that has just been generated. This will be the authorization key that goes on your header.

API structure

Account Event API

AccountEventAPI will enable you to insert events at an account level into the Toplyne System. You can read more about accounts here and events here.

The max number of events you can insert per call is 500.

Endpoint : https://api.toplyne.io/v1/upload/accounts/events

Events are uploaded as a JSON payload with the object keyed at “events“. The JSON should adhere to a predefined structure. For each event - accountId, timestamp, and eventName are must-have properties. Additional properties can be sent via the eventProperties nested JSON.

ParameterDescriptionDatatype
accountId
(Required)
Set to the unique identifier of accounts in your system. This has to be uniform across all the systems you integrate with toplynestr
eventName
(Required)
Set to the Event name of the event the corresponding accountId has preformedstr
timestamp
(Required)
Set to the timestamp when the event occured, Formatted as a UNIX epoch in secondsint
eventProperties
(Optional)
Set additional properties for the eventobj

Sample Request JSON

{
"events": [
    {
      "accountId": "9657841",
      "eventName": "Login_Succeeded",
      "timeStamp": 1639303296,
      "eventProperties": {
            “prop1“: ”value1”,
            “prop2“: ”value2”
        }
    ]
}

Sample Response JSON

{
    "MsgCode": "100",
    "Msg": "Events uploaded",
    "status": "success"
}

Sample Response JSON (Wrong API Token)

{
    "MsgCode": 400,
    "Msg": "Authentication Failure",
    "status": "failure"
}

Account Profile API

AccountsAPI lets you insert account details into the system.

The max number of accounts you can insert per call is 100.

Endpoint : https://api.toplyne.io/v1/upload/accounts/profiles

Accounts are uploaded as a JSON payload with the object keyed at “accounts“. The JSON should adhere to a predefined structure. For each profile, a accountId, creationTime are must have properties. There are a few optional params as mentioned below. Additional properties can be send via the accountProperties nested json.

ParameterDescriptionDatatype
accountId
(Required)
Set to the unique identifier of accounts in your system. This has to be uniform across all the systems you integrate with toplynestr
creationTime
(Required)
Set to the timestamp when account was created, Formatted as a UNIX epoch in secondsint
accountName
(Optional)
Set to the account name of the accountstr
website
(Optional)
Set to the website of the accountstr
country
(Optional)
Set to the country of the accountstr
accountProperties
(Optional)
Set additional properties for the accountobj

Sample Request JSON

{
"profiles": [
    {
      "accountId": "9657841",
      "creationTime": 1639303296,            
      "accountName": "toplyne",
      "website": "www.toplyne.io",
      "country": "India",
      "accountProperties": {
            “prop1“: ”value1”,
            “prop2“: ”value2”
        }
    ]
}

Sample Response JSON

{
    "MsgCode": "100",
    "Msg": "Accounts uploaded",
    "status": "success"
}

Sample Response JSON (Wrong API Token)

{
    "MsgCode": 400,
    "Msg": "Authentication Failure",
    "status": "failure"
}

User Event API

UserEventAPI will enable you to insert events at an individual user level into the Toplyne System. You can read more about accounts here and events here.

Endpoint : https://api.toplyne.io/v1/upload/users/events

Events are uploaded as a JSON payload with the object keyed at “events“. The JSON should adhere to a predefined structure. For each event, a userId, timestamp and event name is must have properties. Additional properties can be send via the eventProperties nested json.

ParameterDescriptionDatatype
usertId
(Required)
Set to the unique identifier of users in your system. This has to be uniform across all the systems you integrate with toplynestr
eventName
(Required)
Set to the Event name of the event the corresponding user has preformedstr
timestamp
(Required)
Set to the timestamp when the event occured, Formatted as a UNIX epoch in secondsint
eventProperties
(Optional)
Set additional properties for the eventobj

Sample Request JSON

{
"events": [
    {
      "userId": "9657841",
      "eventName": "Login_Succeeded",
      "timeStamp": 1639303296,
      "eventProperties": {
            “prop1“: ”value1”,
            “prop2“: ”value2”
        }
    ]
}

Sample Response JSON

{
    "MsgCode": "100",
    "Msg": "Events uploaded",
    "status": "success"
}

Sample Response JSON (Wrong API Token)

{
    "MsgCode": 400,
    "Msg": "Authentication Failure",
    "status": "failure"
}

User Profile API

UserProfileAPI lets you upsert profiles into the system.

The max number of profiles you can insert per call is 100.

Endpoint : https://api.toplyne.io/v1/upload/users/profiles

Profiles are uploaded as a JSON payload with the object keyed at “profiles“. The JSON should adhere to a predefined structure. For each profile, a userId, creationTime is must have properties. There are a few optional params as mentioned below. Additional properties can be send via the userProperties nested json.

ParameterDescriptionDatatype
userId
(Required)
Set to the unique identifier of users in your system. This has to be uniform across all the systems you integrate with toplynestr
creationTime
(Required)
Set to the timestamp when account was created, Formatted as a UNIX epoch in secondsint
firstName
(Optional)
Set to the first name of the userstr
lastName
(Optional)
Set to the first name of the userstr
email
(Optional)
Set to the email of the userstr
phone
(Optional)
Set to the phone of the userstr
country
(Optional)
Set to the country of the userstr
userProperties
(Optional)
Set additional properties for the userobj

Sample Request JSON

{
"profiles": [
    {
      "userId": "9657841",
      "creationTime": 639303296,
      "firstName": "McLovin",
      "lastName": "",
      "email": "[email protected]",
      "phone": "8075464375",
      "country": "USA",
      "userProperties": {
            “prop1“: ”value1”,
            “prop2“: ”value2”
        }
    ]
}

Sample Response JSON

{
    "MsgCode": "100",
    "Msg": "Users uploaded",
    "status": "success"
}

Sample Response JSON (Wrong API Token)

{
    "MsgCode": 400,
    "Msg": "Authentication Failure",
    "status": "failure"
}