Members & Leads with API

Welcome to the Interakt API documentation. In the documentation, we have also provided some examples in Curl. Interakt's API contains resources with predicatable urls and utilizes standard HTTP features.

API end-point

  1. https://app.interakt.co/api/v1

  2. API end-point supports json data

  3. Interakt offers two end-points for members > /members and for leads > /leads

Authentication

  1. Interakt expects an App ID & an API Key to be included in all API requests to the server.

  2. Basic Authentication is used to authenticate with the HTTP API.

  3. To get App ID & API Key of your project navigate to Project Settings.

    Image02
  4. Click on API from sidebar.

    Api_settings_subnav
  5. Copy your App ID & API Key.

    Image26
Email is mandatory to hit Interakt's API otherwise the system will silently ignore the request.

Creating Leads

Creating a lead, Expects a JSON object describing the lead.

  1. Creating and Updating a lead requires email, without it our system will silently ignore the call.

  2. Sample call for creating a lead on Interakt

    curl -i "https://app.interakt.co/api/v1/leads" \ -X POST \ -u 8acefb9f58d86310ce6c2cd1d6b38f6b:ca86bf804f04a6f194060540dca78c65 \ -H "Content-Type: application/json" \ -d '{ "email" : "sudhanshu@interakt.co", "name" : "sudhanshu", "phone" : 123455667, "company" : "interakt.co", "url" : "https://interakt.co", "country" : "United States" }'
  3. Request details for creating leads

    Parameter Required Description
    email Yes The lead's email address
    name No Name of the lead
    phone_number No Phone number of lead
    url No Website of lead
    country No Country of lead
    attribute No Any key-value pair can be passed to that it will get stored in lead data
  4. Interakt will save the described values by default and if you want to add other attributes you can do that by adding those attributes to the call just like the default ones and the system will save those values.

  5. After successfully creating the lead Interakt will respond with a 200 status.

Creating Member

Creating a member, Expects a JSON object describing member

  1. Creating and Updating a member requires and email, without it our system will silently ignore the call.

  2. Sample call for creating a member on Interakt.

    curl -i "https://app.interakt.co/api/v1/members" \ -X POST \ -u 8acefb9f58d86310ce6c2cd1d6b38f6b:ca86bf804f04a6f194060540dca78c65 \ -H "Content-Type: application/json" \ -d '{ "email" : "support@interakt.co", "name" : "support", "created_at" : 1257553080, "custom_fields" : {"plan" : "pro"}, "city" : "New York", "country" : "United States" }'
  3. Request details for creating members

    Parameter Required Description
    email Yes The user's email address
    name No Name of the User
    created_at No When user signed up for your service
    custom_fields No Put any hash containing key values and that will be added to custom data of User
    country No Country of the User
    attribute No Any key-value pair can be passed to that it will be stored in member data
  4. Interakt will save the following values by default and if you want to add other attributes you can do that by adding those attributes to the call just like default ones and the system will save those values

  5. After successfully creating the member Interakt will respond with 200 status.

Accepting and Publishing Timestamps

Interakt creates it's own database entry with every signup on your website. A user can pass different values while registering an account. For example, he may provide his email id, name, and the city as his contact details along with the date of joining. Here is a sample:

email: "test@interakt.com", name: "test", city: "Delhi", country: "India", age: 25, created_at: 1467875969, (this is Unix time stamp) date_of_birth_at: "1467875969", (this is Unix time stamp but in string format) testing_at: "Interakt", joined_at: "1467875969test", app_id: 'fe61d23f7b3db4d4c5ef8454bdc626ef'

While storing the Date/Time, Interakt checks the attributes that have _at at the end. Such as,

The only condition to accept timestamps is that value should be a valid unix timestamp. In our example, we have 1467875969 for the attribute created_at. Interakt will convert this into date-time and store in the database.

Also, the Unix time stamp can be of string type like in the above-mentioned user entry, i.e., 1467875969. We convert this to a valid date & time and save in the database.

Please note that if a user sends a string that is not a valid Unix timestamp, we save it into the database as a string. In our example, we have 1467875969test for joined_at which will be stored as a string without converting.

  • Make sure you add _at at the end of attribute name to convert values into timestamps
  • You are free to use either of these two attributes to pass the signup time
    • created_at
    • signedup_at
Please note that we are not accepting 2 type of datatypes: 1) Null and 2) Hash

Getting User & Order details

Interakt creates it's own database entry with every signup on your website. You may collect basic information like their name, location, and date of joining and additional data like age and gender.

Custom Data (Information of User) - optional

Interakt allows you to save any kind of information for a user and will let you create filters and segments on the basis of data collected.

For example, if you are running an astrology website, custom data like wedding date and spouse name can be asked.

One
You may need to hire a developer to integrate tracking code with custom variables

Array Of JSON (Order / Purchase data, etc) - optional

To get customer details via Orders app, you need to grab basic details and additional data, e.g., “quantity” and “number of items”.

Array 1

Two

To get order details, you need to grab basic details and additional data, e.g., “date of order placement” and “order value”.

Array 2

Three

Feel free to connect in case of issues at support@interakt.co

⇪ To Contents