Aritic PinPoint API Doc
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
Aritic uses OAuth or Basic Authentication for API authorization. It supports both OAuth 1a and OAuth 2. The administrator of the Aritic instance must choose one or the other. Of course OAuth 2 is only recommended for servers secured behind SSL. Basic authentication must be enabled in Configuration -> API Settings.
The Aritic administrator should enable the API in the Configuration -> API Settings. This will add the “API Credentials” to the admin menu. A client/consumer ID and secret should then be generated which will be used in the following processes.
All authorization requests should be made to the specific Aritic instances URL, i.e. https://yourapp.aritic.com.
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'"
OAUTH 1A
The OAuth 1a method is recommended for servers that are not behind https. Note that OAuth 1a access tokens do not expire.
OAuth 1a can be a complicated method due to the need to generate a signature for the request. If anything is off with the signature, the request will not be validated.
Authorization
Step One - Obtain a Request Token
The first step is to obtain a request token that will be used when directing the user to the authorization page.
Make a POST to the request token endpoint /oauth/v1/request_token
:
POST /oauth/v1/request_token
Authorization:
OAuth oauth_callback="https%3A%2F%2Fyour-callback-uri.com",
oauth_consumer_key="CONSUMER_KEY",
oauth_nonce="UNIQUE_STRING",
oauth_signature="GENERATED_REQUEST_SIGNATURE",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1318467427",
oauth_version="1.0"
(note that the header has been wrapped for legibility)
Review Generating the Authorization Header on the specifics of generating the OAuth header.
The response will be a query string:
oauth_token=REQUEST_TOKEN&oauth_token_secret=REQUEST_TOKEN_SECRET&oauth_expires_in=3600
Parse the string and use the parameters in the next step as indicated.
Note that the refresh token is only good for the number of seconds specified in oauth_expires_in
.
Step Two - Authorization
Now redirect the user to the authorization endpoint oauth/v1/authorize
with the request token as part of the URL’s query.
If the callback is something different than what is configured in Aritic, url encode it and include in the query as oauth_callback
.
/oauth/v1/authorize?oauth_token=REQUEST_TOKEN&oauth_callback=https%3A%2F%2Fyour-callback-uri.com
The user will login and Aritic will redirect back to the either the consumer’s configured callback or to the oauth_callback
included in the query.
The callback will include oauth_token
and oauth_verifier
in the URL’s query.
Compare the oauth_token
in the query with that obtained in step two to ensure they are the same and prevent cross-site request forgery.
oauth_verifier
will need to be part of the header generated in step three.
Step Three - Obtain an Access Token
Generate the Authorization header and make a POST to the access token endpoint /oauth/v1/access_token
.
When generating the header, the oauth_token_secret
returned in step two should be used as the TOKEN_SECRET
in the composite key.
oauth_verifier
from step two should be part of the Authorization header generated.
(note that the header has been wrapped for legibility)
The response should include a query string with the access token:
oauth_token=ACCESS_TOKEN&oauth_token_secret=ACCESS_TOKEN_SECRET
The oauth_token
can be included in the authorize header and the oauth_token_secret
should be used as the TOKEN_SECRET
in the composite key when signing API requests.
Generating the Authorization Header
The OAuth header may include the following parameters:
Key | Description |
---|---|
oauth_callback | Optional, URL encoded callback to redirect the user to after authorization. If the callback URL is set in Aritic, this must match. |
oauth_consumer_key | The consumer key obtained from Aritic’s API Credentials |
oauth_nonce | Uniquely generated string that should be used only once |
oauth_signature | Signature generated from all applicable data for the request |
oauth_signature_method | Method for creating the signature. Currently, only HMAC-SHA1 is supported. |
oauth_timestamp | Current unix timestamp |
oauth_token | The access token |
oauth_verifier | Returned after authorization and used when requesting an access token |
oauth_version | Should always be 1.0 |
Step One - Build the Base String
The base string is used to generate the oauth_signature.
The structure of the base string is as follows:
METHOD&URL_ENCODED_URI&NORMALIZED_PARAMETERS
METHOD
should be the request method and should always be capitalized.
URL_ENCODED_URI
should be the base URI the request is made to. It should not include any query parameters (query parameters should be part of NORMALIZED_PARAMETERS).
NORMALIZED_PARAMETERS
should be a url encoded, alphabetically sorted query string of the above oauth parameters (except oauth_signature
) plus the parameters of the request (query/post body).
Each key and each value of the parameters must be url encoded individually as well.
Then each url encoded key/value pair should be concatenated into a single string with an ampersand (&) as the glue character.
For example, let’s say a request includes a query of 'title=Mr&firstname=Joe&lastname=Smith'. The process would look something like the following (replacing urlencode()
with whatever function is appropriate for the language being used). Of course realistically, natural sort and loop functions would be used.
Put all together, a base string might look like:
Step Two - Build the Composite Key
The composite key is used to encrypt the base string. It is composed of the consumer secret and the token secret if available (post authorization) combined with an ampersand (&).
If the token secret is not available, i.e. during the request token process, then an ampersand (&) should still be used.
Step Three - Generate the Signature
Now, using the base string and the composite key, the signature can be generated using the appropriate HMAC function available to the language used. The signature generated should then be base64 encoded prior to being used in the Authorization header.
The resulting string should then be used included in the header as oauth_signature
.
Signing the API Request
To sign the API request, generate the Authorization header using the obtained access token.
(note that the header has been wrapped for legibility)
OAUTH 2
Authorization
Step One - Obtain Authorization Code
Redirect the user to the authorize endpoint oauth/v2/authorize
:
(note that the query has been wrapped for legibility)
The user will be prompted to login. Once they do, Aritic will redirect back to the URL specified in redirect_uri with a code appended to the query.
It may look something like: https://your-redirect-uri.com?code=UNIQUE_CODE_STRING&state=UNIQUE_STATE_STRING
The state returned should be compared against the original to ensure nothing has been tampered with.
Step Two - Replace with an Access Token
Obtain the value of the code from Step One then immediately POST it back to the access token endpoint oauth/v2/token
with:
(note that the post body has been wrapped for legibility)
This data should be stored in a secure location and used to authenticate API requests.
Refresh Tokens
The response’s expires_in
is the number of seconds the access token is good for and may differ based on what is configured in Aritic. The code handling the authorization process should generate an expiration timestamp based on that value. For example <?php $expiration = time() + $response['expires_in']; ?>
. If the access token has expired, the refresh_token should be used to obtain a new access token.
The refresh token is by default good for 14 days in which the user will need to reauthorize the application with Aritic. However, the refresh token’s expiration time is configurable through Aritic’s Configuration.
To obtain a new access token, a POST should be made to the access token’s endpoint oauth/v2/token
using the refresh_token
grant type.
(note that the post body has been wrapped for legibility)
The response returned should be a JSON encoded string:
Authenticating the API Request
Authenticating the API request with OAuth2 is easy. Choose one of the following methods that is appropriate for the application’s needs.
Authorization Header
By using an authorization header, any request method can be authenticated.
However, note that this method requires that the server Aritic is installed on passes headers to PHP or has access to the apache_request_headers()
function. apache_request_headers()
is not available to PHP running under fcgi.
Method Specific
The access token can also be appended to the query or included in the body of a POST.
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/ma/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/ma/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/ma/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/ma/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", "ma/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/ma/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/ma/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/ma/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/ma/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", "ma/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/ma/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/ma/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/ma/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/ma/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/ma/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/ma/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", "ma/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/ma/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/ma/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/ma/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/ma/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/ma/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", "ma/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/ma/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/ma/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/ma/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/ma/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/ma/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","ma/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/ma/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/ma/api/contacts/193208/delete \
--header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/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/ma/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/ma/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", "/ma/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/ma/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.
Add Do Not Contact
curl --request POST \
--url https://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/add \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'cache-control: no-cache'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/add")
.post(null)
.addHeader("Authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/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;
}
require 'uri'
require 'net/http'
url = URI("https://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/add")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/add"
payload = ""
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
{
"contact": {
"isPublished": true,
"dateAdded": "2017-10-26T19:36:30+05:30",
"dateModified": "2019-03-13T20:31:47+05:30",
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": 1,
"modifiedByUser": "Arul Raj",
"id": 143,
"points": 100,
"firstname": "John",
"company": "dataaegis",
"email": "john@test.com",
"city": "Hyderabad",
"state": "Andhra Pradesh",
"country": "India",
}
}
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/add",
"method": "POST",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Add a contact to DNC list
HTTP request
POST /contacts/ID/dnc/CHANNEL/add
Response
Expected Response Code: 200
Data Parameters
Name | Description |
---|---|
channel | Channel of DNC. For example ‘email’, 'sms’… Default is email. |
reason | Int value of the reason. Use Contacts constants: Contacts::UNSUBSCRIBED (1), Contacts::BOUNCED (2), Contacts::MANUAL (3). Default is Manual |
channelId | ID of the entity which was the reason for unsubscription |
comments | A text describing details of DNC entry |
Remove Do Not Contact
curl --request POST \
--url https://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/remove \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/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://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/remove")
.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://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/remove")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/remove"
payload = ""
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx-ma.aritic.com/ma/api/contacts/143/dnc/email/remove",
"method": "POST",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"recordFound": true,
"contact": {
"isPublished": true,
"dateAdded": "2017-10-26T19:36:30+05:30",
"dateModified": "2019-03-13T20:54:42+05:30",
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": 1,
"modifiedByUser": "Arul Raj",
"id": 143,
"points": 100,
"firstname": "Nara",
"company": "dataaegis",
"email": "narasimha@dataaegis.com",
"city": "Hyderabad",
"state": "Andhra Pradesh",
"country": "India",
...
...
}
}
Remove a contact from DNC list
HTTP request
POST /contacts/ID/dnc/CHANNEL/remove
Response
Expected Response Code: 200
Data Parameters
Name | Description |
---|---|
channel | Channel of DNC. For example ‘email’, 'sms’… Default is email. |
List Available Owners
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/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/ma/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/ma/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/ma/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", "/ma/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/ma/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/ma/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/ma/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/ma/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/ma/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", "/ma/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/ma/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/ma/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/ma/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/ma/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/ma/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", "/ma/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/ma/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 |
Get Contact’s Companies
<?php
$companies = $contactApi->getContactCompanies($contactId);
{
"total":1,
"companies":[
{
"company_id":"420",
"date_associated":"2016-12-27 15:03:43",
"is_primary":"0",
"companyname":"test",
"companyemail":"test@company.com",
"companycity":"Raleigh",
"score":"0",
"date_added":"2016-12-27 15:03:42"
}
]
}
Get a list of contact’s companies the contact belongs to.
HTTP Request
GET /contacts/ID/companies
Response
Expected response code: 200
List Properties
Name | Type | Description |
---|---|---|
company_id | int | Company ID |
date_associated | datetime | Date and time when the contact was associated to the company |
date_added | datetime | Date and time when the company was created |
is_primary | bool | Flag whether the company association is primary (current) |
companyname | string | Name of the company |
companyemail | string | Email of the company |
companycity | string | City of the company |
score | int | Score of the company |
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.
Campaigns
Use this endpoint to obtain details on Aritic’s campaigns.
Get Campaign
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/campaigns/1');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
curl --request GET \
--url https://xxxxxxxx-ma.aritic.com/ma/api/campaigns/1 \
--header 'Authorization: Basic qwertykYXRhYWVnaXMuY29tOmFydWqwerty' \
--header 'cache-control: no-cache'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx-ma.aritic.com/ma/api/campaigns/1")
.get()
.addHeader("Authorization", "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
require 'uri'
require 'net/http'
url = URI("https://xxxxxx-ma.aritic.com/ma/api/campaigns/1")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxxx-ma.aritic.com/ma/api/campaigns/1"
payload = ""
headers = {
'Authorization': "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
'cache-control': "no-cache"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx-ma.aritic.com/ma/api/campaigns/1",
"method": "GET",
"headers": {
"Authorization": "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"campaign": {
"isPublished": false,
"dateAdded": "2017-10-01T22:58:43+05:30",
"dateModified": null,
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": null,
"id": 1,
"name": "Demo",
"category": null,
"description": null,
"allowRestart": 0,
"publishUp": null,
"publishDown": null,
"events": [
{
"id": 1,
"name": "Action",
"description": null,
"type": "page.pagehit",
"eventType": "decision",
...
...
]
}
...
...
}
}
Get an individual campaign by ID.
HTTP Request
GET /campaigns/ID
Response
Expected Response Code: 200
Campaign Properties
Name | Type | Description |
---|---|---|
id | int | ID of the campaign |
name | string | Name of the campaign |
description | string/null | Description of the campaign |
alias | string | Used to generate the URL for the campaign |
isPublished | bool | Published state |
publishUp | datetime/null | Date/time when the campaign should be published |
publishDown | datetime/null | Date/time the campaign should be un published |
dateAdded | datetime | Date/time campaign was created |
createdBy | int | ID of the user that created the campaign |
createdByUser | string | Name of the user that created the campaign |
dateModified | datetime/null | Date/time campaign was last modified |
modifiedBy | int | ID of the user that last modified the campaign |
modifiedByUser | string | Name of the user that last modified the campaign |
events | array | Array of Event entities for the campaign. See below. |
Event Properties
Name | Type | Description |
---|---|---|
id | int | ID of the event |
name | string | Name of the event |
description | string | Optional description for the event |
type | string | Type of event |
eventType | string | “action” or “decision” |
order | int | Order in relation to the other events (used for levels) |
properties | object | Configured properties for the event |
triggerMode | string | “immediate”, “interval” or “date” |
triggerDate | datetime/null | Date/time of when the event should trigger if triggerMode is “date” |
triggerInterval | int/null | Interval for when the event should trigger |
triggerIntervalUnit | string | Interval unit for when the event should trigger. Options are i = minutes, h = hours, d = days, m = months, y = years |
children | array | Array of this event’s children , |
parent | object/null | This event’s parent |
decisionPath | string/null | If the event is connected into an action, this will be “no” for the non-decision path or “yes” for the actively followed path. |
List Campaigns
curl --request GET \
--url https://xxxxxx-ma.aritic.com/ma/api/campaigns \
--header 'Authorization: Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty' \
--header 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxx-ma.aritic.com/ma/api/campaigns');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx-ma.aritic.com/ma/api/campaigns")
.get()
.addHeader("Authorization", "Basic qwertykYXRhYWVnaXMuY29tOmFydWqwerty")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
require 'uri'
require 'net/http'
url = URI("https://xxxxxx-ma.aritic.com/ma/api/campaigns")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxxx-ma.aritic.com/ma/api/campaigns"
payload = ""
headers = {
'Authorization': "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
'cache-control': "no-cache"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx-ma.aritic.com/ma/api/campaigns",
"method": "GET",
"headers": {
"Authorization": "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"total": 134,
"campaigns": {
"1": {
"isPublished": false,
"dateAdded": "2017-10-01T22:58:43+05:30",
"dateModified": null,
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": null,
"id": 1,
"name": "Demo",
"category": null,
"description": null,
"allowRestart": 0,
"publishUp": null,
"publishDown": null,
"events": [
{
"id": 1,
"name": "Action",
"description": null,
"type": "page.pagehit",
...
...
]
}
...
}
"2": {
...
}
}
}
HTTP Request
GET /campaigns
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. |
published | 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 Campaign.
List Campaign Contacts
curl --request GET \
--url https://xxxxxx-ma.aritic.com/ma/api/campaigns/2/contacts \
--header 'Authorization: Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty' \
--header 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxx-ma.aritic.com/ma/api/campaigns/2/contacts');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx-ma.aritic.com/ma/api/campaigns/2/contacts")
.get()
.addHeader("Authorization", "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWxqwerty")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
require 'uri'
require 'net/http'
url = URI("https://xxxxxx-ma.aritic.com/ma/api/campaigns/2/contacts")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxxx-ma.aritic.com/ma/api/campaigns/2/contacts"
payload = ""
headers = {
'Authorization': "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
'cache-control': "no-cache"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx-ma.aritic.com/ma/api/campaigns/2/contacts",
"method": "GET",
"headers": {
"Authorization": "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"total": "271",
"contacts": [
{
"campaign_id": "2",
"lead_id": "19",
"date_added": "2018-02-15 09:46:04",
"manually_removed": "0",
"manually_added": "0",
"rotation": "1"
},
{
"campaign_id": "2",
"lead_id": "25",
"date_added": "2018-02-15 09:46:04",
"manually_removed": "0",
"manually_added": "0",
"rotation": "1"
},
...
]
}
This endpoint is basically an alias for the stats endpoint with ‘campaign_leads’ table and campaign_id specified. Other parameters are the same as in the stats endpoint.
HTTP Request
GET /campaigns/ID/contacts
Response
Expected Response Code: 200
Add Contact to a Campaign
curl --request POST \
--url https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/add \
--header 'Authorization: Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty' \
--header 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/add');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/add")
.post(null)
.addHeader("Authorization", "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
require 'uri'
require 'net/http'
url = URI("https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/add")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/add"
payload = ""
headers = {
'Authorization': "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/add",
"method": "POST",
"headers": {
"Authorization": "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"success": 1
}
Manually add a contact to a specific campaign.
HTTP Request
POST /campaigns/CAMPAIGN_ID/contact/CONTACT_ID/add
Response
Expected Response Code: 200
Remove Contact from a Campaign
curl --request POST \
--url https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/remove \
--header 'Authorization: Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty' \
--header 'cache-control: no-cache'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/remove")
.post(null)
.addHeader("Authorization", "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/remove');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/remove")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/remove"
payload = ""
headers = {
'Authorization': "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx-ma.aritic.com/ma/api/campaigns/1/contact/1/remove",
"method": "POST",
"headers": {
"Authorization": "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
"cache-control": "no-cache",
"Postman-Token": "c9352348-7c03-494d-b437-eb2fd97b39ab"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"success": 1
}
Manually remove a contact from a specific campaign.
HTTP Request
POST /campaigns/CAMPAIGN_ID/contact/CONTACT_ID/remove
Response
Expected Response Code: 200
See JSON code example.
Custom Event
curl --request POST \
--url https://xxxxxxxx-ma.aritic.com/ma/api/customevents?event_name=ms \
--header 'authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWx' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--data '{\n "email":"test@abc.com",\n "payloads":{\n "subcount":"20",\n "subchange":"2",\n "persubchange":"10%",\n "cmcount":"20",\n "percmchange":"10%",\n "listcount":"20",\n "listchange":"2",\n "perlischange":"10%",\n "opencount":"3",\n "openrate":"1.5%",\n "openratechange":"+2%",\n "clickcount":"3",\n "clickrate":"1.5%",\n "clickratechange":"+2%",\n "unsubcount":"3",\n "unsubrate":"1.5%",\n "unsubratechange":"+2%"\n }\n}'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxx.aritic.com/ma/api/customevents');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData(array(
'event_name' => 'ms'
));
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty',
'Content-Type' => 'application/json'
));
$request->setBody('{
"email":"test@abc.com",
"payloads":{
"subcount":"20",
"subchange":"2",
"persubchange":"10%",
"cmcount":"20",
"percmchange":"10%",
"listcount":"20",
"listchange":"2",
"perlischange":"10%",
"opencount":"3",
"openrate":"1.5%",
"openratechange":"+2%",
"clickcount":"3",
"clickrate":"1.5%",
"clickratechange":"+2%",
"unsubcount":"3",
"unsubrate":"1.5%",
"unsubratechange":"+2%"
}
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"email\":\"test@abc.com\",\n\t\"payloads\":{\n\t\t\"subcount\":\"20\",\n\t\t\"subchange\":\"2\",\n\t\t\"persubchange\":\"10%\",\n\t\t\"cmcount\":\"20\",\n\t\t\"percmchange\":\"10%\",\n\t\t\"listcount\":\"20\",\n\t\t\"listchange\":\"2\",\n\t\t\"perlischange\":\"10%\",\n\t\t\"opencount\":\"3\",\n\t\t\"openrate\":\"1.5%\",\n\t\t\"openratechange\":\"+2%\",\n\t\t\"clickcount\":\"3\",\n\t\t\"clickrate\":\"1.5%\",\n\t\t\"clickratechange\":\"+2%\",\n\t\t\"unsubcount\":\"3\",\n\t\t\"unsubrate\":\"1.5%\",\n\t\t\"unsubratechange\":\"+2%\"\n\t}\n}");
Request request = new Request.Builder()
.url("https://xxxxxxx.aritic.com/ma/api/customevents?event_name=ms")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
require 'uri'
require 'net/http'
url = URI("https://xxxxxx.aritic.com/ma/api/customevents?event_name=ms")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty'
request["cache-control"] = 'no-cache'
request.body = "{\n\t\"email\":\"test@abc.com\",\n\t\"payloads\":{\n\t\t\"subcount\":\"20\",\n\t\t\"subchange\":\"2\",\n\t\t\"persubchange\":\"10%\",\n\t\t\"cmcount\":\"20\",\n\t\t\"percmchange\":\"10%\",\n\t\t\"listcount\":\"20\",\n\t\t\"listchange\":\"2\",\n\t\t\"perlischange\":\"10%\",\n\t\t\"opencount\":\"3\",\n\t\t\"openrate\":\"1.5%\",\n\t\t\"openratechange\":\"+2%\",\n\t\t\"clickcount\":\"3\",\n\t\t\"clickrate\":\"1.5%\",\n\t\t\"clickratechange\":\"+2%\",\n\t\t\"unsubcount\":\"3\",\n\t\t\"unsubrate\":\"1.5%\",\n\t\t\"unsubratechange\":\"+2%\"\n\t}\n}"
response = http.request(request)
puts response.read_body
import requests
url = "https://xxxxxx.aritic.com/ma/api/customevents"
querystring = {"event_name":"ms"}
payload = "{\n\t\"email\":\"test@abc.com\",\n\t\"payloads\":{\n\t\t\"subcount\":\"20\",\n\t\t\"subchange\":\"2\",\n\t\t\"persubchange\":\"10%\",\n\t\t\"cmcount\":\"20\",\n\t\t\"percmchange\":\"10%\",\n\t\t\"listcount\":\"20\",\n\t\t\"listchange\":\"2\",\n\t\t\"perlischange\":\"10%\",\n\t\t\"opencount\":\"3\",\n\t\t\"openrate\":\"1.5%\",\n\t\t\"openratechange\":\"+2%\",\n\t\t\"clickcount\":\"3\",\n\t\t\"clickrate\":\"1.5%\",\n\t\t\"clickratechange\":\"+2%\",\n\t\t\"unsubcount\":\"3\",\n\t\t\"unsubrate\":\"1.5%\",\n\t\t\"unsubratechange\":\"+2%\"\n\t}\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
'cache-control': "no-cache"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx.aritic.com/ma/api/customevents?event_name=ms",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic qwertyBkYXRhYWVnaXMuY29tOmFydWqwerty",
"cache-control": "no-cache"
},
"processData": false,
"data": "{\n\t\"email\":\"test@abc.com\",\n\t\"payloads\":{\n\t\t\"subcount\":\"20\",\n\t\t\"subchange\":\"2\",\n\t\t\"persubchange\":\"10%\",\n\t\t\"cmcount\":\"20\",\n\t\t\"percmchange\":\"10%\",\n\t\t\"listcount\":\"20\",\n\t\t\"listchange\":\"2\",\n\t\t\"perlischange\":\"10%\",\n\t\t\"opencount\":\"3\",\n\t\t\"openrate\":\"1.5%\",\n\t\t\"openratechange\":\"+2%\",\n\t\t\"clickcount\":\"3\",\n\t\t\"clickrate\":\"1.5%\",\n\t\t\"clickratechange\":\"+2%\",\n\t\t\"unsubcount\":\"3\",\n\t\t\"unsubrate\":\"1.5%\",\n\t\t\"unsubratechange\":\"+2%\"\n\t}\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
If no contact is present :
{
"success": 0
}
If contacts are present :
{
"success": 1
}
Custom event of any name can be created ith custom paramaters. Email being mandatory param.
The parameter values that are received from Custom Event payload can be used in templates using simple personalization token as {customevent=eventName?payloadnames}
For the given example the token to add subcount in template is {customevent=ms?subcount}
Http Request
POST /customevents?event_name={name}
Response
Expected Response Code: 200
Query Parameter
Name | Type | Description |
---|---|---|
string | Email Id of the contact | |
atc_id | string | atc_id value from cookies. This is optional |
mobilenumber | int | Mobile number of contact |
payloads | array | array of custom parameters |
Opportunities
Use this endpoint to work with Aritic PinPoint's opportunity fields.
Create Opportunity
curl --request POST \
--url https://xxxxxxxx-ma.aritic.com/api/opportunity/new \
--header 'Authorization: Basic qwerty46bWF1dGlj' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/json' \
--data ' {\n "email":""testopportunity@test.com"\n }'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/api/opportunity/new');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic qwerty46bWF1dGlj',
'Content-Type' => 'application/json'
));
$request->setBody(' {
"email":"testopportunity@test.com"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "\t{\n\t\t\"email\":\"testopportunity@test.com\"\n\t}");
Request request = new Request.Builder()
.url("https://xxxxxxxx-ma.aritic.com/api/opportunity/new")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic qwerty46bWF1dGlj")
.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/opportunity/new")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic qwerty46bWF1dGlj'
request["Cache-Control"] = 'no-cache'
request.body = "\t{\n\t\t\"email\":\"testopportunity@test.com\"\n\t}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma.aritic.com")
payload = "\t{\n\t\t\"email\":\"testopportunity@test.com\"\n\t}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic YWRtaW46bWF1dGlj",
'Cache-Control': "no-cache"
}
conn.request("POST", "api,opportunity,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/opportunity/new",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic qwerty46bWF1dGlj",
"Cache-Control": "no-cache"
},
"processData": false,
"data": "\t{\n\t\t\"email\":\"testopportunity@test.com\"\n\t}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"opportunity": [
{
"id": "5",
"lead_id": "143",
"other": "a:3:{s:8:\"owner_id\";s:0:\"\";s:11:\"lead_source\";N;s:11:\"sales_stage\";N;}"
}
]
}
Create a new opportunity using the existing lead email id.
HTTP Request
POST /opportunity/new
Response
Expected Response Code: 200
See JSON code example.
Field Properties
Name | Type | Description |
---|---|---|
string | email Id of opportunity (email id of existing lead) | |
opportunityId | string | Opportunity Id of the Opportunity |
company | string | Company of the Opportunity |
opportunityAlias | string | alias name of opportunity |
createdOn | datetime | Created date/time field of opportunity |
amount | decimal | Actual amount of the opportunity |
profit | decimal | Actual profit of the opportunity |
closeDate | datetime | Opportunity close date |
currency | string | Currency of opportunity |
stepName | string | Step name of opportunity |
modifiedOn | datetime | Date of modification of opportunity |
ownerEmail | string | Email id of the owner |
salesStage | int | Sales stage Id |
analyticSource | string | Source of opportunity |
Edit Opportunity
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxxx-ma.aritic.com/api/opportunity/edit",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic qwertyh46bWF1dGlj",
"Cache-Control": "no-cache"
},
"processData": false,
"data": "\t{\n\t\t\"email\":\"testopportunity@test.com\",\n\t\t\"opportunityId\":\"2\",\n\t\t\"salesStage\":\"1\",\n\t\t\"amount\":\"3000000\"\n\t}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
curl --request POST \
--url https://xxxxxxxx-ma.aritic.com/api/opportunity/5/edit \
--header 'Authorization: Basic qwerty46bWF1dGlj' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/json' \
--data ' {\n "email":"testopportunity@test.com",\n "opportunityId":"2",\n "salesStage":"1",\n "amount":"3000000"\n }'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/api/opportunity/5/edit');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic qwertyW46bWF1dGlj',
'Content-Type' => 'application/json'
));
$request->setBody(' {
"email":"testopportunity@test.com",
"opportunityId":"2",
"salesStage":"1",
"amount":"3000000"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "\t{\n\t\t\"email\":\"testopportunity@test.com\",\n\t\t\"opportunityId\":\"2\",\n\t\t\"salesStage\":\"1\",\n\t\t\"amount\":\"3000000\"\n\t}");
Request request = new Request.Builder()
.url("https://xxxxxxxx-ma.aritic.com/api/opportunity/5/edit")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic qwerty46bWF1dGlj")
.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/opportunity/5/edit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic qwerty46bWF1dGlj'
request["Cache-Control"] = 'no-cache'
request.body = "\t{\n\t\t\"email\":\"testopportunity@test.com\",\n\t\t\"opportunityId\":\"2\",\n\t\t\"salesStage\":\"1\",\n\t\t\"amount\":\"3000000\"\n\t}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma.aritic.com")
payload = "\t{\n\t\t\"email\":\"testopportunity@test.com\",\n\t\t\"opportunityId\":\"2\",\n\t\t\"salesStage\":\"1\",\n\t\t\"amount\":\"3000000\"\n\t}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic qwerty46bWF1dGlj",
'Cache-Control': "no-cache"
}
conn.request("POST", "api,opportunity,5,edit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"opportunity": [
{
"id": "5",
"actualvalue": "3000000",
"opportunityid": "2",
"lead_id": "143",
"other": "a:3:{s:8:\"owner_id\";s:0:\"\";s:11:\"lead_source\";N;s:11:\"sales_stage\";s:1:\"1\";}"
}
]
}
Edit/Update any opportunity data.
HTTP Request
POST /opportunity/ID/edit
Response
Expected Response Code: 200
See JSON code example.
Field Properties
Same as Create Opportunity.
Get Opportunity By ID
curl --request GET \
--url https://xxxxxxxx-ma.aritic.com/api/opportunity/5 \
--header 'Authorization: Basic qwerty46bWF1dGlj' \
--header 'Cache-Control: no-cache' \
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/api/opportunity/5');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic qwerty46bWF1dGlj'
));
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/opportunity/5")
.get()
.addHeader("Authorization", "Basic qwerty46bWF1dGlj")
.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/opportunity/5")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic qwerty46bWF1dGlj'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxxx-ma.aritic.com/api/opportunity/5",
"method": "GET",
"headers": {
"Authorization": "Basic qwerty46bWF1dGlj",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma.aritic.com")
headers = {
'Authorization': "Basic qwerty46bWF1dGlj",
'Cache-Control': "no-cache"
}
conn.request("GET", "api,opportunity,5", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"opportunity": [
{
"id": "5",
"actualvalue": "3000000",
"opportunityid": "2",
"lead_id": "143",
"other": "a:3:{s:8:\"owner_id\";s:0:\"\";s:11:\"lead_source\";N;s:11:\"sales_stage\";s:1:\"1\";}"
}
]
}
Get any opportunity by ID.
HTTP Request
GET /opportunity/ID
Response
Expected Response Code: 200
Get All Opportunity
curl --request GET \
--url https://xxxxxxxx-ma.aritic.com/api/opportunity/all \
--header 'Authorization: Basic qwerty46bWF1dGlj' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/api/opportunity/all');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic qwerty46bWF1dGlj'
));
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/opportunity/all")
.get()
.addHeader("Authorization", "Basic qwerty46bWF1dGlj")
.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/opportunity/all")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic qwerty46bWF1dGlj'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxxx-ma.aritic.com/api/opportunity/all",
"method": "GET",
"headers": {
"Authorization": "Basic qwerty46bWF1dGlj",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma.aritic.com")
headers = {
'Authorization': "Basic qwerty46bWF1dGlj",
'Cache-Control': "no-cache"
}
conn.request("GET", "api,opportunity,all", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"opportunity": [
{
"id": "2",
"actualvalue": "20000",
"createdon": "2018-09-05 14:20:06",
"emailaddress": "test@amazon.com",
"estimatedvalue": "10000",
"modifiedon": "2018-10-03 14:20:06",
"opportunityid": "1",
"salesstage": "1",
"lead_id": "138",
"opportunityAlias": "test1",
"company": "Amazon"
},
{
"id": "3",
"lead_id": "139"
},
{
"id": "4",
"lead_id": "140"
},
{
"id": "5",
"actualvalue": "3000000",
"opportunityid": "2",
"lead_id": "143",
"other": "a:3:{s:8:\"owner_id\";s:0:\"\";s:11:\"lead_source\";N;s:11:\"sales_stage\";s:1:\"1\";}"
}
]
}
Get all opportunities list.
HTTP Request
GET /opportunity/all
Response
Expected Response Code: 200
Get Opportunity Fields
curl --request GET \
--url https://xxxxxxxx-ma.aritic.com/api/opportunity/fields \
--header 'Authorization: Basic qwerty46bWF1dGlj' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/api/opportunity/fields');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic qwerty46bWF1dGlj'
));
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/opportunity/fields")
.get()
.addHeader("Authorization", "Basic qwerty46bWF1dGlj")
.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/opportunity/fields")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic qwerty46bWF1dGlj'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxxx-ma.aritic.com/api/opportunity/fields",
"method": "GET",
"headers": {
"Authorization": "Basic qwerty46bWF1dGlj",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma.aritic.com")
headers = {
'Authorization': "Basic qwerty46bWF1dGlj",
'Cache-Control': "no-cache"
}
conn.request("GET", "api,opportunity,fields", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"oopportunityId": {
"alias": "opportunityId"
},
"company": {
"alias": "company"
},
"opportunityAlias": {
"alias": "opportunityAlias"
},
"createdOn": {
"alias": "createdOn"
},
"amount": {
"alias": "amount"
},
"closeDate": {
"alias": "closeDate"
},
"currency": {
"alias": "currency"
},
"stepName": {
"alias": "stepName"
},
"modifiedOn": {
"alias": "modifiedOn"
},
"ownerEmail": {
"alias": "ownerEmail"
},
"salesStage": {
"alias": "salesStage"
},
"email": {
"alias": "email"
},
"analyticSource": {
"alias": "analyticSource"
}
}
Get all the opportunity fields.
HTTP Request
GET /opportunity/fields
Response
Expected Response Code: 200
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 (Rest Api)
Use this endpoint to obtain details on Aritic’s webhooks.
Get Webhook
Get an individual webhook by ID.
curl -X GET \
https://xxxxxxx.aritic.com/ma/api/hooks/78 \
-H 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
-H 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx.aritic.com/ma/api/hooks/78');
$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://xxxxxx.aritic.com/ma/api/hooks/78")
.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://xxxxxxx.aritic.com/ma/api/hooks/78")
http = Net::HTTP.new(url.host, url.port)
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.HTTPConnection("xxxxxx,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'cache-control': "no-cache"
}
conn.request("GET", "ma,api,hooks,78", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx.aritic.com/ma/api/hooks/78",
"method": "GET",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"hook": {
"isPublished": true,
"dateAdded": "2019-02-27T17:49:14+02:00",
"dateModified": "2019-02-28T07:18:07+02:00",
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": " ",
"id": 78,
"name": "TestHook",
"description": "test to see the format of post data",
"webhookUrl": "https://xxxxxxx.aritic.com",
"eventsOrderbyDir": "",
"category": null,
"triggers": [
"aritic.email_on_open"
]
}
}
HTTP Request
GET /hooks/ID
Response
Expected Response Code: 200
See JSON code example.
Webhook Properties
Name | Type | Description |
---|---|---|
id | int | ID of the webhook |
name | string | Title of the webhook |
description | string | Description of the webhook |
webhookUrl | string | Url to send the webhook payload to |
eventsOrderbyDir | Order direction for queued events in one webhook. Can be “DESC” or “ASC” | |
isPublished | bool | Published state |
publishUp | datetime/null | Date/time when the webhook should be published |
publishDown | datetime/null | Date/time the webhook should be un published |
dateAdded | datetime | Date/time webhook was created |
createdBy | int | ID of the user that created the webhook |
createdByUser | string | Name of the user that created the webhook |
dateModified | datetime/null | Date/time webhook was last modified |
modifiedBy | int | ID of the user that last modified the webhook |
modifiedByUser | string | Name of the user that last modified the webhook |
category | null/object | Category |
triggers | array | List of triggers available in Aritic |
List Webhooks
List all the webhooks.
curl -X GET \
https://xxxxxxx.aritic.com/ma/api/hooks \
-H 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
-H 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx.aritic.com/ma/api/hooks');
$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;
}
import http.client
conn = http.client.HTTPConnection("xxxxxxx,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'cache-control': "no-cache"
}
conn.request("GET", "ma,api,hooks", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx.aritic.com/ma/api/hooks")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx.aritic.com/ma/api/hooks")
.get()
.addHeader("Authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx.aritic.com/ma/api/hooks",
"method": "GET",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"total": 1,
"hooks": {
"1": {
"isPublished": false,
"dateAdded": "2017-11-12T11:47:50+02:00",
"dateModified": "2018-03-08T15:34:29+02:00",
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": 11,
"modifiedByUser": "Ravi Shah",
"id": 1,
"name": "AriticBot",
"description": "Sending to AriticChat",
"webhookUrl": "https://xxxxxxxx.xxxxx.com",
"eventsOrderbyDir": null,
"category": null,
"triggers": [
"aritic.lead_post_delete",
"aritic.form_on_submit",
"aritic.lead_post_save_new"
]
}
}
}
HTTP Request
GET /hooks
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 Webhook .
Create Webhook
Create a new webhook.
curl -X POST \
https://xxxxxxxx.aritic.com/ma/api/hooks/new \
-H 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
-H 'cache-control: no-cache' \
-d '{
"name":"Test Webhook",
"description":"This is my test webhook",
"webhookUrl":"https://example.com",
"ispublished":"true"
}'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx.aritic.com/ma/api/hooks/new');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert',
'Content-Type' => 'application/json'
));
$request->setBody('{
"name":"Test Webhook",
"description":"This is my test webhook",
"webhookUrl":"https://example.com",
"ispublished":"true"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://xxxxxxxx.aritic.com/ma/api/hooks/new")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["cache-control"] = 'no-cache'
request.body = "{\n\t\"name\":\"Test Webhook\",\n\t\"description\":\"This is my test webhook\",\n\t\"webhookUrl\":\"https://example.com\",\n\t\"ispublished\":\"true\"\n}"
response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"name\":\"Test Webhook\",\n\t\"description\":\"This is my test webhook\",\n\t\"webhookUrl\":\"https://example.com\",\n\t\"ispublished\":\"true\"\n}");
Request request = new Request.Builder()
.url("https://xxxxxx.aritic.com/ma/api/hooks/new")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx.aritic.com/ma/api/hooks/new",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"cache-control": "no-cache"
},
"processData": false,
"data": "{\n\t\"name\":\"Test Webhook\",\n\t\"description\":\"This is my test webhook\",\n\t\"webhookUrl\":\"https://example.com\",\n\t\"ispublished\":\"true\"\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Request -
{
"name":"Test Webhook",
"description":"This is my test webhook",
"webhookUrl":"https://example.com",
"ispublished":"true"
}
Response -
{
"hook": {
"isPublished": true,
"dateAdded": "2019-05-20T15:28:08+03:00",
"dateModified": null,
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": null,
"id": 81,
"name": "Test Webhook",
"description": "This is my test webhook",
"webhookUrl": "https://example.com",
"eventsOrderbyDir": "",
"category": null,
"triggers": []
}
}
HTTP Request
POST /hooks/new
Post Parameters
Name | Type | Description |
---|---|---|
id | int | ID of the webhook |
name | string | Title of the webhook |
description | string | Description of the webhook |
webhookUrl | string | URL to send the webhook payload to |
eventsOrderbyDir | Order direction for queued events in one webhook. Can be “DESC” or “ASC” | |
isPublished | bool | Published state |
Response
Expected Response Code: 201
Properties
Same as Get Webhook.
Edit Webhook
Edit a new webhook. Note that this supports PUT or PATCH depending on the desired behavior.
PUT creates a webhook if the given ID does not exist and clears all the webhook information, adds the information from the request.PATCH fails if the webhook with the given ID does not exist and updates the webhook field values with the values form the request.
curl -X PATCH \
https://xxxxxxx.aritic.com/ma/api/hooks/81/edit \
-H 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
-H 'cache-control: no-cache' \
-d '{
"description":"New Test webhook description",
"triggers":["aritic.form_on_submit","aritic.lead_post_save_new"]
}'
<?php
HttpRequest::methodRegister('PATCH');
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx.aritic.com/ma/api/hooks/81/edit');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'Authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert',
'Content-Type' => 'application/json'
));
$request->setBody('{
"description":"New Test webhook description",
"triggers":["aritic.form_on_submit","aritic.lead_post_save_new"]
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
import http.client
conn = http.client.HTTPConnection("xxxxxx,aritic,com")
payload = "{\n\t\"description\":\"New Test webhook description\",\n\t\"triggers\":[\"aritic.form_on_submit\",\"aritic.lead_post_save_new\"]\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'cache-control': "no-cache"
}
conn.request("PATCH", "ma,api,hooks,81,edit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://xxxxxxxx.aritic.com/ma/api/hooks/81/edit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["cache-control"] = 'no-cache'
request.body = "{\n\t\"description\":\"New Test webhook description\",\n\t\"triggers\":[\"aritic.form_on_submit\",\"aritic.lead_post_save_new\"]\n}"
response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"description\":\"New Test webhook description\",\n\t\"triggers\":[\"aritic.form_on_submit\",\"aritic.lead_post_save_new\"]\n}");
Request request = new Request.Builder()
.url("https://xxxxxxx.aritic.com/ma/api/hooks/81/edit")
.patch(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx.aritic.com/ma/api/hooks/81/edit",
"method": "PATCH",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"cache-control": "no-cache"
},
"processData": false,
"data": "{\n\t\"description\":\"New Test webhook description\",\n\t\"triggers\":[\"aritic.form_on_submit\",\"aritic.lead_post_save_new\"]\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Request -
{
"description":"New Test webhook description",
"triggers":["aritic.form_on_submit","aritic.lead_post_save_new"]
}
Response -
{
"hook": {
"isPublished": true,
"dateAdded": "2019-09-20T15:28:08+03:00",
"dateModified": "2019-09-20T15:45:49+03:00",
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": 1,
"modifiedByUser": "Arul Raj",
"id": 81,
"name": "Test Webhook",
"description": "New Test webhook description",
"webhookUrl": "https://example.com",
"eventsOrderbyDir": "",
"category": null,
"triggers": [
"aritic.form_on_submit",
"aritic.lead_post_save_new"
]
}
}
HTTP Request
To edit a webhook and return a 404 if the webhook is not found:
PATCH /hooks/ID/edit
To edit a webhook and create a new one if the webhook is not found:
PUT /hooks/ID/edit
Post Parameters
Name | Type | Description |
---|---|---|
id | int | ID of the webhook |
name | string | Title of the webhook |
description | string | Description of the webhook |
webhookUrl | string | Url to send the webhook payload to |
eventsOrderbyDir | Order direction for queued events in one webhook. Can be “DESC” or “ASC” | |
isPublished | bool | Published state |
Response
If PUT
, the expected response code is 200
if the webhook was edited or 201
if created.
If PATCH
, the expected response code is 200
.
Properties
Same as Get Webhook.
Delete Webhook
Delete a webhook.
curl -X DELETE \
https://xxxxxxx.aritic.com/ma/api/hooks/81/delete \
-H 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
-H 'cache-control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx.aritic.com/ma/api/hooks/81/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;
}
import http.client
conn = http.client.HTTPConnection("xxxxxxxx,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'cache-control': "no-cache"
}
conn.request("DELETE", "ma,api,hooks,81,delete", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx.aritic.com/ma/api/hooks/81/delete")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["User-Agent"] = 'PostmanRuntime/7.17.1'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxxx.aritic.com/ma/api/hooks/81/delete")
.delete(null)
.addHeader("Authorization", "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx.aritic.com/ma/api/hooks/81/delete",
"method": "DELETE",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"hook": {
"isPublished": true,
"dateAdded": "2019-09-20T15:28:08+03:00",
"dateModified": "2019-09-20T15:45:49+03:00",
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": 1,
"modifiedByUser": "Arul Raj",
"id": null,
"name": "Test Webhook",
"description": "New Test webhook description",
"webhookUrl": "https://example.com",
"eventsOrderbyDir": "",
"category": null,
"triggers": [
"aritic.form_on_submit",
"aritic.lead_post_save_new"
]
}
}
HTTP Request
DELETE /hooks/ID/delete
Response
Expected Response Code: 200
Same as Get Webhook.
List All Available Webhook Triggers
List webhook triggers
HTTP Request
GET /hooks/triggers
Response
Expected Response Code: 200
Webhooks (Application based)
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&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.
Ticket Stage Changed
When a Ticket Stage or Ticket Pipeline changes, the webhook triggers the data to the specified Webhook URL. Check the example JSON Response below:
{
"id": 15,
"dateAdded": "2017-06-13T11:27:07+00:00",
"dateModified": "2017-06-13T11:27:07+00:00",
"objectId": 1233,
"ticketId": 2324,
"oldstage": "old",
"newstage": "new",
"oldpipeline": "old",
"newpipeline": "new"
}
Ticket Status Changed
When a Ticket Status or Ticket Pipeline changes, the webhook triggers the data to the specified Webhook URL. Check the example JSON Response below:
{
"id": 15,
"dateAdded": "2017-06-13T11:27:07+00:00",
"dateModified": "2017-06-13T11:27:07+00:00",
"objectId": 1233,
"ticketId": 2324,
"oldstatus": "old",
"newstatus": "new",
"oldpipeline": "old",
"newpipeline": "new"
}
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.
- A lead submits a Aritic PinPoint form.
- Aritic PinPoint saves the form.
- 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.
- 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.
- Open the settings menu and select Webhooks.
- Create a new webhook.
- 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"
}
}
Emails
Use this endpoint to obtain details, create, update or delete Aritic’s emails.
Get Email
curl --request GET \
--url https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID');
$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/ma/api/emails/ID")
.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/ma/api/emails/ID")
http = Net::HTTP.new(url.host, url.port)
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.HTTPConnection("xxxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("GET", "ma,api,emails,ID", 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/ma/api/emails/1",
"method": "GET",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"email":{
"isPublished":true,
"dateAdded":"2016-10-25T18:51:17+00:00",
"createdBy":1,
"createdByUser":"John Doe",
"dateModified":null,
"modifiedBy":null,
"modifiedByUser":null,
"id":560,
"name":"test",
"subject":"API test email",
"language":"en",
"category":null,
"fromAddress":null,
"fromName":null,
"replyToAddress":null,
"bccAddress":null,
"customHtml":"<h1>Hi there!<\/h1>",
"plainText":null,
"template":null,
"emailType":"list",
"publishUp":null,
"publishDown":null,
"readCount":0,
"sentCount":0,
"revision":1,
"assetAttachments":[],
"variantStartDate":null,
"variantSentCount":0,
"variantReadCount":0,
"variantParent":null,
"variantChildren":[],
"translationParent":null,
"translationChildren":[],
"unsubscribeForm":null,
"dynamicContent":[
{
"tokenName":null,
"content":null,
"filters":[
{
"content":null,
"filters":[
{
"glue":null,
"field":null,
"object":null,
"type":null,
"operator":null,
"display":null,
"filter":null
}
]
}
]
}
],
"lists":[
{
"createdByUser":"John Doe",
"modifiedByUser":null,
"id":256,
"name":"test",
"alias":"test29",
"description":null
}
]
}
}
Get an individual email by ID.
HTTP Request
GET /emails/ID
Response
Expected Response Code: 200
Name | Type | Description |
---|---|---|
id | int | ID of the email |
name | string | Internal name of the email |
subject | string | Subject of the email |
fromAddress | string | The from email address if it’s different than the one in the Aritic configuration |
fromName | string | The from name if it’s different than the one in the Aritic configuration |
replyToAddress | string | The reply to email address if it’s different than the one in the Aritic configuration |
bccAddress | string | The BCC email address if it’s different than the one in the Aritic configuration |
isPublished | bool | Published state |
publishUp | datetime/null | Date/time when the email should be published |
publishDown | datetime/null | Date/time the email should be un published |
dateAdded | datetime | Date/time email was created |
createdBy | int | ID of the user that created the email |
createdByUser | string | Name of the user that created the email |
dateModified | datetime/null | Date/time email was last modified |
modifiedBy | int | ID of the user that last modified the email |
modifiedByUser | string | Name of the user that last modified the email |
language | string | Language locale of the email |
readCount | int | Total email read count |
sentCount | int | Total email sent count |
revision | int | Email revision |
customHtml | string | The HTML content of the email |
plainText | string | The plain text content of the email |
template | string | The name of the template used as the base for the email |
emailType | string | If it is a segment (former list) email or template email. Possible values are ‘list’ and 'template’ |
translationChildren | array | Array of Page entities for translations of this landing page |
translationParent | object | The parent/main page if this is a translation |
variantSentCount | int | Sent count since variantStartDate |
variantReadCount | int | Read count since variantStartDate |
variantChildren | array | Array of Email entities for variants of this landing email |
variantParent | object | The parent/main email if this is a variant (A/B test) |
variantSettings | array | The properties of the A/B test |
variantStartDate | datetime/null | The date/time the A/B test began |
category | object/null | Category information |
unsubscribeForm | int | Id of the form displayed in the unsubscribe page |
dynamicContent | object | Dynamic content configuration |
lists | array | Array of segment IDs which should be added to the segment email |
assetAttachments | array | asset IDs Array for email attachment |
List Emails
curl --request GET \
--url https://xxxxxxxx-ma.aritic.com/ma/api/emails \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/emails');
$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/ma/api/emails")
.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/ma/api/emails")
http = Net::HTTP.new(url.host, url.port)
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.HTTPConnection("xxxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("GET", "ma,api,emails", 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/ma/api/emails",
"method": "GET",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"total": 1,
"emails": [
{
"isPublished":true,
"dateAdded":"2016-10-25T18:51:17+00:00",
"createdBy":1,
"createdByUser":"John Doe",
"dateModified":null,
"modifiedBy":null,
"modifiedByUser":null,
"id":560,
"name":"test",
"subject":"API test email",
"language":"en",
"category":null,
"fromAddress":null,
"fromName":null,
"replyToAddress":null,
"bccAddress":null,
"customHtml":"<h1>Hi there!<\/h1>",
"plainText":null,
"template":null,
"emailType":"list",
"publishUp":null,
"publishDown":null,
"readCount":0,
"sentCount":0,
"revision":1,
"assetAttachments":[],
"variantStartDate":null,
"variantSentCount":0,
"variantReadCount":0,
"variantParent":null,
"variantChildren":[],
"translationParent":null,
"translationChildren":[],
"unsubscribeForm":null,
"dynamicContent":[
{
"tokenName":null,
"content":null,
"filters":[
{
"content":null,
"filters":[
{
"glue":null,
"field":null,
"object":null,
"type":null,
"operator":null,
"display":null,
"filter":null
}
]
}
]
}
],
"lists":[
{
"createdByUser":"John Doe",
"modifiedByUser":null,
"id":256,
"name":"test",
"alias":"test29",
"description":null
}
]
}
]
}
HTTP Request
GET /emails
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 Email.
Create Email
Create a new email.
curl --request POST \
--url https://xxxxxxxx-ma.aritic.com/ma/api/emails/new \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/json' \
--data '{\n "title": "Email title",\n "name": "Name of Email",\n "description": "This is example Email",\n "subject": "Subject of email",\n "isPublished": 1\n}'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/emails/new');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert',
'Content-Type' => 'application/json'
));
$request->setBody('{
"title": "Email title",
"name": "Name of Email",
"description": "This is example Email",
"subject": "Subject of email",
"isPublished": 1
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"title\": \"Email title\",\n\t\"name\": \"Name of Email\",\n\t\"description\": \"This is example Email\",\n\t\"subject\": \"Subject of email\",\n\t\"isPublished\": 1\n}");
Request request = new Request.Builder()
.url("https://xxxxxxxx-ma.aritic.com/ma/api/emails/new")
.post(body)
.addHeader("Content-Type", "application/json")
.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/ma/api/emails/new")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
request.body = "{\n\t\"title\": \"Email title\",\n\t\"name\": \"Name of Email\",\n\t\"description\": \"This is example Email\",\n\t\"subject\": \"Subject of email\",\n\t\"isPublished\": 1\n}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma,aritic,com")
payload = "{\n\t\"title\": \"Email title\",\n\t\"name\": \"Name of Email\",\n\t\"description\": \"This is example Email\",\n\t\"subject\": \"Subject of email\",\n\t\"isPublished\": 1\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache",
}
conn.request("POST", "ma,api,emails,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/ma/api/emails/new",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxAqwert",
"Cache-Control": "no-cache"
},
"processData": false,
"data": "{\n\t\"title\": \"Email title\",\n\t\"name\": \"Name of Email\",\n\t\"description\": \"This is example Email\",\n\t\"subject\": \"Subject of email\",\n\t\"isPublished\": 1\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"email": {
"isPublished": true,
"dateAdded": "2018-05-18T14:53:54+05:30",
"dateModified": null,
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": null,
"id": 105,
"name": "Name of Email",
"subject": "Subject of email",
"language": "en",
"category": null,
"fromAddress": null,
"fromName": null,
"replyToAddress": null,
"bccAddress": null,
"utmTags": {
"utmSource": null,
"utmMedium": null,
"utmCampaign": null,
"utmContent": null
},
"customHtml": "",
"plainText": null,
"template": null,
"emailType": "template",
"publishUp": null,
"publishDown": null,
"readCount": 0,
"sentCount": 0,
"revision": 1,
"assetAttachments": [],
"variantStartDate": null,
"variantSentCount": 0,
"variantReadCount": 0,
"variantParent": null,
"variantChildren": [],
"translationParent": null,
"translationChildren": null,
"unsubscribeForm": null,
"dynamicContent": [],
"lists": []
}
}
HTTP Request
POST /emails/new
Post Parameters
Name | Type | Description |
---|---|---|
id | int | ID of the email |
name | string | Internal name of the email |
subject | stringl | Subject of the email |
fromAddress | string | The from email address if it’s different than the one in the Aritic configuration |
fromName | string | The from name if it’s different than the one in the Aritic configuration |
replyToAddress | string | The reply to email address if it’s different than the one in the Aritic configuration |
bccAddress | string | The BCC email address if it’s different than the one in the Aritic configuration |
isPublished | bool | Published state |
publishUp | datetime/null | Date/time when the email should be published |
publishDown | datetime/null | Date/time the email should be un published |
language | string Language locale of the email | |
readCount | int | Total email read count |
sentCount | int | Total email sent count |
revision | int | Email revision |
customHtml | strin | The HTML content of the email |
plainText | string | The plain text content of the email |
template | string | The name of the template used as the base for the email |
emailType | string | If it is a segment (former list) email or template email. Possible values are 'list’ and 'template’ |
translationChildren | array | Array of Page entities for translations of this landing page |
translationParent | Object | The parent/main page if this is a translation |
variantSentCount | int | Sent count since variantStartDate |
variantReadCount | int | Read count since variantStartDate |
variantChildren | array | Array of Email entities for variants of this landing email |
variantParent | object | The parent/main email if this is a variant (A/B test) |
variantSettings | array | The properties of the A/B test |
variantStartDate | datetime/null | The date/time the A/B test began |
category | object/null | Category information |
unsubscribeForm | int | Id of the form displayed in the unsubscribe page |
dynamicContent | object | Dynamic content configuration |
lists | array | Array of segment IDs which should be added to the segment email |
Response
Expected Response Code: 201
Properties
Same as Get Email.
Edit Email
curl --request PUT \
--url https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/edit \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/json' \
--data '{\n "name":"Test Email",\n "subject":"Subject of email test"\n}'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/edit');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert',
'Content-Type' => 'application/json'
));
$request->setBody('{
"name":"Test Email",
"subject":"Subject of email test"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"name\":\"Test Email\",\n\t\"subject\":\"Subject of email test\"\n}");
Request request = new Request.Builder()
.url("https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/edit")
.put(body)
.addHeader("Content-Type", "application/json")
.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/ma/api/emails/ID/edit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
request.body = "{\n\t\"name\":\"Test Email\",\n\t\"subject\":\"Subject of email test\"\n}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma,aritic,com")
payload = "{\n\t\"name\":\"Test Email\",\n\t\"subject\":\"Subject of email test\"\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("PUT", "ma,api,emails,ID,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/ma/api/emails/ID/edit",
"method": "PUT",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
"processData": false,
"data": "{\n\t\"name\":\"Test Email\",\n\t\"subject\":\"Subject of email test\"\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Edit a new email. Note that this supports PUT or PATCH depending on the desired behavior.
PUT creates a email if the given ID does not exist and clears all the email information, adds the information from the request. PATCH fails if the email with the given ID does not exist and updates the email field values with the values form the request.
HTTP Request
To edit a email and return a 404 if the email is not found:
PATCH /emails/ID/edit
To edit a email and create a new one if the email is not found:
PUT /emails/ID/edit
Post Parameters
Name | Type | Description |
---|---|---|
id | int | ID of the email |
name | string | Internal name of the email |
subject | stringl | Subject of the email |
fromAddress | string | The from email address if it’s different than the one in the Aritic configuration |
fromName | string | The from name if it’s different than the one in the Aritic configuration |
replyToAddress | string | The reply to email address if it’s different than the one in the Aritic configuration |
bccAddress | string | The BCC email address if it’s different than the one in the Aritic configuration |
isPublished | bool | Published state |
publishUp | datetime/null | Date/time when the email should be published |
publishDown | datetime/null | Date/time the email should be un published |
language | string | Language locale of the email |
readCount | int | Total email read count |
sentCount | int | Total email sent count |
revision | int | Email revision |
customHtml | string | The HTML content of the email |
plainText | string | The plain text content of the email |
template | string | The name of the template used as the base for the email |
emailType | string | If it is a segment (former list) email or template email. Possible values are 'list’ and 'template’ |
translationChildren | array | Array of Page entities for translations of this landing page |
translationParent | object | The parent/main page if this is a translation |
variantSentCount | int | Sent count since variantStartDate |
variantReadCount | int | Read count since variantStartDate |
variantChildren | array | Array of Email entities for variants of this landing email |
variantParent | object | The parent/main email if this is a variant (A/B test) |
variantSettings | array | The properties of the A/B test |
variantStartDate | datetime/null | The date/time the A/B test began |
category | object/null | Category information |
unsubscribeForm | int | Id of the form displayed in the unsubscribe page |
dynamicContent | object | Dynamic content configuration |
lists | array | Array of segment IDs which should be added to the segment email |
Response
If PUT, the expected response code is 200 if the email was edited or 201 if created.
If PATCH, the expected response code is 200.
Properties
Same as Get Email.
Delete Email
curl --request DELETE \
--url https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/delete \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/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/ma/api/emails/ID/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/ma/api/emails/ID/delete")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxAMTIz'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("DELETE", "ma,api,emails,ID,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/ma/api/emails/ID/delete",
"method": "DELETE",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Delete a email.
HTTP Request
DELETE /emails/ID/delete
Response
Expected Response Code: 200
Properties
Same as Get Email.
Send Email to Contact
curl --request POST \
--url https://xxxxxx-ma.aritic.com/ma/api/emails/ID/contact/CONTACT_ID/send \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/contact/CONTACT_ID/send');
$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/ma/api/emails/ID/contact/CONTACT_ID/send")
.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/ma/api/emails/ID/contact/CONTACT_ID/send")
http = Net::HTTP.new(url.host, url.port)
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.HTTPConnection("xxxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("POST", "ma,api,emails,ID,contact,CONTACT_ID,send", 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/ma/api/emails/ID/contact/CONTACT_ID/send",
"method": "POST",
"headers": {
"Authorization": "Basic qqwerEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Send a predefined email to existing contact.
HTTP Request
POST /emails/ID/contact/CONTACT_ID/send
Post Parameters
Name | Type | Description |
---|---|---|
tokens | array | Array of tokens in email |
Response
Expected Response Code: 200
Send Email to Segment
curl --request POST \
--url https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/send \
--header 'Authorization: Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/emails/ID/send');
$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/ma/api/emails/ID/send")
.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/ma/api/emails/ID/send")
http = Net::HTTP.new(url.host, url.port)
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.HTTPConnection("xxxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("POST", "ma,api,emails,ID,send", 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/ma/api/emails/ID/send",
"method": "POST",
"headers": {
"Authorization": "Basic qwertEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Send a segment email to linked segment(s).
HTTP Request
POST /emails/ID/send
Response
Expected Response Code: 200
Users
Use this endpoint to obtain details on Aritic’s users (administrators).
Get User
curl --request GET \
--url https://xxxxxxxx-ma.aritic.com/ma/api/users/10 \
--header 'Authorization: Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache' \
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxxx-ma.aritic.com/ma/api/users/10');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
));
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/ma/api/users/10")
.get()
.addHeader("Authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
require 'uri'
require 'net/http'
url = URI("https://xxxxxxxx-ma.aritic.com/ma/api/users/10")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("xxxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("GET", "ma,api,users,10", 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/ma/api/users/10",
"method": "GET",
"headers": {
"Authorization": "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
{
"user": {
"isPublished": true,
"dateAdded": "2018-03-06T20:44:26+05:30",
"dateModified": null,
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": null,
"id": 10,
"username": "muzzam",
"firstName": "Moazzam",
"lastName": "Ahmad",
"email": "moazzam.ahmad@menariniapac.com",
"position": "Sr Business Manager",
"role": {
"createdByUser": null,
"modifiedByUser": "Arul Raj",
"id": 2,
"name": "Sales Team",
"description": "Has access to sales",
"isAdmin": true,
"rawPermissions": {
"asset:assets": [
"viewown"
],
"asset:categories": [
"view"
],
"campaign:campaigns": [
"view"
],
"campaign:categories": [
"view"
],
"category:categories": [
"view"
],
"channel:categories": [
"view"
],
"channel:messages": [
"viewown"
],
"core:themes": [
"view"
],
"dynamiccontent:categories": [
"view"
],
"dynamiccontent:dynamiccontents": [
"viewown"
],
"email:categories": [
"view"
],
"email:emails": [
"viewown"
],
"focus:categories": [
"view"
],
"focus:items": [
"viewown"
],
"form:categories": [
"view"
],
"form:forms": [
"viewown"
],
"lead:fields": [
"full"
],
"lead:imports": [
"view"
],
"lead:leads": [
"viewown"
],
"lead:lists": [
"viewother"
],
"ariticSocial:categories": [
"view"
],
"ariticSocial:monitoring": [
"view"
],
"ariticSocial:tweets": [
"viewown"
],
"notification:categories": [
"view"
],
"notification:mobile_notifications": [
"viewown"
],
"notification:notifications": [
"viewown"
],
"page:categories": [
"view"
],
"page:pages": [
"viewown"
],
"plugin:plugins": [
"manage"
],
"point:categories": [
"view"
],
"point:points": [
"view"
],
"point:triggers": [
"view"
],
"report:reports": [
"viewown"
],
"sms:categories": [
"view"
],
"sms:smses": [
"viewown"
],
"stage:categories": [
"view"
],
"stage:stages": [
"view"
],
"user:profile": [
"editname"
],
"user:roles": [
"view"
],
"user:users": [
"view"
],
"webhook:categories": [
"view"
],
"webhook:webhooks": [
"viewown"
]
}
},
"timezone": null,
"locale": null,
"lastLogin": "2018-03-06T20:44:49+05:30",
"lastActive": "2018-03-06T20:47:03+05:30",
"onlineStatus": "offline",
"signature": "Best regards, |FROM_NAME|"
}
}
Get an individual user by ID.
HTTP Request
GET /users/ID
Response
Expected Response Code: 200
User 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 |
lastActive | datetime/null | Date/time when the user last active |
modifiedBy | int | ID of the user that last modified the contact |
modifiedByUser | string | Name of the user that last modified the contact |
username | string | Username which can be used for log in to Aritic. |
firstName | string | First Name of the user |
lastName | string | Last Name of the user |
string | Email of the user | |
position | string | User’s position title |
role | array | List of roles of the user |
timezone | string | Timezone of the user |
onlineStatus | string | Online status of the user |
signature | string | Signature of the user which can be used in the emails |
List Contact Users
curl --request GET \
--url https://xxxxxxxxx-ma.aritic.com/ma/api/users \
--header 'Authorization: Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxx-ma.aritic.com/ma/api/users")
.get()
.addHeader("Authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
import http.client
conn = http.client.HTTPConnection("xxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("GET", "ma,api,users", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx-ma.aritic.com/ma/api/users")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx-ma.aritic.com/ma/api/users",
"method": "GET",
"headers": {
"Authorization": "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx-ma.aritic.com/ma/api/users');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
{
"total": 17,
"users": [
{
"isPublished": true,
"dateAdded": "2018-03-06T20:44:26+05:30",
"dateModified": null,
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": null,
"id": 10,
"username": "muzzam",
"firstName": "Moazzam",
"lastName": "Ahmad",
"email": "moazzam.ahmad@menariniapac.com",
"position": "Sr Business Manager",
"role": {
"createdByUser": null,
"modifiedByUser": "Arul Raj",
"id": 2,
"name": "Sales Team",
"description": "Has access to sales",
"isAdmin": true,
"rawPermissions": {
"asset:assets": [
"viewown"
],
"asset:categories": [
"view"
],
"campaign:campaigns": [
"view"
],
"campaign:categories": [
"view"
],
"category:categories": [
"view"
],
"channel:categories": [
"view"
],
"channel:messages": [
"viewown"
],
"core:themes": [
"view"
],
"dynamiccontent:categories": [
"view"
],
"dynamiccontent:dynamiccontents": [
"viewown"
],
"email:categories": [
"view"
],
"email:emails": [
"viewown"
],
"focus:categories": [
"view"
],
"focus:items": [
"viewown"
],
"form:categories": [
"view"
],
"form:forms": [
"viewown"
],
"lead:fields": [
"full"
],
"lead:imports": [
"view"
],
"lead:leads": [
"viewown"
],
"lead:lists": [
"viewother"
],
"ariticSocial:categories": [
"view"
],
"ariticSocial:monitoring": [
"view"
],
"ariticSocial:tweets": [
"viewown"
],
"notification:categories": [
"view"
],
"notification:mobile_notifications": [
"viewown"
],
"notification:notifications": [
"viewown"
],
"page:categories": [
"view"
],
"page:pages": [
"viewown"
],
"plugin:plugins": [
"manage"
],
"point:categories": [
"view"
],
"point:points": [
"view"
],
"point:triggers": [
"view"
],
"report:reports": [
"viewown"
],
"sms:categories": [
"view"
],
"sms:smses": [
"viewown"
],
"stage:categories": [
"view"
],
"stage:stages": [
"view"
],
"user:profile": [
"editname"
],
"user:roles": [
"view"
],
"user:users": [
"view"
],
"webhook:categories": [
"view"
],
"webhook:webhooks": [
"viewown"
]
}
},
"timezone": null,
"locale": null,
"lastLogin": "2018-03-06T20:44:49+05:30",
"lastActive": "2018-03-06T20:47:03+05:30",
"onlineStatus": "offline",
"signature": "Best regards, |FROM_NAME|"
},
...
...
]
}
HTTP Request
GET /users
Response
Expected Response Code: 200
See JSON code example.
User 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 |
lastActive | datetime/null | Date/time when the user last active |
modifiedBy | int | ID of the user that last modified the contact |
modifiedByUser | string | Name of the user that last modified the contact |
username | string | Username which can be used for log in to Aritic. |
firstName | string | First Name of the user |
lastName | string | Last Name of the user |
string | Email of the user | |
position | string | User’s position title |
role | array | List of roles of the user |
timezone | string | Timezone of the user |
onlineStatus | string | Online status of the user |
signature | string | Signature of the user which can be used in the emails |
Create User
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx-ma.aritic.com/ma/api/users/new');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert',
'Content-Type' => 'application/json'
));
$request->setBody('{
"username": "testUser",
"firstName": "Test",
"lastName": "User",
"email": "test@user.com",
"plainPassword":"topPassword",
"role":1
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
curl --request POST \
--url https://xxxxxxx-ma.aritic.com/ma/api/users/new \
--header 'Authorization: Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/json' \
--data '{\n "username": "testUser",\n "firstName": "Test",\n "lastName": "User",\n "email": "test@user.com",\n "plainPassword":"topPassword",\n "role":1\n}'
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx-ma.aritic.com/ma/api/users/new")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
request.body = "{\n\t\"username\": \"testUser\",\n\t\"firstName\": \"Test\",\n\t\"lastName\": \"User\",\n\t\"email\": \"test@user.com\",\n\t\"plainPassword\":\"topPassword\",\n\t\"role\":1\n}"
response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"username\": \"testUser\",\n\t\"firstName\": \"Test\",\n\t\"lastName\": \"User\",\n\t\"email\": \"test@user.com\",\n\t\"plainPassword\":\"topPassword\",\n\t\"role\":1\n}");
Request request = new Request.Builder()
.url("https://xxxxxxx-ma.aritic.com/ma/api/users/new")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx-ma.aritic.com/ma/api/users/new",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
},
"processData": false,
"data": "{\n\t\"username\": \"testUser\",\n\t\"firstName\": \"Test\",\n\t\"lastName\": \"User\",\n\t\"email\": \"test@user.com\",\n\t\"plainPassword\":\"topPassword\",\n\t\"role\":1\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPConnection("xxxxxxx-ma,aritic,com")
payload = "{\n\t\"username\": \"testUser\",\n\t\"firstName\": \"Test\",\n\t\"lastName\": \"User\",\n\t\"email\": \"test@user.com\",\n\t\"plainPassword\":\"topPassword\",\n\t\"role\":1\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("POST", "ma,api,users,new", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
{
"user": {
"isPublished": true,
"dateAdded": "2018-10-06T00:58:18+05:30",
"dateModified": null,
"createdBy": 1,
"createdByUser": "Arul Raj",
"modifiedBy": null,
"modifiedByUser": null,
"id": 18,
"username": "testUser",
"firstName": "Test",
"lastName": "User",
"email": "test@user.com",
"position": null,
"role": {
"createdByUser": null,
"modifiedByUser": "Arul Raj",
"id": 1,
"name": "Administrators",
"description": "Has access to everything.",
"isAdmin": true,
"rawPermissions": {
"api:access": [
"full"
],
"api:clients": [
"view"
],
"asset:assets": [
"viewown"
],
"asset:categories": [
"view"
],
"campaign:campaigns": [
"view"
],
"campaign:categories": [
"view"
],
"category:categories": [
"view"
],
"channel:categories": [
"view"
],
"channel:messages": [
"viewown"
],
"core:themes": [
"view"
],
"dynamiccontent:categories": [
"view"
],
"dynamiccontent:dynamiccontents": [
"viewown"
],
"email:categories": [
"view"
],
"email:emails": [
"viewown"
],
"focus:categories": [
"view"
],
"focus:items": [
"viewown"
],
"form:categories": [
"view"
],
"form:forms": [
"viewown"
],
"lead:fields": [
"full"
],
"lead:imports": [
"view"
],
"lead:leads": [
"viewown"
],
"lead:lists": [
"viewother"
],
"ariticSocial:categories": [
"view"
],
"ariticSocial:monitoring": [
"view"
],
"ariticSocial:tweets": [
"viewown"
],
"notification:categories": [
"view"
],
"notification:mobile_notifications": [
"viewown"
],
"notification:notifications": [
"viewown"
],
"page:categories": [
"view"
],
"page:pages": [
"viewown"
],
"plugin:plugins": [
"manage"
],
"point:categories": [
"view"
],
"point:points": [
"view"
],
"point:triggers": [
"view"
],
"report:reports": [
"viewown"
],
"sms:categories": [
"view"
],
"sms:smses": [
"viewown"
],
"stage:categories": [
"view"
],
"stage:stages": [
"view"
],
"user:profile": [
"editname"
],
"user:roles": [
"view"
],
"user:users": [
"view"
],
"webhook:categories": [
"view"
],
"webhook:webhooks": [
"viewown"
]
}
},
"timezone": null,
"locale": null,
"lastLogin": null,
"lastActive": null,
"onlineStatus": "offline",
"signature": null
}
}
Create a new user.
HTTP Request
POST /users/new
Post Parameters
Name | Description |
---|---|
username | string |
firstName | string |
lastName | string |
string | |
position | string |
role | array |
timezone | string |
onlineStatus | string |
signature | string |
plainPassword | array |
Response
Expected Response Code: 201
Properties
Same as Get User.
Edit User
import http.client
conn = http.client.HTTPConnection("xxxxxxx-ma,aritic,com")
payload = "{\n\t\"lastName\": \"Raj\",\n\t\"firstName\": \"Test\",\n\t\"email\": \"test@user.com\",\n\t\"id\": 18\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("PUT", "ma,api,users,18,edit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"lastName\": \"Raj\",\n\t\"firstName\": \"Test\",\n\t\"email\": \"test@user.com\",\n\t\"id\": 18\n}");
Request request = new Request.Builder()
.url("https://xxxxxxx-ma.aritic.com/ma/api/users/18/edit")
.put(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxx-ma.aritic.com/ma/api/users/18/edit",
"method": "PUT",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
},
"processData": false,
"data": "{\n\t\"lastName\": \"Raj\",\n\t\"firstName\": \"Test\",\n\t\"email\": \"test@user.com\",\n\t\"id\": 18\n}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx-ma.aritic.com/ma/api/users/18/edit")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
request.body = "{\n\t\"lastName\": \"Raj\",\n\t\"firstName\": \"Test\",\n\t\"email\": \"test@user.com\",\n\t\"id\": 18\n}"
response = http.request(request)
puts response.read_body
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx-ma.aritic.com/ma/api/users/18/edit');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert',
'Content-Type' => 'application/json'
));
$request->setBody('{
"lastName": "Raj",
"firstName": "Test",
"email": "test@user.com",
"id": 18
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
curl --request PUT \
--url https://xxxxxxx-ma.aritic.com/ma/api/users/18/edit \
--header 'Authorization: Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/json'
--data '{\n "lastName": "Raj",\n "firstName": "Test",\n "email": "test@user.com",\n "id": 18\n}'
Edit a new user. User that this supports PUT or PATCH depending on the desired behavior.
PUT creates a user if the given ID does not exist and clears all the user information, adds the information from the request. PATCH fails if the user with the given ID does not exist and updates the user field values with the values form the request.
HTTP Request
To edit a user and return a 404 if the user is not found:
PATCH /users/ID/edit
To edit a user and create a new one if the user is not found:
PUT /users/ID/edit
Post Parameters
Name | Description |
---|---|
username | string |
firstName | string |
lastName | string |
string | |
position | string |
role | array |
timezone | string |
signature | string |
Response
If PUT
,the expected response code is 200
if the user was edited or 201
if created.
If PATCH
, the expected response code is 200
.
Properties
Same as Get User.
Delete User
import http.client
conn = http.client.HTTPConnection("xxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("DELETE", "ma,api,users,18,delete", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --request DELETE \
--url https://xxxxxxx-ma.aritic.com/ma/api/users/18/delete \
--header 'Authorization: Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx-ma.aritic.com/ma/api/users/18/delete');
$request->setMethod(HTTP_METH_DELETE);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxxx-ma.aritic.com/ma/api/users/18/delete")
.delete(null)
.addHeader("Authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx-ma.aritic.com/ma/api/users/18/delete",
"method": "DELETE",
"headers": {
"Authorization": "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx-ma.aritic.com/ma/api/users/18/delete")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
Delete a user.
HTTP Request
DELETE /users/ID/delete
Response
Expected Response Code: 200
Properties
Same as Get User.
Get Self User
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx-ma.aritic.com/ma/api/users/self")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_bodyrequire 'uri'
require 'net/http'
url = URI("https://xxxxxxx-ma.aritic.com/ma/api/users/self")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
curl --request GET \
--url https://xxxxxxx-ma.aritic.com/ma/api/users/self \
--header 'Authorization: Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxxx-ma.aritic.com/ma/api/users/self")
.get()
.addHeader("Authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx-ma.aritic.com/ma/api/users/self",
"method": "GET",
"headers": {
"Authorization": "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache",
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPConnection("xxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache",
}
conn.request("GET", "ma,api,users,self", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx-ma.aritic.com/ma/api/users/self');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
{
"isPublished": true,
"dateModified": "2018-02-21T19:13:44+05:30",
"modifiedBy": 1,
"modifiedByUser": "Arul Raj",
"id": 1,
"username": "arul",
"firstName": "Arul",
"lastName": "Raj",
"email": "arul@dataaegis.com",
"role": {
"isPublished": true,
"dateModified": "2018-01-03T00:07:09+05:30",
"modifiedBy": 1,
"modifiedByUser": "Arul Raj",
"id": 1,
"name": "Administrators",
"description": "Has access to everything.",
"isAdmin": true,
"rawPermissions": {
"api:access": [
"full"
],
"api:clients": [
"view"
],
"asset:assets": [
"viewown"
],
"asset:categories": [
"view"
],
"campaign:campaigns": [
"view"
],
"campaign:categories": [
"view"
],
"category:categories": [
"view"
],
"channel:categories": [
"view"
],
"channel:messages": [
"viewown"
],
"core:themes": [
"view"
],
"dynamiccontent:categories": [
"view"
],
"dynamiccontent:dynamiccontents": [
"viewown"
],
"email:categories": [
"view"
],
"email:emails": [
"viewown"
],
"focus:categories": [
"view"
],
"focus:items": [
"viewown"
],
"form:categories": [
"view"
],
"form:forms": [
"viewown"
],
"lead:fields": [
"full"
],
"lead:imports": [
"view"
],
"lead:leads": [
"viewown"
],
"lead:lists": [
"viewother"
],
"ariticSocial:categories": [
"view"
],
"ariticSocial:monitoring": [
"view"
],
"ariticSocial:tweets": [
"viewown"
],
"notification:categories": [
"view"
],
"notification:mobile_notifications": [
"viewown"
],
"notification:notifications": [
"viewown"
],
"page:categories": [
"view"
],
"page:pages": [
"viewown"
],
"plugin:plugins": [
"manage"
],
"point:categories": [
"view"
],
"point:points": [
"view"
],
"point:triggers": [
"view"
],
"report:reports": [
"viewown"
],
"sms:categories": [
"view"
],
"sms:smses": [
"viewown"
],
"stage:categories": [
"view"
],
"stage:stages": [
"view"
],
"user:profile": [
"editname"
],
"user:roles": [
"view"
],
"user:users": [
"view"
],
"webhook:categories": [
"view"
],
"webhook:webhooks": [
"viewown"
]
}
},
"timezone": "Asia/Kolkata",
"locale": "en_US",
"lastLogin": "2018-10-05T22:50:06+05:30",
"lastActive": "2018-10-06T01:07:54+05:30",
"onlineStatus": "online",
"signature": "Best regards, |FROM_NAME|"
}
Get a self user.
HTTP Request
GET /users/self
Response
Expected Response Code: 200
Properties
Same as Get User.
Check User Permissions
<?php
$request = new HttpRequest();
$request->setUrl('https://xxxxxxx-ma.aritic.com/ma/api/users/7/permissioncheck');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
'Cache-Control' => 'no-cache',
'Authorization' => 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
curl --request GET \
--url https://xxxxxxx-ma.aritic.com/ma/api/users/7/permissioncheck \
--header 'Authorization: Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert' \
--header 'Cache-Control: no-cache'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://xxxxxxx-ma.aritic.com/ma/api/users/7/permissioncheck")
.get()
.addHeader("Authorization", "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert")
.addHeader("Cache-Control", "no-cache")
.build();
Response response = client.newCall(request).execute();
var settings = {
"async": true,
"crossDomain": true,
"url": "https://xxxxxxx-ma.aritic.com/ma/api/users/7/permissioncheck",
"method": "GET",
"headers": {
"Authorization": "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
"Cache-Control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
require 'uri'
require 'net/http'
url = URI("https://xxxxxxx-ma.aritic.com/ma/api/users/7/permissioncheck")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert'
request["Cache-Control"] = 'no-cache'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPConnection("xxxxxxx-ma,aritic,com")
headers = {
'Authorization': "Basic YXJ1bEBkYXRhYWVnaXMuY29tOmFydWxqwert",
'Cache-Control': "no-cache"
}
conn.request("GET", "ma,api,users,7,permissioncheck", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HTTP Request
GET /users/ID/permissioncheck
Response
Expected Response Code: 200 json { "user:users:create":true, "user:users:edit":true }
Properties
array of requested permissions of string in case of just one
Recommendation
Purchase Event
The UR takes in potentially many events. These should be seen as a primary event, which is a very clear indication of a user preference and secondary events that we think may tell us something about user "taste" in some way. The Universal Recommender is built on a distributed Correlated Cross-Occurrence (CCO) Engine, which basically means that it will test every secondary event to make sure that it actually correlates to the primary one and those that do not correlate will have little or no effect on recommendations (though they will make it longer to train and get query results). See ActionML's for methods to test event predictiveness.
Events in PredicitonIO are sent to the EventSever in the following form:(check the code under json on the right side)
{
"event" : "purchase",
"entityType" : "user",
"entityId" : "1243617",
"targetEntityType" : "item",
"targetEntityId" : "iPad",
"properties" : {},
"eventTime" : "2015-10-05T21:02:49.228Z"
}
Rules for usage events (non -reserved events like $set) are:
Element | Description |
---|---|
event | The value must be one the the "eventName" array in engine.json |
entityType | This is always "user", do not use any other type for usage events. |
entityId | This is whatever string you use to identify a user. |
targetEntityType | This is always "item", do not use any other type for usage events. |
targetEntityId | The id for items that correspond to the "eventName". May be a product-id, category-id, a tag-id, anything that the event was connected with. |
properties | Always empty and can be omitted for input but if you export the EventServer it will be output as blank. |
eventTime | The ISO8601 formatted string for the time the event occurred |
This is what a "purchase" event looks like. Note that a usage event always is from a user and has a user id. Also the "targetEntityType" is always "item". The actual target entity is implied by the event's "name".
Preference
To create a "category-preference" event you would send something like this:(check json on the right)
{
"event" : "category-preference",
"entityType" : "user",
"entityId" : "1243617",
"targetEntityType" : "item",
"targetEntityId" : "electronics",
"properties" : {},
"eventTime" : "2015-10-05T21:02:49.228Z"
}
This event would be sent when the user clicked on the "electronics" category or perhaps purchased an item that was in the "electronics" category. Note again that the "targetEntityType" is always "item".
Fetch Recommendation
Query fields determine what data is used to match when returning recommendations. Some fields have default values in engine.json and so may never be needed in individual queries. On the other hand all values from engine.json may be overridden or added to in an individual query. The only requirement is that there must be a user or item in every query.
Check sample under json on the right side
{
"user": "xyz",
"userBias": -maxFloat..maxFloat,
"item": "53454543513",
"itemBias": -maxFloat..maxFloat,
"itemSet": ["cd53454543513", "lg1", "vf23423432", "af87634"],
"itemSetBias": -maxFloat..maxFloat,
"from": 0,
"num": 4,
"fields": [
{
"name": "fieldname"
"values": ["fieldValue1", ...],
"bias": -maxFloat..maxFloat
},...
]
"dateRange": {
"name": "dateFieldname",
"before": "2015-09-15T11:28:45.114-07:00",
"after": "2015-08-15T11:28:45.114-07:00"
},
"currentDate": "2015-08-15T11:28:45.114-07:00",
"blacklistItems": ["itemId1", "itemId2", ...]
"returnSelf": true | false,
}
Element | Description |
---|---|
user | optional, contains a unique id for the user. This may be a user not in the training: data, so a new or anonymous user who has an anonymous id. All user history captured in near realtime can be used to influence recommendations, there is no need to retrain to enable this. |
userBias | optional (use with great care), the amount to favor the user's history in making recommendations. The user may be anonymous as long as the id is unique from any authenticated user. This tells the recommender to return recommendations based on the user's event history. Used for personalized recommendations. Overrides and bias in engine.json. |
item | optional, contains the unique item identifier |
itemBias | optional (use with great care), the amount to favor similar items in making recommendations. This tells the recommender to return items similar to this the item specified. Use for "people who liked this also liked these". Overrides any bias in engine.json |
itemSet | optional, contains a list of unique item identifiers |
itemBias | optional (use with great care), the amount to favor itemSets in making recommendations. Mixing itemSet queries with user and item queries is not recommended and it is difficult to predict what it will return in the final mixed results. |
fields | optional, array of fields values and biases to use in this query such as name,values,bias |
from | optional rank/position to start returning recommendations from. Used in pagination. The rank/position is 0 based, 0 being the highest rank/position. Default: 0, since 0 is the first or top recommendation. Unless you are paginating skip this param. |
num | optional max number of recommendations to return. There is no guarantee that this number will be returned for every query. Adding backfill in the engine.json will make it much more likely to return this number of recommendations. |
blacklistItems | optional. Unlike the engine.json, which specifies event types this part of the query specifies individual items to remove from returned recommendations. It can be used to remove duplicates when items are already shown in a specific context. This is called anti-flood in recommender use. |
dateRange | optional, default is not range filter. One of the bound can be omitted but not both. Values for the before and after are strings in ISO 8601 format. Overrides the currentDate if both are in the query. |
currentDate | optional, must be specified if used. If dateRange is included then currentDate is ignored. |
returnSelf | optional boolean asking to include the item that was part of the query (if there was one) as part of the results. Defaults to false. |
Ecommerce Tracking
Advanced: How to manually configure Ecommerce Tracking (For Developers)
If your website isn’t powered by a content management system or ecommerce platform that integrates with Aritic, then it may need to be manually integrated. You can manually integrate Aritic with any cart software by adding snippets of JavaScript code to your checkout process. The code, described below, sends your user’s shopping cart data to Aritic to track key actions for your analytics. There are several categories of actions that you will need to integrate for a full Ecommerce tracking setup within Aritic:
1.Product Views (Optional) :
This enables per-product conversion rates.
2.Cart Updates (Optional) :
This enables tracking abandoned cart statistics.
3.Order Updates (Required) :
This is a required component of Ecommerce tracking.
Advanced: Manually Tracking Ecommerce Actions in Aritic
Tracking Product Views in Aritic (Optional)
By default, Aritic can let you know your conversion rate for your website as a whole. Additionally you can track how many people have visited a page where your product is available for sale. Then Aritic will automatically calculate a product conversion rate for each product.
Collecting product and category specific conversion rates can be helpful to identify where certain products may not have enough information, or where specific product categories are under-performing on your site.
There is one JavaScript method for pushing both products and category view data to Aritic, and that is 'setEcommerceView'. The only difference between tracking products and categories is which parameters are attached to the call. For both, you will also need to make sure that you include a 'trackPageView' call. You can find more details and examples for both below.
Tracking Product Views in Aritic
The following parameters are recommended for tracking product views:
1.productSKU(Required) :
String – A unique product identifier.
2.productName (Required) :
String – The name of the product.
3.categoryName(Optional) :
String/Array – This is either the category name passed as a string, or up to five unique categories as an array, e.g. ["Books", "New Releases", "Technology"]
4.price (Optional):
Integer/Float – The cost of the item.
Example Product View Snippet
Push Product View Data to Matomo - Populate parameters dynamically
Tracking Category Views in Aritic
The following parameters are required and recommended for tracking a category pageviews (not a product page):
1.productSKU :
Boolean – This should be equal to false.
2.productName :
Boolean – This should be equal to false.
3.categoryName(Required) :
String/Array – This is either the category name passed as a string, or up to five unique categories as an array, e.g. ["Books", "New Releases", "Technology"]
Example Category View Snippet
Push Category View Data to Matomo - Populate Category dynamically
Tracking Cart Updates in Aritic (Optional)
To track cart additions and removals, your cart system will need to send the details for every item that remains in the cart after a user adds or removes an item, including those already submitted from prior Add to Cart clicks. This is important to collect accurate information for the abandoned cart feature within Aritic. The data should be included within a “push”, which is the function that enables sending of structured data to Aritic via JavaScript. You will also need to supply the total value of all items in the cart. so the two required elements for cart tracking are:
- A push of 'addEcommerceItem' for each product currently in the cart, including the name and SKU at a minimum.
- A final 'trackEcommerceCartUpdate' push with the cart total passed as a parameter.
Example Product Cart Update
Each item processed as part of the cart update can contain the following parameters but must include the name and SKU at a minimum.
1.productSKU(Required) :
String – A unique product identifier.
2.productName (Recommended) :
String – The name of the product.
3.categoryName(Optional) :
String/Array – This is either the category name passed as a string, or up to five unique categories as an array, e.g. ["Books", "New Releases", "Technology"]
4.price (Optional) :
Integer/Float – The cost of the item.
5.quantity(Optional) :
Integer – How many of this item are in the cart. Defaults to 1.
The snippet below contains example data in the format required by Aritic. All of the parameters should be dynamically filled by your ecommerce platform.
// An addEcommerceItem push should be generated for each cart item, even the products not updated by the current "Add to cart" click.
Tracking Orders to Aritic (Required)
Tracking orders is the minimum required configuration for a successful ecommerce tracking implementation. Order metrics are likely to be the most valuable for any ecommerce store, so you need to make sure that you set up order tracking correctly.
There are two main elements required to push an ecommerce purchase to Aritic: 1. Product details for each product purchased, containing the Product SKU at a minimum. 2. Order details; containing a unique order ID and the total revenue at a minimum.
The order is typically tracked on the order confirmation page after payment has been confirmed.
Example of Adding a Product to the order
The snippet below contains example data in the format required by Aritic. All of the parameters, which are shown within double quotation marks, should be dynamically filled by your ecommerce platform.
1.productSKU(Required) :
String – A unique product identifier.
2.productName (Recommended) :
String – The name of the product.
3.productCategory(Optional) :
String/Array – This is either the category name passed as a string, or up to five unique categories as an array, e.g. ["Books", "New Releases", "Technology"]
4.price (Optional) :
Integer/Float – The cost of the item.
5.quantity(Optional) :
Integer – How many of this item are in the order. Defaults to 1. Defaults to 1.
Example of Tracking the Ecommerce Order
The second part of the order update code passed to Aritic is a summary of the order. At a minimum, it should include an order ID and the total revenue value. The variables passed, in order, are:
1.orderId(Required) :
String – A unique reference number to avoid duplication.
2.revenue (Required) :
Integer/Float – The order total including tax & shipping with any discounts subtracted.
3.subTotal (Optional) :
Integer/Float – The order total excluding shipping.
4.tax (Optional) :
Integer/Float -The amount of tax charged.
5.shipping (Optional) :
Integer/Float – The amount charged for shipping.
6.discount (Optional) :
Integer/Float/Boolean – Discount offered? Default to false. Otherwise, you should include a numeric value.
The Code Example:
// Order Array - Parameters should be generated dynamically
Developer Warning: Currency Variables must be passed as an Integer or Float
The following currency parameters must be supplied as integers or floats, not as strings:
1.addEcommerceItem() Parameters:
- Price
2.trackEcommerceOrder() Parameters:
- grandTotal
- subTotal
- tax
- shipping
- discount
For example, all the following values are not valid currency variables:
- “5.3$”
- “EUR5.3”
- “5,4”
- “5.4”
- “5.44”
The following values are valid currency variables:
- 5
- 5.3
- 5.44
If your Ecommerce software provides the values as string only, you can call the Javascript function parseFloat() to convert the values into a valid format. First make sure the string you want to work with does not contain currency symbols or other characters, for example “554.30”. You can then pass that value through the function as shown:
parseFloat("554.30");
Other JavaScript functions that you may find useful
The following options may be useful especially when your Ecommerce shop is a Single Page App:
- removeEcommerceItem(productSKU) – This removes a product from the order by SKU. You still need to call trackEcommerceCartUpdate to record the updated cart in Aritic.
- clearEcommerceCart() – This clears the order completely. You still need to call trackEcommerceCartUpdate to record the updated cart in Aritic.
- getEcommerceItems() – Returns all ecommerce items currently in the untracked ecommerce order. The returned array will be a copy, so changing it won’t affect the ecommerce order. To affect what gets tracked, use the addEcommerceItem()/removeEcommerceItem()/clearEcommerceCart() methods. Use this method to see what will be tracked before you track an order or cart update.