Integrate Reptrics Using HTTP API

Integrate Reptrics Using HTTP API

HTTP API Overview

To simplify integration, all calls are done via an HTTP GET or POST(x-www-form-urlencoded or application/json) request and always respond with HTTP 200 Response code and a 1x1 transparent GIF image. Every request must include your appKey which can be found on the Admin > AppKey Page.
Both events and attribute updates can be sent via the HTTP API.
All calls must include the appKey, account identifier and contact identifier. See this page (Tell Reptrics Who You and the User Are) to understand what these values should be.

EXAMPLES

HTTP GET

  1. https://analytics.reptrics.com/i?appKey={appkey}&accountExternalId={accountExternalId}&contactExternalId={contactExternalId}&action=...

HTTP POST (x-www-form-urlencoded)

  1. POST /i HTTP/1.1
    Host: https://analytics.reptrics.com/i
    Cache-Control: no-cache
    Content-Type: application/x-www-form-urlencoded

    appKey={appKey}&accountExternalId={accountExternalId}&contactExternalId={contactExternalId}&action=....


HTTP POST (applicaton/json)

  1. POST /i HTTP/1.1
    Host: https://analytics.reptrics.com/i
    Content-Type: application/json
    Cache-Control: no-cache
    {
    "appKey": "{appKey}",
    "accountExternalId": "{accountExternalId}",
    "contactExternalId": "{contactExternalId}",
    "action": "...",
    }

HTTP POST (application/json)

  1. POST /i HTTP/1.1
    Host: https://analytics.reptrics.com/i
    Content-Type: application/json
    Cache-Control: no-cache

    [
    {
    "appKey": "{appKey}",
    "accountExternalId": "{accountExternalId}",
    "contactExternalId": "{contactExternalId}",
    "action": "...",
    },
    {
    "appKey": "{appKey}",
    "accountExternalId": "{accountExternalId}",
    "contactExternalId": "{contactExternalId}",
    "action": "...",
    }
    ]
_________________________________________________________________________________________________________________

Track Events

To track an event, call the HTTP Get "trackEvent" action Api with the additional parameters:
  1. action (required) - Must be 'trackEvent'.
  2. eventName (required) - This is the unique name of the event (ie. "Sent Blog Post"). If the Event Name is not found it will be created.
  3. eventDate (optional) - The date of the event (defaults to time of API call) in format ISO-8601 ("2012-03-19T07:22Z")
  4. description (optional) - A description of this particular event (ie. blog title)
  5. quantity (optional) - The number related to this event. (ie. Commonly used to track things like email sent, etc)
  6. allowDupes (optional) - By default Reptrics ignores duplicate events (same Date, Account, Contact and Description). Set this parameter to "true" to allow duplicate events.
  7. cf_XXXX (optional) - The custom field to be updated prefixed by "cf_". You must create this custom field in Admin > Custom Fields > Events BEFORE you begin sending data for this field, or it will end up in the Description field of the Event


EXAMPLE

This example tracks the event "Email Sent" with a description of "Email Subject", quantity of 5 and custom field "field1" to "fieldValue1".

HTTP

  1. https://analytics.reptrics.com/i?appKey=123&accountExternalId=456&contactExternalId=789&action=trackEvent&eventName=Email+Sent&description=Email+Subject&quantity=5&cf_field1=fieldValue1
_________________________________________________________________________________________________________________

Set Attribute for Account or Contact

To set a value for a single attribute, call the HTTP Get 'setAttribute' with the following additional parameters:
  1. action (required) - Must be 'setAttribute'
  2. entity (required) - Can be either 'contact' or 'account'.
  3. name (required) - Name of attribute to be updated.
  4. value (required) - New value of attribute.

EXAMPLE

This example sets the Account attribute "Total Email Sent" to a value of 5.

HTTP

  1. https://analytics.reptrics.com/i?appKey=123&accountExternalId=456&action=setAttribute&entity=account&name=Total+Email+Sent&value=5
To set a value for multiple attributes, call the HTTP Get "setAttribute" with the following additional parameters:
  1. action (required) - Must be 'setAttribute'.
  2. entity (required) - Can be either 'contact' or 'account'.
  3. attr_XXXX (required) - Name of attribute to be updated prefixed by "attr_".

This example sets the Account attribute "Total Email Sent" to a value of 5 and sets the attribute "Email Enabled" to true.

HTTP

  1. https://analytics.reptrics.com/i?appKey=123&accountExternalId=456&contactExternalId=789&action=setAttribute&entity=account&attr_Total+Email+Sent=5&attr_Email+Enabled=true
If you want to set the attribute to NULL this can be done by passing "null" as value. For example:

HTTP

  1. https://analytics.reptrics.com/i?appKey=123&accountExternalId=456&contactExternalId=789&action=setAttribute&entity=account&name=Total+Email+Sent&value=null
