NAV Navbar
shell php java ruby python javascript Json Response
  • Introduction
  • Authorization
  • Contacts
  • Companies
  • Fields
  • Segments
  • Webhooks
  • Point Actions
  • Point Triggers
  • Introduction

    Welcome to the Aritic PinPoint API documentation! To simplify a developer's work, we at Aritic PinPoint have built developer-friendly APIs which are supported by the major programming languages to interact with your PinPoint instance.

    We have language bindings for PHP, Java, Shell, Ruby and Python! You can view code examples on the right side of this page and use the top right tabs to switch between different programming languages.

    Our APIs work over the HTTP protocol with JSON and build in an RPC-like manner, and you can do anything with the API's using their particular action provided. All the HTTP requests must be made over HTTPS URL given in the action defined in this documentation. All responses you receive from the API will return in JSON.

    Requests should be made using the POST method with any parameters encoded as JSON in the body of the request.

    Authorization

    Basic Authentication Key

    $echo "username password" | base64
    
    
    Output :  qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert
    
    <?php
        echo base64_encode("username:password");
    ?>
    
    
    byte[] encodedBytes = Base64.encodeBase64("username:password".getBytes());
    System.out.println("encodedBytes " + new String(encodedBytes));
    

    To authenticate with Aritic PinPoint you must have a valid Aritic PinPoint authorization key.To generate authorization key you need to have an Aritic PinPoint account, in case you don't have an account, please use the following link for Registration .

    Once you have an account with Aritic PinPoint, you can use various code snippets on the right panel to create your authorization key and please follow the steps provided in this video tutorial.

    Aritic PinPoint expects for the authorization key to be included in all API requests to the server in a header that looks like the following:

    "'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'"

    Contacts

    You can make these API calls to get,edit or obtain any details on Aritic PinPoint's contacts.

    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts/87782');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    

    Get Contact by ID

    curl -X GET \
      https://xxxxxxxx-ma.aritic.com/api/contacts/87782 \
      -H 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      -H 'cache-control: no-cache' 
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/87782")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts/87782")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/contacts/87782", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts/87782",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
    
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "total": "1",
        "contacts": {
            "193208": {
                "isPublished": true,
                "dateAdded": "2017-11-14T17:21:47+05:30",
                "dateModified": "2017-11-14T17:33:51+05:30",
                "createdBy": 4,
                "createdByUser": "Arul raj",
                "modifiedBy": 4,
                "modifiedByUser": "Arul raj",
                "id": 193208,
                "points": 0,
                "color": null,
                "fields": {
                    "core": {
                        "points": {
                            "id": "47",
                            "label": "Points",
                            "alias": "points",
                            "type": "number",
                            "group": "core",
                            "object": "lead",
                            "is_fixed": "1",
                            "value": "0"
                        },
                        "firstname": {
                            "id": "2",
                            "label": "First Name",
                            "alias": "firstname",
                            "type": "text",
                            "group": "core",
                            "object": "lead",
                            "is_fixed": "1",
                            "value": "Richa"
                        },
                        "lastname": {
                            "id": "3",
                            "label": "Last Name",
                            "alias": "lastname",
                            "type": "text",
                            "group": "core",
                            "object": "lead",
                            "is_fixed": "1",
                            "value": "Kumari"
                        },
                        "...": {
                            "...": "...",
                        },
                        {
                            ....
                        }
            }
        }
    }
    
    

    Get an individual contact by ID.

    HTTP Request

    GET /contacts/ID

    Response

    Expected Response Code: 200

    See JSON code example.

    ** Contact Properties **

    Name Type Description
    id int ID of the contact
    dateAdded datetime Date/time contact was created
    createdBy int ID of the user that created the contact
    createdByUser string Name of the user that created the contact
    dateModified datetime/null Date/time contact was last modified
    modifiedBy int ID of the user that last modified the contact
    modifiedByUser string Name of the user that last modified the contact
    owner object User object that owns the contact.
    points int Contact's current number of points
    lastActive datetime/null Date/time for when the contact was last recorded as active
    dateIdentified datetime/null Date/time when the contact identified themselves
    color string Hex value given to contact from Point Trigger definitions based on the number of points the contact has been awarded
    ipAddresses array Array of IPs currently associated with this contact
    fields array Array of all contact fields with data grouped by field group. See JSON code example for format. This array includes an "all" key that includes an single level array of fieldAlias => contactValue pairs.

    Search Contacts

    curl --request GET \
      --url 'https://xxxxxxxx-ma.aritic.com/api/contacts?search=email%3Aricha%40abc.com' \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'search' => 'email:richa@abc.com'
    ));
    
    $request->setHeaders(array(
    
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts?search=email%3Aricha%40abc.com")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
    
      .build();
    
    Response response = client.newCall(request).execute();
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/contacts?search=email%3Aricha%40abc.com", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts?search=email%3Aricha%40abc.com",
      "method": "GET",
      "headers": {
        eauthorizatiot GET \
      --url https://xxxxxxxx-ma.aritic.com/api/segments \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' ": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts?search=email%3Aricha%40abc.com")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    {
        "total": "1",
        "contacts": {
            "193208": {
                "isPublished": true,
                "dateAdded": "2017-11-14T17:21:47+05:30",
                "dateModified": "2017-11-14T17:33:51+05:30",
                "createdBy": 4,
                "createdByUser": "Arul raj",
                "modifiedBy": 4,
                "modifiedByUser": "Arul raj",
                "id": 193208,
                "points": 0,
                "color": null,
                "fields": {
                    "core": {
                        "points": {
                            "id": "47",
                            "label": "Points",
                            "alias": "points",
                            "type": "number",
                            "group": "core",
                            "object": "lead",
                            "is_fixed": "1",
                            "value": "0"
                        },
                        "firstname": {
                            "id": "2",
                            "label": "First Name",
                            "alias": "firstname",
                            "type": "text",
                            "group": "core",
                            "object": "lead",
                            "is_fixed": "1",
                            "value": "Richa"
                        },
                       "lastname": {
                            "id": "3",
                            "label": "Last Name",
                            "alias": "lastname",
                            "type": "text",
                            "group": "core",
                            "object": "lead",
                            "is_fixed": "1",
                            "value": "Kumari"
                        },
                        "...": {
                            "...": "...",
                        },
                        {
                            ....
                        }
            }
        }
    }
    
    

    Search contact using any contact attribute.

    HTTP Request

    GET /contacts?search=attributeName:attributeValue

    Response

    Expected Response Code: 200

    See JSON code example.

    ** Contact Properties **

    Name Type Description
    id int ID of the contact
    dateAdded datetime Date/time contact was created
    createdBy int ID of the user that created the contact
    createdByUser string Name of the user that created the contact
    dateModified datetime/null Date/time contact was last modified
    modifiedBy int ID of the user that last modified the contact
    modifiedByUser string Name of the user that last modified the contact
    owner object User object that owns the contact.
    points int Contact's current number of points
    lastActive datetime/null Date/time for when the contact was last recorded as active
    dateIdentified datetime/null Date/time when the contact identified themselves
    color string Hex value given to contact from Point Trigger definitions based on the number of points the contact has been awarded
    ipAddresses array Array of IPs currently associated with this contact
    fields array Array of all contact fields with data grouped by field group. See JSON code example for format. This array includes an "all" key that includes an single level array of fieldAlias => contactValue pairs.

    List Contacts

    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/contacts \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
    
        }
    
    conn.request("GET", "/api/contacts", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "total": "187144",
        "contacts": {
            "897": {
                "isPublished": true,
            "id": 897,
                "fields": {
                    "core": {
                        "points": {
                            "id": "47",
                            "label": "Points"
                        },
                        "firstname": {
                            "id": "2",
                            "label": "First Name",
                            "value": "Jason"
                        },
                        "lastname": {
                            "id": "3",
                            "label": "Last Name",
                            "value": "Lamuda"
                        },
                        "...": {
                                 "..." : "..."
                                }
                    },
                "ipAddresses": [
                    {
                        "ip": "70.127.91.131",
                        "ipDetails": {
                            "city": "Bradenton",
                            "region": "Florida",
                            "timezone": "America/New_York",
                        }
                    },
                     "...": {
                                 "..." : "..."
                                }
    

    Get a list of contacts.

    HTTP Request

    GET /contacts

    ** Query Parameters **

    Name Description
    search Used to list contacts based on any particular attribute such as firstname,lastname,email,etc. Example:- GET /contacts?search=firstname:richa
    start Used to list contacts from the specified row.Default value is 0.Example:- GET /contacts?start=1567
    limit It limits the number of contacts to be returned to the specified limit.Defaults to the system configuration for pagination (30). Example:- GET /contacts?limit=10
    orderBy Specify any attribute value to sort the returned list. Example:- GET /contacts?orderBy=lastname
    orderByDir Specify the sort direction: asc or desc. Example:- GET /contacts?orderByDir=asc
    publishedOnly Returns only currently published entities. Example:- GET /contacts?publishedOnly

    Response

    Expected Response Code: 200

    See JSON code example.

    ** Properties **

    Same as Get Contact.

    Create Contact

    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts/new');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert',
      'content-type' => 'application/x-www-form-urlencoded'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'firstname' => 'Richa',
      'lastname' => 'Kumari',
      'email' => 'richa@abc.com'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/contacts/new \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWx' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded' \
      --data 'firstname=Richa&lastname=Kumari&email=richa%40abc.com'
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "firstname=Richa&lastname=Kumari&email=richa%40abc.com");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/new")
      .post(body)
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxAMTIz")
      .addHeader("cache-control", "no-cache")
      .addHeader("postman-token", "6fa8fefe-e16e-49a5-973cOkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "firstname=Richa&lastname=Kumari&email=richa%40abc.com");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/new")
      .post(body)
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();-979e5d5d7497")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts/new")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    request.body = "firstname=Richa&lastname=Kumari&email=richa%40abc.com"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "firstname=Richa&lastname=Kumari&email=richa%40abc.com"
    
    headers = {
        'content-type': "application/x-www-form-urlencoded",
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/contacts/new", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts/new",
      "method": "POST",
      "headers": {
        "content-type": "application/x-www-form-urlencoded",
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
      },
      "data": {
        "firstname": "Richa",
        "lastname": "Kumari",
        "email": "richa@abc.com"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "contact": {
            "isPublished": true,
            "id": 193208,
            "fields": {
                "core": {
                    "firstname": {
                        "id": "2",
                        "label": "First Name",
                        "type": "text",
                        "value": "Richa"
                    },
                    "lastname": {
                        "id": "3",
                        "label": "Last Name",
                        "type": "text",
                        "value": "Kumari"
                    },
                    "email": {
                        "id": "6",
                        "label": "Email",
                        "value": "richa@abc.com"
                    },
                },
                "all": {
                    "id": 193208,
                    "firstname": "Richa",
                    "lastname": "Kumari",
                    "email": "richa@abc.com",
                }
            },
        }
    }
    

    Create a new contact.

    HTTP Request

    POST /contacts/new

    ** Post Parameters **

    Name Description
    * Any contact field alias can be posted as a parameter. For example, firstname, lastname, email, etc.
    ipAddress IP address to associate with the contact
    lastActive Date/time in UTC; preferablly in the format of Y-m-d H:m:i but if that format fails, the string will be sent through PHP's strtotime then formatted
    owner ID of a Aritic PinPoint user to assign this contact to

    Response

    Expected Response Code: 201

    ** Properties **

    Same as Get Contact.

    Edit Contact

    curl --request PUT \
      --url https://xxxxxxxx-ma.aritic.com/api/contacts/193210/edit \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded' \
    
      --data 'mobile=9999999999&city=Bangalore&firstname=Neha&lastname=Kumari&email=neha%40abc.com'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts/193210/edit');
    $request->setMethod(HTTP_METH_PUT);
    
    $request->setHeaders(array(
    
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'mobile' => '9999999999',
      'city' => 'Bangalore',
      'firstname' => 'Neha',
      'lastname' => 'Kumari',
      'email' => 'neha@abc.com'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "mobile=9999999999&city=Bangalore&firstname=Neha&lastname=Kumari&email=neha%40abc.com");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/193210/edit")
      .put(body)
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
    
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts/193210/edit")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    
    request.body = "mobile=9999999999&city=Bangalore&firstname=Neha&lastname=Kumari&email=neha%40abc.com"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "mobile=9999999999&city=Bangalore&firstname=Neha&lastname=Kumari&email=neha%40abc.com"
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
    
        }
    
    conn.request("PUT", "/api/contacts/193210/edit", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts/193210/edit",
      "method": "PUT",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
    
      },
      "data": {
        "mobile": "9999999999",
        "city": "Bangalore",
        "firstname": "Neha",
        "lastname": "Kumari",
        "email": "neha@abc.com"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "contact": {
            "isPublished": true,
            "dateAdded": "2017-11-14T17:32:45+05:30",
            "dateModified": "2017-11-17T18:52:52+05:30",
            "modifiedByUser": "Arul raj",
            "fields": {
    
                "all": {
                    "id": 193210,
                    "firstname": "Neha",
                    "lastname": "Kumari",
                    "email": "neha@abc.com",
                    "phone": "",
                    "mobile": "9999999999",
                    "city": "Bangalore",
                    "attribution": 0,
                    "attribution_date": "",
                    "preferred_locale": "",
                    "timezone_offset": null,
                    "timezone": null,
                    "visible": 1,
                    "source": "",
                    "points": 0,
                    "product": "EasySendy Pro",
                    "source_for_crm_only": "App. Registration",
                }
            },
        }
    }
    

    Edit any contact. Note that this supports PUT or PATCH depending on the desired behavior.

    ** PUT ** creates a new contact if the given ID does not exist else adds the information provided. PATCH fails if the contact with the given ID does not exist else updates the contact field values as per the information provided.

    HTTP Request

    To edit a contact and return a 404 if the contact is not found:

    PATCH /contacts/ID/edit

    To edit a contact and create a new one if the contact is not found:

    PUT /contacts/ID/edit

    ** Post Parameters **

    Name Description
    * Any contact field alias can be posted as a parameter. For example, firstname, lastname, email, etc.
    ipAddress IP address to associate with the contact
    lastActive Date/time in UTC; preferably in the format of Y-m-d H:m:i but if that format fails, the string will be sent through PHP's strtotime then formatted
    owner ID of a Aritic PinPoint user to assign this contact to

    Response

    If PUT, the expected response code is 200 if the contact was edited or 201 if created.

    If PATCH, the expected response code is 200.

    ** Properties **

    Same as Get Contact.

    Delete Contact using ID

    curl --request DELETE \
      --url https://xxxxxxxx-ma.aritic.com/api/contacts/193208/delete \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts/193208/delete');
    $request->setMethod(HTTP_METH_DELETE);
    
    $request->setHeaders(array(
    
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/193208/delete")
      .delete(null)
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
    
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts/193208/delete")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
    
        }
    
    conn.request("DELETE", "/api/contacts/193208/delete", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts/193208/delete",
      "method": "DELETE",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
    
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "contact": {
            "dateModified": "2017-11-17T16:38:34+05:30",
            "modifiedByUser": "Arul raj",
            "id": null,
            "fields": {
                "core": {
                    "firstname": {
                        "label": "First Name",
                        "value": "Richa"
                    },
        }
    }
    

    Delete a contact using it's ID.After we delete the contact the ID of contact is changed to NULL.

    HTTP Request

    DELETE /contacts/ID/delete

    Response

    Expected Response Code: 200

    ** Properties **

    Same as Get Contact.

    List Available Owners

    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts/list/owners');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
    
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/contacts/list/owners \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/list/owners")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
    
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts/list/owners")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
    
        }
    
    conn.request("GET", "/api/contacts/list/owners", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts/list/owners",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwe1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
    
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    [
        {
            "id": 1,
            "firstName": "Ankit",
            "lastName": "Prakash"
        },
        {
            "id": 4,
            "firstName": "Arul",
            "lastName": "raj"
        }
         ...
    ]
    

    Get a list of owners that can be used to assign contacts to when creating/editing.

    HTTP Request

    GET /contacts/list/owners

    Response

    Expected Response Code: 200

    ** Owner Properties **

    Name Type Description
    id int ID of the Aritic PinPoint user
    firstName string First name of the Aritic PinPoint user
    lastName string Last name of the Aritic PinPoint user

    List Available Fields

    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts/list/fields');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
    
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/contacts/list/fields \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/list/fields")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
    
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts/list/fields")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic wertyEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
    
        }
    
    conn.request("GET", "/api/contacts/list/fields", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts/list/fields",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
    
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "2": {
            "id": 2,
            "label": "First Name",
            "alias": "firstname",
            "type": "text",
            "group": "core",
            "order": 7,
            "object": "lead"
        },
        "3": {
            "id": 3,
            "label": "Last Name",
            "alias": "lastname",
            "type": "text",
            "group": "core",
            "order": 9,
            "object": "lead"
        },
        "4": {
            "id": 4,
            "label": "Company",
            "alias": "company",
            "type": "text",
            "group": "core",
            "order": 10,
            "object": "lead"
        },
        "...": {
            "..." : "..."
        }
    }
    

    Get a list of available contact fields including custom ones.

    HTTP Request

    GET /contacts/list/fields

    Response

    Expected Response Code: 200

    ** Field Properties **

    Name Type Description
    id int ID of the field
    label string Field label
    alias string Field alias used as the column name in the database
    type string Type of field. I.e. text, lookup, etc
    group string Group the field belongs to
    order int Field order

    Get Contact's Devices

    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/contacts/193210/devices');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
    
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/contacts/193210/devices \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/contacts/193210/devices")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
    
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/contacts/193210/devices")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert
    request["cache-control"] = 'no-cache'
    
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
    
        }
    
    conn.request("GET", "/api/contacts/193210/devices", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/contacts/193210/devices",
      "method": "GET",
      "headers": {
        "authorization": "Basic EBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
    
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "total": 1,
        "devices": [
            {
                "id": 175423,
                "lead": {},
                "clientInfo": {
                    "type": "browser",
                    "name": "Mobile Safari",
                    "short_name": "MF",
                    "version": "11.0",
                    "engine": "WebKit",
                    "engine_version": "604.3.5"
                },
                "device": "smartphone",
                "deviceBrand": "AP",
                "deviceModel": "iPhone",
                "deviceOsName": "iOS",
                "deviceOsShortName": "IOS",
                "deviceOsVersion": "11.1",
                "deviceOsPlatform": ""
            }
        ]
    }
    

    Get a list of contact's devices the contact has used.

    HTTP Request

    GET /contacts/ID/devices

    Response

    Expected response code: 200

    List Properties

    Name Type Description
    id int Device ID
    clientInfo array Array with various information about the client (browser)
    device string Device type; desktop, mobile..
    deviceOsName string Full device OS name
    deviceOsShortName string Short device OS name
    deviceOsPlatform string OS platform

    Companies

    Use this endpoint to obtain details on Aritic PinPoint's companies or to manipulate contact-company memberships.

    Get Company by ID

    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/companies/658 \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/companies/658');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/companies/658")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/companies/658")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/companies/658", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/companies/658",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "company": {
            "id": 658,
            "score": 0,
            "fields": {
                "core": {
                    "companyname": {
                        "id": "29",
                        "label": "Company Name",
                          ..  
                           },
                    "companyaddress1": {
                        "id": "31",
                        "label": "Company Address 1",
                        ...
                        },
                    "companyaddress2": {
                        "id": "32",
                        "label": "Company Address 2",
                        ...
                        },
                    "companyemail": {...},
                    "companyphone": {...},
                    "companycity": {...},
                    "companystate": {...},
                    "companyzipcode": {...},
                    "companycountry": {...},
    
            }
        }
    }
    

    Get an individual company by ID.

    HTTP Request

    GET /companies/ID

    Response

    Expected Response Code: 200

    See JSON code example.

    Company Properties

    Name Type Description
    id int ID of the company
    isPublished boolean Whether the company is published
    dateAdded datetime Date/time company was created
    createdBy int ID of the user that created the company
    createdByUser string Name of the user that created the company
    dateModified datetime/null Date/time company was last modified
    modifiedBy int ID of the user that last modified the company
    modifiedByUser string Name of the user that last modified the company
    fields array Custom fields for the company

    List Contact Companies

    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/companies \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxAqwert' \
      --header 'cache-control: no-cache' 
    
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/companies');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/companies")
      .get()
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/companies")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/companies", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/companies",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "total": "1835",
        "companies": {
            "1": {
                "id": 1,
                "score": 0,
                "fields": {
                    "core": {
                        "companyname": {
                            "id": "29",
                            "label": "Company Name",
                        },    
                }
            },
            "2": {
                "id": 2,
                "score": 0,
                "fields": {
                    "core": {
                        "companyname": {
                            "id": "29",
                            "label": "Company Name",
                       }
                }
                  }
            }
    }
    

    Returns a list of contact companies available to the user. This list is not filterable.

    HTTP Request

    GET /companies

    Response

    Expected Response Code: 200

    See JSON code example.

    Company Properties

    Name Type Description
    id int ID of the company
    isPublished boolean Whether the company is published
    dateAdded datetime Date/time company was created
    createdBy int ID of the user that created the company
    createdByUser string Name of the user that created the company
    dateModified datetime/null Date/time company was last modified
    modifiedBy int ID of the user that last modified the company
    modifiedByUser string Name of the user that last modified the company
    fields array Custom fields for the company

    Create Company

    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/companies/new \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded' \
      --data companyname=Mars
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/companies/new');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxAqwert'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'companyname' => 'Mars'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "companyname=Mars");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/companies/new")
      .post(body)
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/companies/new")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    request.body = "companyname=Mars"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "companyname=Mars"
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/companies/new", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/companies/new",
      "method": "POST",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
      },
      "data": {
        "companyname": "Mars"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "company": {
            "id": 1838,
            "score": 0,
            "fields": {
                "core": {
                    "companywebsite": {
                        "id": 42,
                        "label": "Company Website",
                    },
                    "companycountry": {
                        "id": 38,
                        "label": "Company Country",
                    },
             "companyname": {
                        "id": 29,
                        "group": "core",
                        "label": "Company Name",
                        "type": "text",
                        "value": "Mars"
                    }
                      }
                }
        }
    }
    

    Create a new company.

    HTTP Request

    POST /companies/new

    Post Parameters

    Name Description
    companyname Company name is the only required field. Other company fields can be sent with a value
    isPublished A value of 0 or 1

    Response

    Expected Response Code: 201

    Properties

    Same as Get Company.

    Edit Company

    curl --request PUT \
      --url https://xxxxxxxx-ma.aritic.com/api/companies/1838/edit \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded' \
      --data companyname=Marsian
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/companies/1838/edit');
    $request->setMethod(HTTP_METH_PUT);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'companyname' => 'Marsian'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "companyname=Marsian");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/companies/1838/edit")
      .put(body)
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxAqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/companies/1838/edit")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    request.body = "companyname=Marsian"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "companyname=Marsian"
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
        }
    
    conn.request("PUT", "/api/companies/1838/edit", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/companies/1838/edit",
      "method": "PUT",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
      },
      "data": {
        "companyname": "Marsian"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "company": {
            "id": 1838,
            "score": 0,
            "fields": {
                "core": {
                    "companyname": {
                        "id": "29",
                        "label": "Company Name",
                        "alias": "companyname",
                        "type": "text",
                        "group": "core",
                        "object": "company",
                        "is_fixed": "1",
                        "value": "Marsian"
                      },
                }
                  }
                }
    }
    

    Edit a new company. Note that this supports PUT or PATCH depending on the desired behavior.

    PUT creates a company if the given ID does not exist and clears all the company information, adds the information from the request. PATCH fails if the company with the given ID does not exist and updates the company field values with the values form the request.

    HTTP Request

    To edit a company and return a 404 if the company is not found:

    PATCH /companies/ID/edit

    To edit a company and create a new one if the company is not found:

    PUT /companies/ID/edit

    Post Parameters

    Name Description
    companyname Company name is the only required field. Other company fields can be sent with a value
    isPublished A value of 0 or 1

    Response

    If PUT, the expected response code is 200 if the company was edited or 201 if created.

    If PATCH, the expected response code is 200.

    Properties

    Same as Get Company.

    Delete Company

    curl --request DELETE \
      --url https://xxxxxxxx-ma.aritic.com/api/companies/1838/delete \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/companies/1838/delete');
    $request->setMethod(HTTP_METH_DELETE);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxAMqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/companies/1838/delete")
      .delete(null)
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/companies/1838/delete")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
        }
    
    conn.request("DELETE", "/api/companies/1838/delete", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/companies/1838/delete",
      "method": "DELETE",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "company": {
            "id": null,
            "score": 0,
            "fields": {
                "core": {
                    "companyname": {
                        "id": "29",
                        "label": "Company Name",
                        "alias": "companyname",
                        "type": "text",
                        "group": "core",
                        "object": "company",
                        "is_fixed": "1",
                        "value": "Marsian"
                      },
                    }
                  }
                }
    }
    
    
    ********************  
    

    Delete a company.

    HTTP Request

    DELETE /companies/ID/delete

    Response

    Expected Response Code: 200

    Properties

    Same as Get Company.

    Add Contact to a Company

    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/add \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/add');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/add")
      .post(null)
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/add")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxAqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/companies/1837/contact/195373/add", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/add",
      "method": "POST",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "success": 1
    }
    

    Manually add a contact to a specific company.

    HTTP Request

    POST /companies/COMPANY_ID/contact/CONTACT_ID/add

    Response

    Expected Response Code: 200

    See JSON code example.

    Remove Contact from a Company

    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/remove \
      --header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/remove');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/remove")
      .post(null)
      .addHeader("authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxAqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/remove")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/companies/1837/contact/195373/remove", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/companies/1837/contact/195373/remove",
      "method": "POST",
      "headers": {
        "authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "success": 1
    }
    

    Manually remove a contact to a specific company.

    HTTP Request

    POST /companies/COMPANY_ID/contact/CONTACT_ID/remove

    Response

    Expected Response Code: 200

    See JSON code example.

    Fields

    Use this endpoint to work with Aritic PinPoint's contact/company fields.

    Get Field

    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/fields/contact/2 \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/fields/contact/2');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/fields/contact/2")
      .get()
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/fields/contact/2")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/fields/contact/2", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/fields/contact/2",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "field": {
            "isPublished": true,
            "dateAdded": null,
            "dateModified": "2016-08-26T18:44:30+05:30",
            "createdBy": null,
            "createdByUser": null,
            "modifiedBy": 1,
            "modifiedByUser": "Ankit Prakash",
            "id": 2,
            "label": "First Name",
            "alias": "firstname",
            "type": "text",
            "group": "core",
            "order": 7,
            "object": "lead",
            "defaultValue": null,
            "isRequired": false,
            "isPubliclyUpdatable": true,
            "isUniqueIdentifier": false,
            "properties": []
        }
    }
    

    Get an individual field by ID.

    HTTP Request

    GET /fields/contact/ID or GET /fields/company/ID

    Response

    Expected Response Code: 200

    See JSON code example.

    Field Properties

    Name Type Description
    id int ID of the field
    isPublished bool Published state
    publishUp datetime/null Date/time when the field should be published
    publishDown datetime/null Date/time the field should be un published
    dateAdded datetime Date/time field was created
    createdBy int ID of the user that created the field
    createdByUser string Name of the user that created the field
    dateModified datetime/null Date/time field was last modified
    modifiedBy int ID of the user that last modified the field
    modifiedByUser string Name of the user that last modified the field
    label string Name of the field
    alias string Unique alias of the field used in the form field name attributes
    description string/null Description of the field
    type string Field type
    group string Groupd of the fields where the field belongs
    order int Order number of the field
    object string Which object use the field. Contact (lead) or Company.
    defaultValue string Default value of the field.
    isRequired boolean True if the field is required.
    isPubliclyUpdatable boolean True if the field value can be changed from public requests. The tracking pixel query for example.
    isUniqueIdentifier boolean True if the field is unique identifier and so the contacts should merge if the value of this field is the same.
    properties array Field options if the field type needs some.

    List Contact Fields

    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/fields/contact \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert' \
      --header 'cache-control: no-cache'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/fields/contact');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/fields/contact")
      .get()
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/fields/contact")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/fields/contact", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/fields/contact",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "total": 33,
        "fields": {
            "1": {
                "isPublished": false,
                "dateAdded": null,
                "dateModified": "2016-08-10T12:32:40+05:30",
                "createdBy": null,
                "createdByUser": null,
                "modifiedBy": 1,
                "modifiedByUser": "Ankit Prakash",
                "id": 1,
                "label": "Title",
                "alias": "title",
                "type": "lookup",
                "group": "core",
                "order": 4,
                "object": "lead",
                "defaultValue": null,
                "isRequired": false,
                "isPubliclyUpdatable": false,
                "isUniqueIdentifier": false,
                "properties": {
                    "list": "|Mr|Mrs|Miss"
                }
            },
            "2": {
                "isPublished": true,
                "dateAdded": null,
                "dateModified": "2016-08-26T18:44:30+05:30",
                ...
        }
    }
    

    Query Parameters

    Name Description
    search String or search command to filter entities by.
    start Starting row for the entities returned. Defaults to 0.
    limit Limit number of entities to return. Defaults to the system configuration for pagination (30).
    orderBy Column to sort by. Can use any column listed in the response.
    orderByDir Sort direction: asc or desc.
    publishedOnly Only return currently published entities.
    minimal Return only array of entities without additional lists in it.

    HTTP Request

    GET /fields/contact or GET /fields/company

    Response

    Expected Response Code: 200

    See JSON code example.

    Field Properties

    Name Type Description
    id int ID of the field
    isPublished bool Published state
    publishUp datetime/null Date/time when the field should be published
    publishDown datetime/null Date/time the field should be un published
    dateAdded datetime Date/time field was created
    createdBy int ID of the user that created the field
    createdByUser string Name of the user that created the field
    dateModified datetime/null Date/time field was last modified
    modifiedBy int ID of the user that last modified the field
    modifiedByUser string Name of the user that last modified the field
    label string Name of the field
    alias string Unique alias of the field used in the form field name attributes
    description string/null Description of the field
    type string Field type
    group string Groupd of the fields where the field belongs
    order int Order number of the field
    object string Which object use the field. Contact (lead) or Company.
    defaultValue string Default value of the field.
    isRequired boolean True if the field is required.
    isPubliclyUpdatable boolean True if the field value can be changed from public requests. The tracking pixel query for example.
    isUniqueIdentifier boolean True if the field is unique identifier and so the contacts should merge if the value of this field is the same.
    properties array Field options if the field type needs some.

    Create Field

    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/fields/contact/new \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded'\
      --data label=middle_name
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/fields/contact/new');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'label' => 'middle_name'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "label=middle_name");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/fields/contact/new")
      .post(body)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/fields/contact/new")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    request.body = "label=middle_name"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "label=middle_name"
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/fields/contact/new", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/fields/contact/new",
      "method": "POST",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
      },
      "data": {
        "label": "middle_name"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "field": {
            "isPublished": true,
            "dateAdded": "2017-11-22T15:54:36+05:30",
            "dateModified": null,
            "createdBy": 8,
            "createdByUser": "Richa Kumari",
            "modifiedBy": null,
            "modifiedByUser": null,
            "id": 50,
            "label": "middle_name",
            "alias": "middle_name",
            "type": "text",
            "group": "core",
            "order": 4,
            "object": "lead",
            "defaultValue": null,
            "isRequired": false,
            "isPubliclyUpdatable": false,
            "isUniqueIdentifier": false,
            "properties": []
        }
    }
    

    Create a new field.

    HTTP Request

    POST /fields/contact/new or POST /fields/company/new

    Post Parameters

    Name Description
    label string
    alias string
    description string/null
    type string
    group string
    order int
    object string
    defaultValue string
    isRequired boolean
    isPubliclyUpdatable boolean
    isUniqueIdentifier boolean
    properties array

    Response

    Expected Response Code: 201

    Properties

    Same as Get Field.

    Edit Field

    curl --request PUT \
      --url https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/edit \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded'\ 
      --data label=mid_name
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/edit');
    $request->setMethod(HTTP_METH_PUT);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'label' => 'mid_name'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "label=mid_name");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/edit")
      .put(body)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/edit")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    request.body = "label=mid_name"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "label=mid_name"
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
        }
    
    conn.request("PUT", "/api/fields/contact/50/edit", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/edit",
      "method": "PUT",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
      },
      "data": {
        "label": "mid_name"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "field": {
            "isPublished": null,
            "dateAdded": "2017-11-22T15:54:36+05:30",
            "dateModified": "2017-11-22T16:03:43+05:30",
            "createdBy": 8,
            "createdByUser": "Richa Kumari",
            "modifiedBy": 8,
            "modifiedByUser": "Richa Kumari",
            "id": 50,
            "label": "mid_name",
            "alias": "middle_name",
            "type": "text",
            "group": null,
            "order": 0,
            "object": "lead",
            "defaultValue": null,
            "isRequired": null,
            "isPubliclyUpdatable": false,
            "isUniqueIdentifier": null,
            "properties": []
        }
    }
    

    Edit a new field. Field that this supports PUT or PATCH depending on the desired behavior.

    PUT creates a field if the given ID does not exist and clears all the field infieldation, adds the infieldation from the request. PATCH fails if the field with the given ID does not exist and updates the field field values with the values field the request.

    HTTP Request

    To edit a field and return a 404 if the field is not found:

    PATCH /fields/contact/ID/edit or PATCH /fields/company/ID/edit

    To edit a field and create a new one if the field is not found:

    PUT /fields/contact/ID/edit or PUT /fields/company/ID/edit

    Post Parameters

    Name Description
    label string
    alias string
    description string/null
    type string
    group string
    order int
    object string
    defaultValue string
    isRequired boolean
    isPubliclyUpdatable boolean
    isUniqueIdentifier boolean
    properties array

    Response

    If PUT, the expected response code is 200 if the field was edited or 201 if created.

    If PATCH, the expected response code is 200.

    Properties

    Same as Get Field.

    Delete Field

    curl --request DELETE \
      --url https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/delete \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/delete');
    $request->setMethod(HTTP_METH_DELETE);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/delete")
      .delete(null)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/delete")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("DELETE", "/api/fields/contact/50/delete", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/fields/contact/50/delete",
      "method": "DELETE",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "field": {
            "isPublished": false,
            "dateAdded": "2017-11-22T15:54:36+05:30",
            "dateModified": "2017-11-22T16:03:43+05:30",
            "createdBy": 8,
            "createdByUser": "Richa Kumari",
            "modifiedBy": 8,
            "modifiedByUser": "Richa Kumari",
            "id": null,
            "label": "mid_name",
            "alias": "middle_name",
            "type": "text",
            "group": null,
            "order": 0,
            "object": "lead",
            "defaultValue": null,
            "isRequired": false,
            "isPubliclyUpdatable": false,
            "isUniqueIdentifier": null,
            "properties": []
        }
    }
    

    Delete a field.

    HTTP Request

    DELETE /fields/contact/ID/delete or DELETE /fields/company/ID/delete

    Response

    Expected Response Code: 200

    Properties

    Same as Get Field.

    Segments

    Use this endpoint to obtain details on Aritic PinPoint's contact segments or to manipulate contact memberships.

    Get Segment

    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/segments/32 \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert' \
      --header 'cache-control: no-cache'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/segments/32');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/segments/32")
      .get()
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/segments/32")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/segments/32", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/segments/32",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "list": {
            "isPublished": true,
            "dateAdded": "2017-10-04T13:26:25+05:30",
            "dateModified": "2017-10-04T21:18:06+05:30",
            "createdBy": 4,
            "createdByUser": "Arul raj",
            "modifiedBy": 2,
            "modifiedByUser": "Bishal Gupta",
            "id": 32,
            "name": "Active in last 1 day",
            "alias": "active-in-last-1-day",
            "description": null,
            "filters": [
                         ...
            ],
            "isGlobal": true
        }
    }
    

    Get an individual segment by ID.

    HTTP Request

    GET /segments/ID

    Response

    Expected Response Code: 200

    See JSON code example.

    Segment Properties

    Name Type Description
    id int ID of the segment
    isPublished boolean Whether the segment is published
    dateAdded datetime Date/time segment was created
    createdBy int ID of the user that created the segment
    createdByUser string Name of the user that created the segment
    dateModified datetime/null Date/time segment was last modified
    modifiedBy int ID of the user that last modified the segment
    modifiedByUser string Name of the user that last modified the segment
    name string Segment name
    alias string Segment alias
    description string Segment description
    filters array Smart filters for the segment. See filter properties bellow
    isGlobal boolean Whether the segment is global. 0 means only the author will see it.

    Segment Filter Properties

    Name Type Description
    glue string How to glue the filters to others. Possible values: and, or
    field string Alias of the contact or company field to based the filter on
    object string Object which have the field. Possible values: 'lead' (for contacts), company
    type string Type of the field. Possible values: 'boolean', date (format Y-m-d), datetime (format Y-m-d H:i:s), email, country, locale, lookup, number, tel, region, select, multiselect, text, textarea, time, timezone, url
    operator string Operator used for matching the values. Possible values: '=', !=, empty, !empty, like, !like, regexp, !regexp, startsWith, endsWith, contains

    List Contact Segments

    curl --request GET \
      --url https://xxxxxxxx-ma.aritic.com/api/segments \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/segments');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/segments")
      .get()
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/segments")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("GET", "/api/segments", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/segments",
      "method": "GET",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "total": 22,
        "lists": {
            "8": {
                "isPublished": false,
                "dateAdded": "2016-08-24T16:30:57+05:30",
                "dateModified": "2017-08-22T12:23:29+05:30",
                "createdBy": 1,
                "createdByUser": "Ankit Prakash",
                "modifiedBy": 1,
                "modifiedByUser": "Ankit Prakash",
                "id": 8,
                "name": "Test Email list",
                "alias": "test-email-list",
                "description": null,
                "filters": [
                    {
                        "glue": "and",
                        "field": "firstname",
                        "type": "text",
                        "filter": "Ankit",
                        "display": null,
                        "operator": "like"
                    }
                ],
                "isGlobal": true
            },
            "19": {...
          }
    }
    

    Returns a list of contact segments available to the user. This list is not filterable.

    HTTP Request

    GET /segments

    Response

    Expected Response Code: 200

    See JSON code example.

    Segment Properties

    Name Type Description
    total int Count of all segments
    id int ID of the segment
    isPublished boolean Whether the segment is published
    dateAdded datetime Date/time segment was created
    createdBy int ID of the user that created the segment
    createdByUser string Name of the user that created the segment
    dateModified datetime/null Date/time segment was last modified
    modifiedBy int ID of the user that last modified the segment
    modifiedByUser string Name of the user that last modified the segment
    name string Segment name
    alias string Segment alias
    description string Segment description
    filters array Smart filters for the segment. See filter properties bellow
    isGlobal boolean Whether the segment is global. 0 means only the author will see it.

    Segment Filter Properties

    Name Type Description
    glue string How to glue the filters to others. Possible values: and, or
    field string Alias of the contact or company field to based the filter on
    object string Object which have the field. Possible values: 'lead' (for contacts), company
    type string Type of the field. Possible values: 'boolean', date (format Y-m-d), datetime (format Y-m-d H:i:s), email, country, locale, lookup, number, tel, region, select, multiselect, text, textarea, time, timezone, url
    operator string Operator used for matching the values. Possible values: '=', !=, empty, !empty, like, !like, regexp, !regexp, startsWith, endsWith, contains

    Create Segment

    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/segments/new \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded'\ 
      --data name=test%20segment%202
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/segments/new');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'name' => 'test segment 2'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "name=test%20segment%202");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/segments/new")
      .post(body)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/segments/new")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    request.body = "name=test%20segment%202"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "name=test%20segment%202"
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/segments/new", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/segments/new",
      "method": "POST",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
      },
      "data": {
        "name": "test segment 2"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "list": {
            "isPublished": true,
            "dateAdded": "2017-11-22T17:11:12+05:30",
            "dateModified": null,
            "createdBy": 8,
            "createdByUser": "Richa Kumari",
            "modifiedBy": null,
            "modifiedByUser": null,
            "id": 43,
            "name": "test segment 2",
            "alias": "test-segment-2",
            "description": null,
            "filters": [],
            "isGlobal": true
        }
    }
    

    Create a new segment.

    HTTP Request

    POST /segments/new

    Post Parameters

    Name Description
    name Segment name is the only required field
    alias Name alias generated automatically if not set
    description A description of the segment.
    isPublished A value of 0 or 1
    isGlobal boolean
    filters array

    Segment Filter Properties

    Name Type Description
    glue string How to glue the filters to others. Possible values: and, or
    field string Alias of the contact or company field to based the filter on
    object string Object which have the field. Possible values: 'lead' (for contacts), company
    type string Type of the field. Possible values: 'boolean', date (format Y-m-d), datetime (format Y-m-d H:i:s), email, country, locale, lookup, number, tel, region, select, multiselect, text, textarea, time, timezone, url
    operator string Operator used for matching the values. Possible values: '=', !=, empty, !empty, like, !like, regexp, !regexp, startsWith, endsWith, contains

    Response

    Expected Response Code: 201

    Properties

    Same as Get Segment.

    Edit Segment

    curl --request PUT \
      --url https://xxxxxxxx-ma.aritic.com/api/segments/32/edit \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' \
      --header 'content-type: application/x-www-form-urlencoded' \ 
      --data name=test%20segment%20new
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/segments/32/edit');
    $request->setMethod(HTTP_METH_PUT);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'content-type' => 'application/x-www-form-urlencoded',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    $request->setContentType('application/x-www-form-urlencoded');
    $request->setPostFields(array(
      'name' => 'test segment new'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "name=test%20segment%20new");
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/segments/32/edit")
      .put(body)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("content-type", "application/x-www-form-urlencoded")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/segments/32/edit")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert'
    request["content-type"] = 'application/x-www-form-urlencoded'
    request["cache-control"] = 'no-cache'
    request.body = "name=test%20segment%20new"
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    payload = "name=test%20segment%20new"
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert",
        'content-type': "application/x-www-form-urlencoded",
        'cache-control': "no-cache"
        }
    
    conn.request("PUT", "/api/segments/32/edit", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/segments/32/edit",
      "method": "PUT",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "content-type": "application/x-www-form-urlencoded",
        "cache-control": "no-cache"
      },
      "data": {
        "name": "test segment new"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "list": {
            "isPublished": null,
            "dateAdded": "2017-10-04T13:26:25+05:30",
            "dateModified": "2017-11-22T17:09:13+05:30",
            "createdBy": 4,
            "createdByUser": "Arul raj",
            "modifiedBy": 8,
            "modifiedByUser": "Richa Kumari",
            "id": 32,
            "name": "test segment new",
            "alias": "test-segment-new",
            "description": null,
            "filters": [],
            "isGlobal": null
        }
    }
    

    Edit a new segment. Note that this supports PUT or PATCH depending on the desired behavior.

    PUT creates a segment if the given ID does not exist and clears all the segment information, adds the information from the request. PATCH fails if the segment with the given ID does not exist and updates the segment field values with the values form the request.

    HTTP Request

    To edit a segment and return a 404 if the segment is not found:

    PATCH /segments/ID/edit

    To edit a segment and create a new one if the segment is not found:

    PUT /segments/ID/edit

    Post Parameters

    Name Description
    name Segment name is the only required field
    alias Name alias generated automatically if not set
    description A description of the segment.
    isPublished A value of 0 or 1
    isGlobal boolean
    filters array

    Segment Filter Properties

    Name Type Description
    glue string How to glue the filters to others. Possible values: and, or
    field string Alias of the contact or company field to based the filter on
    object string Object which have the field. Possible values: 'lead' (for contacts), company
    type string Type of the field. Possible values: 'boolean', date (format Y-m-d), datetime (format Y-m-d H:i:s), email, country, locale, lookup, number, tel, region, select, multiselect, text, textarea, time, timezone, url
    operator string Operator used for matching the values. Possible values: '=', !=, empty, !empty, like, !like, regexp, !regexp, startsWith, endsWith, contains

    Response

    If PUT, the expected response code is 200 if the segment was edited or 201 if created.

    If PATCH, the expected response code is 200.

    Properties

    Same as Get Segment.

    Delete Segment

    curl --request DELETE \
      --url https://xxxxxxxx-ma.aritic.com/api/segments/42/delete \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert' \
      --header 'cache-control: no-cache'
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/segments/42/delete');
    $request->setMethod(HTTP_METH_DELETE);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/segments/42/delete")
      .delete(null)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/segments/42/delete")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("DELETE", "/api/segments/42/delete", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/segments/42/delete",
      "method": "DELETE",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "list": {
            "isPublished": true,
            "dateAdded": "2017-11-22T17:08:14+05:30",
            "dateModified": null,
            "createdBy": 8,
            "createdByUser": "Richa Kumari",
            "modifiedBy": null,
            "modifiedByUser": null,
            "id": null,
            "name": "test segment",
            "alias": "test-segment",
            "description": null,
            "filters": [],
            "isGlobal": true
        }
    }
    

    Delete a segment.

    HTTP Request

    DELETE /segments/ID/delete

    Response

    Expected Response Code: 200

    Properties

    Same as Get Segment.

    Add Contact to a Segment

    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/add \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/add');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/add")
      .post(null)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/add")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    request["cache-control"] = 'no-cache'
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/segments/43/contact/195373/add", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/add",
      "method": "POST",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "success": 1
    }
    

    Manually add a contact to a specific segment.

    HTTP Request

    POST /segments/SEGMENT_ID/contact/CONTACT_ID/add

    Response

    Expected Response Code: 200

    See JSON code example.

    Remove Contact from a Segment

    curl --request POST \
      --url https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/remove \
      --header 'authorization: Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert' \
      --header 'cache-control: no-cache' 
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/remove');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'cache-control' => 'no-cache',
      'authorization' => 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/remove")
      .post(null)
      .addHeader("authorization", "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert")
      .addHeader("cache-control", "no-cache")
      .build();
    
    Response response = client.newCall(request).execute();
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/remove")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["authorization"] = 'Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEyqwert'
    request["cache-control"] = 'no-cache'
    
    response = http.request(request)
    puts response.read_body
    
    import http.client
    
    conn = http.client.HTTPSConnection("xxxxxxxx-ma.aritic.com")
    
    headers = {
        'authorization': "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        'cache-control': "no-cache"
        }
    
    conn.request("POST", "/api/segments/43/contact/195373/remove", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    var settings = {
      "async": true,
      "crossDomain": true,
      "url": "https://xxxxxxxx-ma.aritic.com/api/segments/43/contact/195373/remove",
      "method": "POST",
      "headers": {
        "authorization": "Basic qwertGFAZGF0YWFlZ2lzLmNvbTpTSE9QU29jaWFsQDEqwert",
        "cache-control": "no-cache"
      }
    }
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    
    {
        "success": 1
    }
    

    Manually remove a contact to a specific segment.

    HTTP Request

    POST /segments/SEGMENT_ID/contact/CONTACT_ID/remove

    Response

    Expected Response Code: 200

    See JSON code example.

    Webhooks

    Webhook is a universal way how to send data about leads, pages, forms and events. The data is sent in real-time when an action occurs so the system which listens from Aritic PinPoint webhook data can process them without the need for a periodic scanning if Aritic PinPoint has some new data.

    Available Webhook Actions

    Aritic PinPoint can send webhook payload on the following actions:

    Contact Creation

    module.exports = {
      id: 14,
      dateAdded: '2017-06-13T09:15:47+00:00',
      dateIdentified: '2017-06-13T09:15:47+00:00',
      createdBy: 1,
      createdByUser: 'Alice',
      points: 0,
      title: 'Ms.',
      firstname: 'Alice',
      lastname: '',
      company: null,
      position: 'Q&#38;A',
      email: 'alice@test.com',
      mobile: '666555444',
      phone: null,
      fax: null,
      address1: 'Under the hill',
      address2: null,
      city: 'Prague',
      state: null,
      zipcode: '1600',
      country: 'Czech Republic',
      preferred_locale: 'cs_CZ',
      attribution_date: '',
      attribution: null,
      website: 'http://alice.com',
      facebook: 'alice',
      foursquare: null,
      googleplus: null,
      instagram: null,
      linkedin: null,
      skype: null,
      twitter: 'alice',
      ownedBy: 1,
      ownedByUsername: 'admin',
      ownedByUser: 'Alice',
      tags: ''
    };
    
    

    When any contact is created the webhook triggers the data to the specified Webhook URL. Check the example JSON Response on the right side panel.

    Contact Updation

    module.exports = {
      id: 12,
      dateAdded: '2017-06-09T11:46:53+00:00',
      dateModified: '2017-06-09T11:49:02+00:00',
      dateIdentified: '2017-06-09T11:46:53+00:00',
      createdBy: 1,
      createdByUser: 'Alice',
      modifiedBy: 1,
      modifiedByUser: 'Alice',
      points: 0,
      title: null,
      firstname: 'Alice',
      lastname: null,
      company: null,
      position: null,
      email: 'alice@test.email',
      mobile: null,
      phone: null,
      fax: null,
      address1: null,
      address2: null,
      city: null,
      state: null,
      zipcode: null,
      country: null,
      preferred_locale: null,
      attribution_date: '',
      attribution: null,
      website: null,
      facebook: null,
      foursquare: null,
      googleplus: null,
      instagram: null,
      linkedin: null,
      skype: null,
      twitter: null,
      ownedBy: 1,
      ownedByUsername: 'admin',
      ownedByUser: 'Alice',
      tags: ''
    };
    
    

    When any contact is updated the webhook triggers the data to the specified Webhook URL. Check the example JSON Response on the right side panel.

    Email Opened

    module.exports = {
      id: 38,
      emailAddress: 'doe@gmail.com',
      dateSent: '2017-06-19T12:36:13+00:00',
      dateRead: '2017-06-19T12:36:33+00:00',
      source: 'email',
      openCount: 1,
      lastOpened: '2017-06-19T12:36:33+00:00',
      sourceId: 9,
      viewedInBrowser: true,
      contact: {
        id: 4,
        points: 0,
        title: null,
        firstname: null,
        lastname: null,
        company: null,
        position: null,
        email: 'doe@gmail.com',
        mobile: null,
        phone: null,
        fax: null,
        address1: null,
        address2: null,
        city: null,
        state: null,
        zipcode: null,
        country: null,
        preferred_locale: null,
        attribution_date: null,
        attribution: null,
        website: null,
        multiselect: null,
        f_select: null,
        boolean: null,
        datetime: null,
        timezone1: null,
        facebook: null,
        foursquare: null,
        googleplus: null,
        instagram: null,
        linkedin: null,
        skype: null,
        twitter: null,
        ownedBy: null,
        ownedByUsername: null,
        ownedByUser: null,
        tags: ''
      },
      email: {
        id: 9,
        name: 'Webhook test',
        subject: 'Webhook test',
        language: 'en',
        fromAddress: null,
        fromName: null,
        replyToAddress: null,
        bccAddress: null,
        customHtml: '<!DOCTYPE html>\n<html>\n    <head>\n        <title>{subject}</title>\n        <style type="text/css" media="only screen and (max-width: 480px)">\n            /* Mobile styles */\n            @media only screen and (max-width: 480px) {\n\n                [class="w320"] {\n                    width: 320px !important;\n                }\n\n                [class="mobile-block"] {\n                    width: 100% !important;\n                    display: block !important;\n                }\n            }\n        </style>\n    </head>\n    <body style="margin:0">\n        <div data-section-wrapper="1">\n            <center>\n                <table data-section="1" style="width: 600;" width="600" cellpadding="0" cellspacing="0">\n                    <tbody>\n                        <tr>\n                            <td>\n                                <div data-slot-container="1" style="min-height: 30px">\n                                    <div data-slot="text">\n                                        <br />\n                                        <h2>Hello there!</h2>\n                                        <br />\n                                        We haven\'t heard from you for a while...\n                                        <br />\n                                        <br />\n                                        {unsubscribe_text} | {webview_text}\n                                        <br />\n                                    </div>\n                                </div>\n                            </td>\n                        </tr>\n                    </tbody>\n                </table>\n            </center>\n        </div>\n    </body>\n</html>',
        plainText: null,
        template: 'blank',
        emailType: 'list',
        publishUp: null,
        publishDown: null,
        readCount: 0,
        sentCount: 5
      }
    };
    
    

    When any email is opened the webhook triggers the data to the specified Webhook URL. Check the example JSON Response on the right side panel.

    Form Submitted

    module.exports = {
      id: 3,
      ip: '127.0.0.1',
      dateSubmitted: '2017-06-14T12:25:25+00:00',
      referrer: null,
      page: null,
      results: {
        email: 'alice@test.cz',
        country: 'Czech Republic',
        f_select: 'option3',
        checkbox: 'check2, check4'
      },
      contact: {
        id: 50,
        points: 0,
        title: null,
        firstname: null,
        lastname: null,
        company: null,
        position: null,
        email: 'alice@test.cz',
        mobile: null,
        phone: null,
        fax: null,
        address1: null,
        address2: null,
        city: null,
        state: null,
        zipcode: null,
        country: 'Czech Republic',
        preferred_locale: null,
        attribution_date: null,
        attribution: null,
        website: null,
        multiselect: null,
        f_select: 'ddd',
        boolean: null,
        datetime: null,
        timezone1: null,
        facebook: null,
        foursquare: null,
        googleplus: null,
        instagram: null,
        linkedin: null,
        skype: null,
        twitter: null,
        ownedBy: null,
        ownedByUsername: null,
        ownedByUser: null,
        tags: ''
      },
      formId: 3,
      formName: 'various fields test',
      formAlias: 'various_fi'
    };
    

    When any form is submitted the webhook triggers the data to the specified Webhook URL. Check the example JSON Response on the right side panel.

    Page Hit

    module.exports = {
      id: 7,
      dateHit: '2017-06-19T14:26:54+00:00',
      dateLeft: null,
      redirect: null,
      country: '',
      region: '',
      city: '',
      isp: '',
      organization: '',
      code: 200,
      referer: null,
      url: null,
      urlTitle: null,
      userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36',
      remoteHost: null,
      pageLanguage: 'en',
      source: null,
      sourceId: null,
      contact: {
        id: 54,
        points: 0,
        title: null,
        firstname: null,
        lastname: null,
        company: null,
        position: null,
        email: null,
        mobile: null,
        phone: null,
        fax: null,
        address1: null,
        address2: null,
        city: null,
        state: null,
        zipcode: null,
        country: null,
        preferred_locale: null,
        attribution_date: null,
        attribution: null,
        website: null,
        multiselect: null,
        f_select: null,
        boolean: null,
        datetime: null,
        timezone1: null,
        facebook: null,
        foursquare: null,
        googleplus: null,
        instagram: null,
        linkedin: null,
        skype: null,
        twitter: null,
        ownedBy: null,
        ownedByUsername: null,
        ownedByUser: null,
        tags: ''
      }, page: {
        id: 1,
        title: 'Webhook test',
        alias: 'webhook-test'
      }
    };
    
    

    When any page is hit the webhook triggers the data to the specified Webhook URL. Check the example JSON Response on the right side panel.

    Points Changed

    module.exports = {
      id: 15,
      dateAdded: '2017-06-13T11:27:07+00:00',
      dateModified: '2017-06-13T11:27:07+00:00',
      dateIdentified: '2017-06-13T11:27:07+00:00',
      lastActive: '2017-06-13T11:27:07+00:00',
      createdByUser: ' ',
      modifiedByUser: ' ',
      points: 5,
      title: null,
      firstname: null,
      lastname: null,
      company: null,
      position: null,
      email: 'alice@test.net',
      mobile: null,
      phone: null,
      fax: null,
      address1: null,
      address2: null,
      city: null,
      state: null,
      zipcode: null,
      country: null,
      preferred_locale: null,
      attribution_date: null,
      attribution: null,
      website: null,
      facebook: null,
      foursquare: null,
      googleplus: null,
      instagram: null,
      linkedin: null,
      skype: null,
      twitter: null,
      ownedBy: null,
      ownedByUsername: null,
      ownedByUser: null,
      tags: ''
    };
    
    

    When any points are changed the webhook triggers the data to the specified Webhook URL. Check the example JSON Response on the right side panel.

    The Webhook Workflow

    The example workflow below describes a real-life workflow to get an idea how the webhooks can be used. Let’s imagine we have a project management system (PMS) and we want to create a new issue when a lead submits a form.

    1. A lead submits a Aritic PinPoint form.
    2. Aritic PinPoint saves the form.
    3. Aritic PinPoint checks if there is a webhook with the Form submit event. If there is, Aritic PinPoint sends the data to the URL address defined in the webhook.
    4. PMS receives the data about the form submission and creates a new issue from it.

    Create a Webhook

    It is possible to create multiple different webhooks. That will allow you to send different information to different apps/scripts.

    1. Open the settings menu and select Webhooks.
    2. Create a new webhook.
    3. Fill in a Name, Webhook POST Url (see the next paragraph if you don’t have one) and select which Webhook Events should trigger this webhook.

    Test a Webhook

    The easiest way how to test a webhook payload is to use a service like RequestBin. RequestBin lets you create a URL which you can set as the Webhook POST Url in Aritic PinPoint. Then click the Apply button to save it and then click the Send Test Payload button. That will send a test payload data to RequestBin and you will be able to see it at your RequestBin.

    When you have created your testing webhook, you can test the real data it sends when a defined action is triggered.

    Immediate or Queued Webhooks

    There is an option to queue webhooks for background execution. The reason behind it is that every time an action like contact update happens which has the webhook listener attached to it, the action has to wait for the webhook response untill the webhook response returns or when it times out after 10 senconds. So it is up to the webhook reciever how fast the contact update is.

    This lag can be more visible when you do a CSV import. It may be slow when it is waiting a second or two for webhook response for every imported contact.

    If you want to avoid this lag, configure the webhook settings in the configuration page and select the queue option from there. This way every time the webhook is triggered, the action is queued as a new row into database, so it is much faster and then the command will make the requests which may take some time. The caveat to this optimisation is that the webhooks are not fired every time the action happens, but every time the command runs.

    Queued Event Order

    Aritic PinPoint will send several events in one webhook if they happen before the queue trigger command runs. Aritic PinPoint's default order of those events is chronological. But Zapier integration which use webhooks heavily requires reverse chronological order. Thereofore the new option to configure the order was added to webhooks as well as to the global configuration. Webhook configuration overwrites the global configuration, but if not set, the global configuration order value is applied.

    Point Actions

    Use this endpoint to obtain details on Aritic PinPoint's point actions.

    <?php
    use AriticPinPoint\AriticPinPointApi;
    use AriticPinPoint\Auth\ApiAuth;
    
    // ...
    $initAuth = new ApiAuth();
    $auth     = $initAuth->newAuth($settings);
    $apiUrl   = "https://your-ariticpinpoint.com";
    $api      = new AriticPinPointApi();
    $pointApi = $api->newApi("points", $auth, $apiUrl);
    

    Get Point Action

    <?php
    
    //...
    $point = $pointApi->get($id);
    
    {
        "point": {
            "id": 1,
            "name": "Opens Email",
            "description": null,
            "type": "email.send",
            "isPublished": true,
            "publishUp": null,
            "publishDown": null,
            "dateAdded": "2015-07-19T00:34:11-05:00",
            "createdBy": 1,
            "createdByUser": "Joe Smith",
            "dateModified": "2015-07-19T00:41:44-05:00",
            "modifiedBy": 1,
            "modifiedByUser": "Joe Smith",
            "delta": 10,
            "properties": {
                "emails": [
                    35
                ]
            },
            "category": null
        }
    }
    

    Get an individual point action by ID.

    HTTP Request

    GET /points/ID

    Response

    Expected Response Code: 200

    See JSON code example.

    Point Action Properties

    Name Type Description
    id int ID of the point
    name string Name of the point
    description string/null Description of the point
    category string Category name
    type string Point action type
    isPublished bool Published state
    publishUp datetime/null Date/time when the point should be published
    publishDown datetime/null Date/time the point should be un published
    dateAdded datetime Date/time point was created
    createdBy int ID of the user that created the point
    createdByUser string Name of the user that created the point
    dateModified datetime/null Date/time point was last modified
    modifiedBy int ID of the user that last modified the point
    modifiedByUser string Name of the user that last modified the point
    delta int The number of points to give the lead when executing this action
    properties array Configured properties for this point action

    List Point Actions

    <?php
    // ...
    
    $points = $pointApi->getList($searchFilter, $start, $limit, $orderBy, $orderByDir, $publishedOnly, $minimal);
    
    {
        "total": 1,
        "points": [
            {
                "id": 1,
                "name": "Opens Email",
                "description": null,
                "category": null
                "type": "email.send",
                "isPublished": true,
                "publishUp": null,
                "publishDown": null,
                "dateAdded": "2015-07-19T00:34:11-05:00",
                "createdBy": 1,
                "createdByUser": "Joe Smith",
                "dateModified": "2015-07-19T00:41:44-05:00",
                "modifiedBy": 1,
                "modifiedByUser": "Joe Smith",
                "delta": 10,
                "properties": {
                    "emails": [
                        35
                    ]
                }
            }
        ]
    }
    

    HTTP Request

    GET /points

    Query Parameters

    Name Description
    search String or search command to filter entities by.
    start Starting row for the entities returned. Defaults to 0.
    limit Limit number of entities to return. Defaults to the system configuration for pagination (30).
    orderBy Column to sort by. Can use any column listed in the response.
    orderByDir Sort direction: asc or desc.
    publishedOnly Only return currently published entities.
    minimal Return only array of entities without additional lists in it.

    Response

    Expected Response Code: 200

    See JSON code example.

    Properties

    Same as Get Point Action.

    Create Point Action

    <?php 
    
    $data = array(
        'name' => 'test',
        'delta' => 5,
        'type' => 'page.hit',
        'description' => 'created as a API test'
    );
    
    $point = $pointApi->create($data);
    

    Create a new point action.

    HTTP Request

    POST /points/new

    Post Parameters

    Same as Get Point Action. Point Action fields and actions can be created/edited via the point actions/actions arrays in the point action array.

    Response

    Expected Response Code: 201

    Properties

    Same as Get Point Action.

    Edit Point Action

    <?php
    
    $id   = 1;
    $data = array(
        'name' => 'test',
        'delta' => 5,
        'type' => 'page.hit',
        'description' => 'created as a API test'
    );
    
    // Create new a point action of ID 1 is not found?
    $createIfNotFound = true;
    
    $point = $pointApi->edit($id, $data, $createIfNotFound);
    

    Edit a new point action. Note that this supports PUT or PATCH depending on the desired behavior.

    PUT creates a point action if the given ID does not exist and clears all the point action inpoint actionation, adds the inpoint actionation from the request. Point Action fields and actions will be also deleted if not present in the request. PATCH fails if the point action with the given ID does not exist and updates the point action field values with the values point action the request.

    HTTP Request

    To edit a point action and return a 404 if the point action is not found:

    PATCH /points/ID/edit

    To edit a point action and create a new one if the point action is not found:

    PUT /points/ID/edit

    Post Parameters

    Same as Get Point Action. Point Action fields and actions can be created/edited via the point actions/actions arrays in the point action array.

    Response

    If PUT, the expected response code is 200 if the point action was edited or 201 if created.

    If PATCH, the expected response code is 200.

    Properties

    Same as Get Point Action.

    Delete Point Action

    <?php
    
    $point = $pointApi->delete($id);
    

    Delete a point action.

    HTTP Request

    DELETE /points/ID/delete

    Response

    Expected Response Code: 200

    Properties

    Same as Get Point Action.

    Get Point Action Types

    <?php
    
    $point = $pointApi->getPointActionTypes();
    

    Get array of available Point Action Types

    HTTP Request

    GET /points/actions/types

    Response

    Expected Response Code: 200

    {  
        "pointActionTypes":{  
            "asset.download":"Downloads an asset",
            "email.send":"Is sent an email",
            "email.open":"Opens an email",
            "form.submit":"Submits a form",
            "page.hit":"Visits a landing page",
            "url.hit":"Visits specific URL"
        }
    }
    

    See JSON code example.

    Point Triggers

    Use this endpoint to obtain details on Aritic PinPoint's point triggers.

    <?php
    use AriticPinPoint\AriticPinPointApi;
    use AriticPinPoint\Auth\ApiAuth;
    
    // ...
    $initAuth   = new ApiAuth();
    $auth       = $initAuth->newAuth($settings);
    $apiUrl     = "https://your-ariticpinpoint.com";
    $api        = new AriticPinPointApi();
    $triggerApi = $api->newApi("pointTriggers", $auth, $apiUrl);
    

    Get Point Trigger

    <?php
    
    //...
    $trigger = $triggerApi->get($id);
    
    {
        "trigger": {
             "id": 1,
             "name": "Trigger test",
             "description": null,
             "category": null,      
             "isPublished": true,      
             "publishUp": null,
             "publishDown": null,
             "dateAdded": "2015-07-23T03:20:42-05:00",
             "createdBy": 1,
             "createdByUser": "Joe Smith",
             "dateModified": null,
             "modifiedBy": null,
             "modifiedByUser": null,l,
             "points": 10,
             "color": "ab5959",
             "events": {
                 "1": {
                     "id": 1,
                     "type": "email.send",
                     "name": "Send email",
                     "description": null,
                     "order": 1,
                     "properties": {
                        "email": 21
                     }
                 }
             }
         }
    }
    

    Get an individual point trigger by ID.

    HTTP Request

    GET /points/triggers/ID

    Response

    Expected Response Code: 200

    See JSON code example.

    Point Trigger Properties

    Name Type Description
    id int ID of the point
    name string Name of the point
    description string/null Description of the point
    category string Category name
    isPublished bool Published state
    publishUp datetime/null Date/time when the point should be published
    publishDown datetime/null Date/time the point should be un published
    dateAdded datetime Date/time point was created
    createdBy int ID of the user that created the point
    createdByUser string Name of the user that created the point
    dateModified datetime/null Date/time point was last modified
    modifiedBy int ID of the user that last modified the point
    modifiedByUser string Name of the user that last modified the point
    points int The minimum number of points before the trigger events are executed
    color string Color hex to highlight the lead with. This value does NOT include the pound sign (#)
    events array Array of TriggerEvent entities for this trigger. See below.

    Trigger Event Properties

    Name Type Description
    id int ID of the event
    type string Event type
    name string Name of the event
    description string Description of the event
    order int Event order
    properties array Configured properties for the event

    List Point Triggers

    <?php
    // ...
    
    $triggers = $triggerApi->getList($searchFilter, $start, $limit, $orderBy, $orderByDir, $publishedOnly, $minimal);
    
    {
        "total": 1,
        "triggers": [
            {
                "id": 1,
                "name": "Trigger test",
                "description": null,
                "category": null,      
                "isPublished": true,      
                "publishUp": null,
                "publishDown": null,
                "dateAdded": "2015-07-23T03:20:42-05:00",
                "createdBy": 1,
                "createdByUser": "Joe Smith",
                "dateModified": null,
                "modifiedBy": null,
                "modifiedByUser": null,l,
                "points": 10,
                "color": "ab5959",
                "events": {
                    "1": {
                        "id": 1,
                        "type": "email.send",
                        "name": "Send email",
                        "description": null,
                        "order": 1,
                        "properties": {
                            "email": 21
                        }
                    }
                }
            }
        ]
    }
    

    HTTP Request

    GET /points/triggers

    Query Parameters

    Name Description
    search String or search command to filter entities by.
    start Starting row for the entities returned. Defaults to 0.
    limit Limit number of entities to return. Defaults to the system configuration for pagination (30).
    orderBy Column to sort by. Can use any column listed in the response.
    orderByDir Sort direction: asc or desc.
    publishedOnly Only return currently published entities.
    minimal Return only array of entities without additional lists in it.

    Response

    Expected Response Code: 200

    See JSON code example.

    Properties

    Same as Get Point Trigger.

    Create Point Trigger

    <?php 
    
    $data = array(
        'name' => 'test',
        'description' => 'created as a API test',
        'points' => 5,
        'color' => '4e5d9d',
        'trigger_existing_leads' => false,
        'events' => array(
            array(
                'name' => 'tag test event',
                'description' => 'created as a API test',
                'type' => 'lead.changetags',
                'order' => 1,
                'properties' => array(
                    'add_tags' => array('tag-a'),
                    'remove_tags' => array()
                )
            ),
            array(
                'name' => 'send email test event',
                'description' => 'created as a API test',
                'type' => 'email.send',
                'order' => 2,
                'properties' => array(
                    'email' => 1
                )
            )
        )
    );
    
    $trigger = $triggerApi->create($data);
    

    Create a new point trigger.

    HTTP Request

    POST /points/triggers/new

    Post Parameters

    Same as Get Point Trigger. Point Trigger events can be created/edited via the point trigger event arrays placed in the point trigger array.

    Response

    Expected Response Code: 201

    Properties

    Same as Get Point Trigger.

    Edit Point Trigger

    <?php
    
    $id   = 1;
    $data = array(
        'name' => 'test',
        'description' => 'created as a API test',
        'points' => 5,
        'color' => '4e5d9d',
        'trigger_existing_leads' => false,
        'events' => array(
            array(
                'name' => 'tag test event',
                'description' => 'created as a API test',
                'type' => 'lead.changetags',
                'order' => 1,
                'properties' => array(
                    'add_tags' => array('tag-a'),
                    'remove_tags' => array()
                )
            ),
            array(
                'name' => 'send email test event',
                'description' => 'created as a API test',
                'type' => 'email.send',
                'order' => 2,
                'properties' => array(
                    'email' => 1
                )
            )
        )
    );
    
    // Create new a point trigger of ID 1 is not found?
    $createIfNotFound = true;
    
    $trigger = $triggerApi->edit($id, $data, $createIfNotFound);
    

    Edit a new point trigger. Note that this supports PUT or PATCH depending on the desired behavior.

    PUT creates a point trigger if the given ID does not exist and clears all the point trigger information, adds the information from the request. Point Trigger events will be also deleted if not present in the request. PATCH fails if the point trigger with the given ID does not exist and updates the point trigger field values with the values point trigger the request.

    HTTP Request

    To edit a point trigger and return a 404 if the point trigger is not found:

    PATCH /points/triggers/ID/edit

    To edit a point trigger and create a new one if the point trigger is not found:

    PUT /points/triggers/ID/edit

    Post Parameters

    Same as Get Point Trigger. Point Trigger events can be created/edited via the point triggers event arrays placed in the point trigger array.

    Response

    If PUT, the expected response code is 200 if the point trigger was edited or 201 if created.

    If PATCH, the expected response code is 200.

    Properties

    Same as Get Point Trigger.

    Delete Point Trigger

    <?php
    
    $trigger = $triggerApi->delete($id);
    

    Delete a point trigger.

    HTTP Request

    DELETE /points/triggers/ID/delete

    Response

    Expected Response Code: 200

    Properties

    Same as Get Point Trigger.

    Delete Point Trigger Events

    The following examples will show how to delete events with ID 56 and 59.

    <?php
    
    $trigger = $triggerApi->deleteFields($triggerId, array(56, 59));
    

    Delete a point trigger events.

    HTTP Request

    DELETE /points/triggers/ID/events/delete?events[]=56&events[]=59

    Response

    Expected Response Code: 200

    Properties

    Same as Get Point Trigger.

    Get Point Trigger Event Types

    <?php
    
    $point = $pointApi->getEventTypes();
    

    Get array of available Point Trigger Event Types

    HTTP Request

    GET /points/triggers/events/types

    Response

    Expected Response Code: 200

    {  
        "eventTypes":{  
            "campaign.changecampaign":"Modify contact's campaigns",
            "lead.changelists":"Modify contact's segments",
            "lead.changetags":"Modify contact's tags",
            "plugin.leadpush":"Push contact to integration",
            "email.send":"Send an email"
        }
    }