Note: For account attributes, you can set 'contactExternalId' to null.

Updatable Standard Fields (Account and Contact)

For both forms of the setAttribute method, only the following standard fields (in addition to the custom fields) can be updated.
Note: Custom Tables cannot be updated with the setAttribute call. You can use Batch Imports to update Custom Table records

IMPORTANT:
If your company's Reptrics instance will be connected to your company's CRM (Salesforce, HubSpot, Pipedrive, etc.), by default that ALL of these standard account and contact attributes will be populated by your CRM. If your CRM is not the best source of accurate data for these fields, you can provide these values through the API instead. But please coordinate with your Reptrics CSM to make sure that your CRM sync will not update fields you will be updating via the API. The same field in Reptrics should not have two sources of data.

Standard Account Fields attr_xxxx
  1. Name (string)
  2. NextRenewalDate (date)
  3. TotalContractAmount (double)
  4. IsActive (Boolean)
  5. BillingAddressLine1 (string)
  6. BillingAddressLine2 (string)
  7. BillingAddressCity (string)
  8. BillingAddressState (string)
  9. BillingAddressZip (string)
  10. StartDate (datetime)
  11. EndDate (datetime)
  12. LicenseCount (int)
  13. OwnerUserAccount (string - matches on UserName)
  14. ParentAccountExternalId (string)
Standard Contact Fields
  1. FirstName (string)
  2. LastName (string)
  3. Email (string)

_________________________________________________________________________________________________________________

Increment Attribute for Account or Contact

To increment an attribute by a certain amount (numbers only), call the HTTP Get 'incrementAttribute' with the following additional parameters.
  1. action (required) - Must be 'incrementAttribute'.
  2. entity (required) - Can be either 'contact' or 'account'.
  3. name (required) - Name of attibute to be updated.
  4. value (required) - Value to add to current value (can be positive or negative).


EXAMPLE

This example increments the Account attribute "Total Email Sent" by 3.

HTTP

  1. https://analytics.reptrics.com/i?appKey=123&accountExternalId=456&action=incrementAttribute&entity=account&name=Total+Email+Sent&value=3

To increment multiple attributes by a certain amount (numbers only), call the HTTP Get 'incrementAttribute' with the following additional parameters.
  1. action (required) - Must be 'incrementAttribute'.
  2. entity (required) - Can be either 'contact' or 'account'.
  3. attr_XXXX (required) - Name of attribute to be updated prefixed by "attr_" with a value to add to the current value (can be positive or negative).

This example increments the Account attribute "Total Email Sent" by 3 and increments the attribute "Total Tweets" by 10.

HTTP

  1. https://analytics.reptrics.com/i?appKey=123&accountExternalId=456&contactExternalId=789&action=incrementAttribute&entity=account&attr_Total+Email+Sent=3&attr_Total+Tweets=10
_________________________________________________________________________________________________________________

Time In App

To track Contact Time In App, call the HTTP Get 'trackTimeInApp' with the following additional parameters:
  1. action (required) - Must be 'trackTimeInApp'.
  2. startDate (required) - The start date of the time in app in format ISO-8601 ("2012-03-19T07:22Z")
  3. endDate (required) - The end date of the time in app in format ISO-8601 ("2012-03-19T07:22Z")
  4. module (optional) - Name of the module the contact used (if not specific uses 'Default')

cURL

  1. https://analytics.reptrics.com/i?appKey=123&accountExternalId=456&contactExterna

Contact Us

In most cases, you would have a dedicated Customer Success Manager who will be your point-of-contact for any queries or assistance. You can always:

  1. Chat with us.

  2. Send an email to support@reptrics.com



    • Related Articles

    • Getting Started with Reptrics

      Objective  This article will assist you with getting up and running with your brand new Reptrics. This article will lay out the basics, considerations, and action steps that will help you self-onboard with minimum disruption. You can always contact ...
    • Sending and Managing Data in Reptrics

      Objective  This article will detail out the multiple options available for you to get the relevant data into Reptrics.   What data is pushed/pulled to Reptrics ? Once you have finalized the Account ID and User ID, there are multiple options available ...
    • Integrating Intercom with Reptrics

      Overview Reptrics supports integration with Intercom to pull in conversations and associated metrics. In this article, we list the steps and requirements to integrate Intercom with Reptrics.  Why should I integrate with Intercom? Integrating Intercom ...
    • Creating Accounts and Users in Reptrics

      Overview This document details out the options available to create Accounts and Users in Reptrics.  What is an Account?  An account in Reptrics is equivalent of a customer’s tenant/instance. Aggregation of Product Usage events and calculation of ...
    • Integrating Zendesk with Reptrics

      Overview Reptrics supports integration with Zendesk to pull in conversations and associated metrics. In this article, we list the steps and requirements to integrate Zendesk with Reptrics.  Why should I integrate with the Zendesk? Integrating Zendesk ...