NAV
shell php python

Overview

Sample JSON response from our API
---------------------------------

{
"Header": {

"Status":"Created",
"Code": "201",
"Time": "2018-05-27 15:53:59",
"Endpoint": "addPerson",
"Message":"Contact added"

},

"Data":
{

"PersonID": "0000000000"

}

}

This technical reference is for organizations who would like to connect their account to external applications. Our RESTful API uses a JSON format for both input and output. Requests are validated with unique API tokens that can be generated within the Onpipeline application.

Our API is divided into Resources (Endpoints). Every resource is reachable with its correct name within the HTTP URL.

Any request receives a JSON response. The object is normally made of 2 arrays - Header and Data - but in case of errors you will see only the “Error” array.

The main service URL is:
api.onpipeline.com

Methods:
POST,GET

Please know that only HTTPS connections will be accepted. No data will be returned to non SSL connections. Please make sure all of your connections start with https:// in the URL.

Format specifications:

DATE FORMAT:
YYYY-MM-DD
DATETIME FORMAT:
YYYY-MM-DD HH:MM:SS
NUMBERS:
0.00

Time zone:

Note: We do not provide a developer sandbox.
If you prefer not to develop on your current account (which is recommended in most cases), feel free to start a trial account using a different email address.

Authentication

token = "your-token-here"
url = "https://api.onpipeline.com/ResourceName"

import json, requests

headers = {
'Authorization' : token
}

data = {}
jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()
curl "https://api.onpipeline.com/ResourceName"
-H "Authorization: your-token-here"
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/ResourceName";
/* Call the Resource URL */
$query = array();

$json_query = json_encode($query);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);

if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];

echo "Error: ".$errorcode." - ".$errormess;
exit;
}

//print_r($output);

API requests are validated with your personal API token that shall be passed for each request within the http “Authorization” header.

We expect a header that looks like the following:

Authorization: {Token}

Replace {Token} with your personal API token. A real token will look like:

Authorization: cVCE1ILBD_QR5UeuSM9lA60gdvnz...

A token can be issued within Onpipeline by the admin user and can be with “Read only” or Read and write” permissions. A read only Token will not have access to “write” operations (call to specific resources to add, modify, delete).

OAuth with Onpipeline

Tokens released to 3rd parties (Lead Sources) for saving leads to your Onpipeline account will only have an API access limited to the “LeadsIn” resource. All other Tokens will access the whole account.

Resources

Resources refer to the services offered by our API. Each resource can be contacted sending a post (or get) request to a specific “Enpoint” listed on this website. Any request must always include a JSON formatted body, even if there is no data to send. The response is normally made of 2 arrays (Header and Data). In case of errors you will see only the “Error” array.

Person

Person object - example
-----------------------

{
"PersonID": "1213453823ABC12313121",
"FirstName": "Mike",
"LastName": "Smith",
"OrgID": "9531451823ABC71183121",
"OrgName": "Mike, Inc",
"Fullname": "Mike Smith",
"NextEvent": "2015-05-19 15:30:00",
"DealsOpen": "0",
"DealsWon": "0",
"DealsLost": "0",
"EmailsSent": "0",
"EmailsReceived": "0",
"Source": "User",
"SourceName": "Robert",
"Created": "2015-02-09 12:35:41",

"Email": [
{
"Address":"mike@smith.com",
"Type":"work"
},
{
"Address":"mikes762@server.com",
"Type":"home"
}

],
"Phone": [
{
"Number":"111111111111",
"Type":"work"
},
{
"Number":"222222222222",
"Type":"mobile"
}
],
"Extra": [
{
"ID":"1111111",
"Value":"Managing Director"
}
]
}

Resources to access the person object.

Endpoint Description
PersonList List persons
PersonAdd Create a new contact person
PersonChange Modify a contact person
PersonDelete Delete a contact person

Person object:

Field Description
PersonID ID of the person
FirstName Person First Name
LastName Family Name,
Fullname Contact full name
OrgID Linked organization ID
OrgName Linked organization Name
NextEvent Next calendar event datetime
DealsOpen Open deals linked to person
DealsWon Won deals linked to person
DealsLost Lost deals linked to person
EmailsSent Emails sent to this person
EmailsReceived Email received from person
Source Created by User/API/Form
SourceName Who created the person (Name)
Created When the user was created (Datetime)
Email Emails (array)
Phone Phone numbers (array)
Extra Custom fields (array)

List Persons

curl "https://api.onpipeline.com/PersonList"
-H "Authorization: your-token-here"
-d '{"PersonID":"XXXXXXXXXXXX"}'
token = "your-token-here"
url = "https://api.onpipeline.com/PersonList"

import json, requests

headers = {
'Authorization' : token
}

data = {"PersonID":"XXXXXXXXXXXX"}
jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/PersonList";
/* Call the Resource URL */

$query = array(
"PersonID"=>"XXXXXXXXXXXX",

/*
"Extra" => array(
array("ID" => "00000000000", "Value" => "abc" ),
array("ID" => "00000000000", "Value" => "abc" )
)
*/

);

$json_query = json_encode($query);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);

if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];

echo "Error: ".$errorcode." - ".$errormess;
exit;
}


if($output){
foreach ($output['Data'] as $item){

echo $item['Fullname'].'<br>';
foreach($item['Email'] as $phone){
echo 'Email: '.$phone['Address'].' - '.$phone['Type'].'<br>';
}
foreach($item['Phone'] as $phone){
echo 'Phone: '.$phone['Number'].' - '.$phone['Type'].'<br>';
}

}
}

Endpoint: /PersonList

Available Filters Description
PersonID Person ID
Organization Organization Name
OrganizationID Organization ID
Fullname Full Name
MinCreated Created after a certain datetime
MaxCreated Created before a certain datetime
MinNextEvent Next event after a certain datetime
MaxNextEvent Next event before a certain datetime (last event)
Extra Custom fields (array) more info

Tip: You can get a single person with PersonID or list all person of an organization with OrgID.

Add Person

curl "https://api.onpipeline.com/PersonAdd"
-H "Authorization: your-token-here"
-d '{ "FirstName": "Mike", "LastName": "Smith", "OrgID": "123456789",
"Email":[ { "Address":"mike@company.com", "Type":"work" } ],
"Phone":[ { "Number":"111111111111", "Type":"work" } ],
"Extra":[ { "ID":"1111111", "Value":"Managing Director" } ] }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/PersonAdd";
/* Call the Resource URL */

$query = array(
"FirstName" => 'Mike',
"LastName" => 'Smith',
"Phone" => array(
array( "Number" => "+1111111111111", "Type"=>"work" ),
array( "Number" => "+2222222222222" , "Type"=>"home")
),
"Email" => array(
array( "Address" => "mike@company.com", "Type"=>"other" ),
),
"Extra" => array(
array( "ID" => "000000000000", "Value"=>"Any value" ),
),
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/PersonAdd"

import json, requests

headers = {
'Authorization' : token
}

data = { "FirstName": "Mike", "LastName": "Smith", "OrgID": "123456789",
"Email":[ { "Address":"mike@company.com", "Type":"work" } ],
"Phone":[ { "Number":"111111111111", "Type":"work" } ],
"Extra":[ { "ID":"1111111", "Value":"Managing Director" } ] }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Created",
"Code":"201",
"Time":"0000-00-00 00:00:00",
"Endpoint":"PersonAdd"
},

"Data":{
"PersonID":"123456789HSY7584306"
}
}

Endpoint: /PersonAdd

Field Description
FirstName * Contact first name
LastName * Contact family/last name
Phone Phone numbers (array)
Type:work/home/mobile/other
Email Email address (array)
Type:work/home/other
OrgID ID of Organization (must be valid)
Extra Custom fields (array), if any

(*) mandatory field

OrgID: It must be be a valid Organization ID. If the organization is new you should first add the Organization and then add the Person with the OrgID generated by the API.

Modify Person

curl "https://api.onpipeline.com/PersonChange"
-H "Authorization: your-token-here"
-d '{ "FirstName": "Mike", "LastName": "Smith", "PersonID": "123456789",
"Email":[ { "Address":"mike@company.com", "Type":"work" } ],
"Phone":[ { "Number":"111111111111", "Type":"work" } ],
"Extra":[ { "ID":"1111111", "Value":"Managing Director" } ] }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/PersonChange";
/* Call the Resource URL */

$query = array(
"PersonID" => '123456789',
"Phone" => array(
array( "Number" => "+1111111111111", "Type"=>"work" ),
array( "Number" => "+2222222222222" , "Type"=>"home")
),
"Email" => array(
array( "Address" => "mike@company.com", "Type"=>"other" ),
),
"Extra" => array(
array( "ID" => "000000000000", "Value"=>"Any value" ),
),
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/PersonChange"

import json, requests

headers = {
'Authorization' : token
}

data = { "PersonID": "123456789",
"Email":[ { "Address":"mike@company.com", "Type":"work" } ],
"Phone":[ { "Number":"111111111111", "Type":"work" } ],
"Extra":[ { "ID":"1111111", "Value":"Managing Director" } ] }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Accepted",
"Code":"202",
"Time":"0000-00-00 00:00:00",
"Endpoint":"PersonChange",
"PersonID":"123456789HSY7584306"
}
}

Endpoint: /PersonChange

Filter Description
PersonID Person ID (mandatory)
Field Description
FirstName Contact first name
LastName Contact family/last name
Phone Phone numbers (array)
Type:work/home/mobile/other
Email Email address (array)
Type:work/home/other
OrgID ID of Organization (must be valid)
Extra Custom fields (array), if any

Please use only the fields you are really updating. If you try to resend the same values (no change made in the content) the API call will be rejeted with error code 406.

Delete Person

curl "https://api.onpipeline.com/PersonDelete"
-H "Authorization: your-token-here"
-d '{ "PersonID": "123456789" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/PersonDelete";
/* Call the Resource URL */

$query = array(
"PersonID" => '123456789HSY7584306'
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/PersonDelete"

import json, requests

headers = {
'Authorization' : token
}

data = { "PersonID": "123456789HSY7584306" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Accepted",
"Code":"202",
"Time":"0000-00-00 00:00:00",
"Endpoint":"PersonDelete",
"PersonID":"123456789HSY7584306"
}
}

Endpoint: /PersonDelete

Filter Description
PersonID Person ID to be deleted

Be careful as this operation is permanent and cannot be undone.

Organization

Organization object - example
-----------------------------

{
"OrgID": "1213453823ABC12313121",
"OrgName": "Onpipeline",
"Address1": "Av Diagonal 458",
"Address2": "",
"Postcode": "08006",
"City": "Barcelona",
"Region": "Barcelona",
"Country": "Spain",
"FullAddress": "Av Diagonal 458, 08006 Barcelona",
"DealsOpen": "0",
"DealsWon": "0",
"DealsLost": "0",
"Source": "API",
"SourceName": "",
"Created": "2015-02-09 12:35:41",

"Extra": [
{
"ID":"1111111",
"Value":"Area1"
}
]
}

Resources to access the organization object.

Endpoint Description
OrgList List organizations
OrgAdd Create a new organization
OrgChange Modify organization
OrgDelete Delete organization

Organization object:

Field Description
OrgID ID of the Organization
OrgName Name of the Organization
Address1 Main address line
Address2 Additional address line (i.e. apt.)
Postcode Postal/ZIP code
City Town or city
Region Region or State
Country Country
FullAddress Complete address field
DealsOpen Open deals linked to Organization
DealsWon Won deals linked to Organization
DealsLost Lost deals linked to Organization
Source Created by User/API/Form
SourceName Who created the person (Name)
Created When the user was created (Datetime)
Extra Custom fields (array)

List Organizations

curl "https://api.onpipeline.com/OrgList"
-H "Authorization: your-token-here"
-d '{"OrgID":"XXXXXXXXXXXX"}'
token = "your-token-here"
url = "https://api.onpipeline.com/OrgList"

import json, requests

headers = {
'Authorization' : token
}

data = {"OrgID":"XXXXXXXXXXXX"}
jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/OrgList";
/* Call the Resource URL */

$query = array(
/*
"Extra" => array(
array("ID" => "00000000000", "Value" => "abc" ),
array("ID" => "00000000000", "Value" => "abc" )
)
*/

);

$json_query = json_encode($query);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);

if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];

echo "Error: ".$errorcode." - ".$errormess;
exit;
}


if($output){
foreach ($output['Data'] as $item){

echo $item['Fullname'].'<br>';
foreach($item['Email'] as $phone){
echo 'Email: '.$phone['Address'].' - '.$phone['Type'].'<br>';
}
foreach($item['Phone'] as $phone){
echo 'Phone: '.$phone['Number'].' - '.$phone['Type'].'<br>';
}

}
}

Endpoint: /OrgList

Available Filters Description
OrgID Organization ID
OrgName Organization Name
Postcode Postal/ZIP code
City City
Region Region or State
Country Country
FullAddress Complete address
MinCreated Created after a certain datetime
MaxCreated Created before a certain datetime
Extra Custom fields (array) more info

Tip: You can get a single organization with OrgID

Add Organization

curl "https://api.onpipeline.com/OrgAdd"
-H "Authorization: your-token-here"
-d '{ "OrgName": "Company_name_here" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/OrgAdd";
/* Call the Resource URL */

$query = array(
"OrgName" => "Company_name_here",
"Address1" => "Main_company_address",
"City" => "Town_or_city",
"Postcode" => "ABC00000",
"Region" => "State_or region",
"Country" => "Any_contry"
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/OrgAdd"

import json, requests

headers = {
'Authorization' : token
}

data = { "OrgName": "Company_name_here" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Created",
"Code":"201",
"Time":"0000-00-00 00:00:00",
"Endpoint":"OrgAdd"
},

"Data":{
"OrgID":"123456789HSY7584306"
}
}

Endpoint: /OrgAdd

Field Description
OrgName * Name of the Organization
Address1 Main address line
Address2 Additional address line (i.e. apt.)
Postcode Postal/ZIP code
City Town or city
Region Region or State
Country Country
Extra Custom fields (array)

(*) mandatory field

If you want the API to check for duplicates, please fill Postcode with a value. The check is made on OrgName and Postcode.

Modify Organization

curl "https://api.onpipeline.com/OrgChange"
-H "Authorization: your-token-here"
-d '{ "OrgID": "123456789HSY7584306" ,"Address1": "change_address_here" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/OrgChange";
/* Call the Resource URL */

$query = array(
"OrgID" => "123456789HSY7584306",
"Address1" => "change_address_here",
"Extra" => array(
array( "ID" => "000000000000", "Value"=>"Any value" ),
),
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/OrgChange"

import json, requests

headers = {
'Authorization' : token
}

data = { "OrgID": "123456789HSY7584306" ,"Address1": "change_address_here" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Accepted",
"Code":"202",
"Time":"0000-00-00 00:00:00",
"Endpoint":"OrgChange",
"OrgID":"123456789HSY7584306"
}
}

Endpoint: /OrgChange

Filter Description
OrgID Organization ID (mandatory)
Field Description
OrgName Name of the Organization
Address1 Main address line
Address2 Additional address line (i.e. apt.)
Postcode Postal/ZIP code
City Town or city
Region Region or State
Country Country
FullAddress Complete address field
Extra Custom fields (array)

Please use only the fields you are really updating. If you try to resend the same values (no change made in the content) the API call will be rejeted with error code 406.

Delete Organization

curl "https://api.onpipeline.com/OrgDelete"
-H "Authorization: your-token-here"
-d '{ "OrgID": "123456789" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/OrgDelete";
/* Call the Resource URL */

$query = array(
"OrgID" => '123456789HSY7584306'
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/OrgDelete"

import json, requests

headers = {
'Authorization' : token
}

data = { "OrgID": "123456789HSY7584306" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Accepted",
"Code":"202",
"Time":"0000-00-00 00:00:00",
"Endpoint":"OrgDelete",
"OrgID":"123456789HSY7584306"
}
}

Endpoint: /OrgDelete

Filter Description
OrgID Organization ID to be deleted

Be careful as this operation is permanent and cannot be undone.

Deals

Deal object - example
-----------------------

{
"DealID": "1213453823ABC12313121",
"DealName": "Company - New Deal",
"Status": "open",
"Value": "1000.00",
"Probability": "50",
"Pipeline": "Sales Pipeline",
"Stage": "Negotiation started",
"OwnerID": "123456789",
"Owner": "Paul",
"LinkedPersonID": "00000000000000",
"LinkedPerson": "Mike Smith",
"LinkedOrgID": "000000000000000",
"LinkedOrg": "Company Inc.",
"Involved":
[
"00000000000000",
"11111111111111"
],
"Created": "2015-05-19 15:30:00",
"CreatedbyID": "0000000000",
"CreatedBy": "Jon Doe",
"ExpClosing": "2015-05-28",
"Closed": "0000-00-00",
"NextEvent": "2015-05-20 11:00:00",
"LastUpdate":"2015-05-19 15:30:00",
"Products": [
"Equipment",
"Food"
],
"LostReason": "",
"Description": "free text",
"EmailsSent": "0",
"EmailsReceived": "0",
"Extra": [
{
"ID":"1111111",
"Value":"Any_Value"
}
]
}

Resources to access the deal object.

Endpoint Description
DealsList List Deals
DealAdd Create a new Deal
DealChange Modify Deal
DealDelete Delete Deal
DealUndelete Undelete a deal

Person object:

Field Description
DealID ID of the deal
DealName Name of the deal
Status Deal status (open/won/lost/deleted)
Value Deal value - decimal 0.00
Probability Integer value (0-100)
Pipeline Linked organization Name
Stage Next calendar event datetime
OwnerID Onwer ID
Owner Onwer Name
LinkedPersonID Linked person ID
LinkedPerson Linked person name
LinkedOrgID Linked organization ID
LinkedOrg Linked organization name
Involved Persons involved (IDs)
Created When the deal was created (Datetime)
CreatedbyID Who created the deal (Id)
CreatedBy Who created the deal (Name)
ExpClosing Expected closing (Date)
Closed When the deal was closed (Date)
NextEvent Next event linked to deal (Datetime)
LastUpdate When the deal was last updated (Datetime)
Products List products linked to deal
Description Deal description
EmailsSent Emails sent to this person
EmailsReceived Email received from person
Extra Custom fields (array)

List Deals

Endpoint: /DealsList

Available Filters Description
DealID Deal ID
Status open/won/lost/deleted
OwnerID Owner (User) ID
LinkedPersonID Linked person ID
LinkedOrgID Linked organization ID
Pipeline Pipeline name
Stage Stage name
MinClosed Closed from a certain date
MaxClosed Closed up to a certain date
MinCreated Created after a certain datetime
MaxCreated Created before a certain datetime
MinNextEvent Next event after a certain datetime
MaxNextEvent Next event before a certain datetime (last event)
Products Single product name search
LostReason Lost reason
Extra Custom fields (array) more info

Tip: You can get a single deal with DealID

Add Deal

curl "https://api.onpipeline.com/DealAdd"
-H "Authorization: your-token-here"
-d '{ "DealName" : "New deal", "PipelineID" : "1",
"StageID" : "1", "OwnerID" : "1", "LinkedPersonID" : "1" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/DealAdd";
/* Call the Resource URL */


$query = array(
"DealName" => "New deal",
"PipelineID" => "1",
"StageID" => "1",
"OwnerID" => "1",
"LinkedPersonID" => "1",
"ExpClosing" => "0000-00-00",
"Value" => "100.000",
"Probability" => "20",
"Products" => array("w","wa"),
"Involved" => array("000000000000","000000000000"),
"Extra" => array(
array("ID"=>"0000000000000","Value"=>"abc"),
)
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/DealAdd"

import json, requests

headers = {
'Authorization' : token
}

data = { "DealName" : "New deal", "PipelineID" : "1",
"StageID" : "1", "OwnerID" : "1", "LinkedPersonID" : "1" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Created",
"Code":"201",
"Time":"0000-00-00 00:00:00",
"Endpoint":"DealAdd"
},

"Data":{
"DealID":"HSY758430698"
}
}

Endpoint: /DealAdd

Field Description
DealName * Name of the new deal
Value Number with 2 decimals, separated by dot (0.00)
Probability Integer number 0-100
PipelineID * Valid Pipeline ID
StageID * Valid stage ID for this Pipeline
OwnerID * User ID owner of the deal
LinkedPersonID Person linked to deal (ID)
LinkedOrgID Organization linked to deal (ID)
Involved Persons (IDs) involved (array)
ExpClosing Expected closing date (YYYY-MM-DD)
Products Product names to be linked (array)
Extra Custom fields (array) more info

(*) mandatory field

Modify Deal

curl "https://api.onpipeline.com/DealChange"
-H "Authorization: your-token-here"
-d '{ "DealID" : "HSY758430698", "Value": "100.00" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/DealChange";
/* Call the Resource URL */


$query = array(
"DealID" => "HSY758430698",
"Value" => "100.00",
"Probability" => "50",
"Extra" => array(
array("ID"=>"447383216","Value"=>"Cold"),
)
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/DealChange"

import json, requests

headers = {
'Authorization' : token
}

data = { "DealID" : "HSY758430698", "Value": "100.00" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":
{

"Status":"Accepted",
"Code":"202",
"Time":"0000-00-00 00:00:00",
"Endpoint":"DealAdd",
"DealID" : "HSY758430698"

}
}

Endpoint: /DealChange

Filter Description
DealID ID of the Deal
Field Description
DealName Name of the Deal
Status open/won/lost
Value Number with 2 decimals, separated by dot (0.00)
Probability Integer number 0-100
StageID Valid stage ID for this Pipeline
OwnerID * User ID owner of the deal
LinkedPersonID * Person linked to deal (ID)
LinkedOrgID Organization linked to deal (ID)
Involved Persons (IDs) involved (array)
ExpClosing Expected closing date (YYYY-MM-DD)
Products Product names to be linked (array)
Extra Custom fields (array) more info

Please use only the fields you are really updating. If you try to resend the same values (no change made in the content) the API call will be rejeted with error code 406.

Delete Deal

curl "https://api.onpipeline.com/DealDelete"
-H "Authorization: your-token-here"
-d '{ "DealID": "123456789" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/DealDelete";
/* Call the Resource URL */

$query = array(
"DealID" => '123456789HSY7584306'
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/DealDelete"

import json, requests

headers = {
'Authorization' : token
}

data = { "DealID": "123456789HSY7584306" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Accepted",
"Code":"202",
"Time":"0000-00-00 00:00:00",
"Endpoint":"DealDelete",
"DealID":"123456789HSY7584306"
}
}

Endpoint: /DealDelete

Filter Description
DealID Deal ID to be deleted

Undelete Deal

curl "https://api.onpipeline.com/DealUndelete"
-H "Authorization: your-token-here"
-d '{ "DealID": "123456789" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/DealUndelete";
/* Call the Resource URL */

$query = array(
"DealID" => '123456789HSY7584306'
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/DealUndelete"

import json, requests

headers = {
'Authorization' : token
}

data = { "DealID": "123456789HSY7584306" }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Accepted",
"Code":"202",
"Time":"0000-00-00 00:00:00",
"Endpoint":"DealUndelete",
"DealID":"123456789HSY7584306"
}
}

Endpoint: /DealUndelete

Filter Description
DealID Deal ID to be restored

This resource will restore a deal and set the status to “open”.

Events

Events - Sample JSON output:

{
"EventID": "upvnjbr1360795284",
"OwnerID": "1",
"OwnerName": "Mike",
"Name": "Meeting with Paul",
"Start": "2019-06-23 09:00:00",
"End": "2019-06-23 09:30:00",
"TimeZone": "Europe/Amsterdam",
"Location": "Amsterdam",
"Type": "meeting",
"LinkedDeal": "9531451823ABC71183121",
"LinkedPerson": "9531451823ABC71183121",
"LinkedOrg": "9531451823ABC71183121",
"Guests": "email@email.com,email@email.com",
"Created": "2019-06-14 15:41:11",
"CreatedBy": "Mike",
"CreatedByID": "1",
"LastUpdate": "2019-06-14 16:50:01",
"EventCompleted": "0",
"NotifyExternal": "0",

}

Resources to access the Event.

Endpoint Description
EventList List Events

Event object:

Fields Description
EventID Unique event ID
OwnerID User ID that owning the event
OwnerName Name of the Owner
Name Event Name
Start Booking start time (datetime)
End Booking end time (datetime)
TimeZone Time zone
Location Location for the event
Type task, call, email, meeting, or deadline
LinkedDeal Linked Deal ID
LinkedPerson Linked Person ID
LinkedOrg Linked Organization ID
Guests List of guests email
Created Date when the event was created
CreatedBy User that created the event
CreatedByID User ID that created the event
LastUpdate Last update datetime
EventCompleted 1 = Event completed
NotifyExternal 1 = Notify external guests
MinCreated Created after a certain datetime
MaxCreated Created before a certain datetime

List Events

Endpoint: /EventList

Available Filters Description
EventID Unique event ID
OwnerID User ID that owning the event
OwnerName Name of the Owner
Name Event Name
Start Booking start time (datetime)
End Booking end time (datetime)
TimeZone Time zone
Location Location for the event
Type task, call, email, meeting, or deadline
LinkedDeal Linked Deal ID
LinkedPerson Linked Person ID
LinkedOrg Linked Organization ID
Guests List of guests email
Created Date when the event was created
CreatedBy User that created the event
CreatedByID User ID that created the event
LastUpdate Last update datetime
EventCompleted 1 = Event completed
NotifyExternal 1 = Notify external guests
MinCreated Created after a certain datetime
MaxCreated Created before a certain datetime

Notes

Notes - Sample JSON output:

{
"Type":"person",
"LinkedID":"3KNR4375962",
"NoteID":"115",
"Text":"Any comment here",
"Deleted":"0",
"Created":"2019-06-07 11:13:38",
"UserID":"2123456",
}

Endpoint: /NotesList

Available Filters Description
Type person/org/deal
LinkedID ID of linked person/org/deal
MinCreated Created after a certain datetime
MaxCreated Created before a certain datetime
Field Description
Type person/org/deal
LinkedID ID of linked person/org/deal
NoteID ID of this note
Text Note contents
Deleted 1 = deleted
Created Time when note was created (datetime)
UserID User ID who created the note

Add Note

curl "https://api.onpipeline.com/NoteAdd"
-H "Authorization: your-token-here"
-d '{ "Type" : "org", "LinkedID": "3N483571269", "Text": "Your note here" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/NoteAdd";
/* Call the Resource URL */


$query = array(
"Type" => 'org',
"LinkedID" => '3N483571269',
"Text" => 'Your note here',
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

Endpoint: /NoteAdd

Field Description
Type person/org/deal
LinkedID ID of linked person/org/deal
Text Note contents

Invoices

These resources enables you to retrieve the invoice headers and main details. If you require access to the invoice lines, use the ID from this output and access the InvoiceItems endpoint.

List Invoices

Invoices - Sample JSON output:

{
"ID":"ded1cae7506fc9753eaaa7b626f1983b",
"Number":"INV-18",
"Date":"2022-05-02",
"ClientID":"8B9DF681",
"VAT_id":"11111111",
"TAX_id":"22222222",
"Name":"Test Company",
"Address1":"Address 22",
"Address2":"",
"City":"Small Town",
"Postcode":"101010",
"Region":"VA",
"Country":"US",
"Currency":"USD",
"NetTotal":"100.00",
"Tax":"0.00",
"Withholding":"0.00",
"Total":"100.00",
"DueDate":"2022-06-30",
"Paid":"0.00",
"Reference":"PO 123"
}
curl "https://api.onpipeline.com/InvoiceList"
-H "Authorization: your-token-here"
-d '{ "MinDate" : "2022-05-01", "MaxDate": "2022-05-31" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/InvoiceList";
/* Call the Resource URL */


$query = array(
"MinDate" => '2022-05-01',
"MaxDate" => '2022-05-31',
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

Endpoint: /InvoiceList

Mandatory Filters Description
MinDate Invoice Date range - start date YYYY-MM-DD
MaxDate Invoice Date date range - end date YYYY-MM-DD
Field Description
ID Local ID of the invoice
Number Number of the invoice
Date Invoice date
ClientID Billing Client ID
TAX_id Client Tax ID
Name Client Name
Address1 Main address line
Address2 Additional address line
Postcode Postcode
Region Region or Province
Country Country
Currency Invoice currency ISO 4217 code
NetTotal Invoice total exluding tax
Tax Sales tax
Withholding Withholdings
Total Grand total of the Invoice
DueDate When the invoice has to be paid
Paid Paid amount
Reference Any reference for the invoice

Invoice Lines

Invoice Lines - Sample JSON output:

{
"Description":"Product ABC",
"Price":"20.88",
"Quantity":"5.00",
"Discount":"20.00",
"Tax":"0.00",
"Total":"83.52"
}
curl "https://api.onpipeline.com/InvoiceItems"
-H "Authorization: your-token-here"
-d '{ "ID" : "ded1cae7506fc9753eaaa7b626f1983b" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/InvoiceItems";
/* Call the Resource URL */


$query = array(
"ID" => 'ded1cae7506fc9753eaaa7b626f1983b',
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

Endpoint: /InvoiceItems

Mandatory Filters Description
ID Local ID of the invoice
Field Description
Description Item Description
Price Unit price
Quantity Quantity
Discount Discount applied
Tax Sales Tax for the item
Total Line total

Actions Menu

Actions Menu - Sample JSON output:

{
"LinkID":"1",
"Label":"Link Name",
"Zone":"deal",
"Url":"https://server/pagetolink?{ID}",
"Icon":"https://server/icon.png",
"Created":"2019-06-07 11:13:38"
}

Endpoint: /ActionMenuList

Field Description
Label Name of the link
LinkID ID of the link
Zone person/organization/deal
Url Page to link to
Icon Icon Url 20x20px - Optional value
Created Time when it was created (datetime)
curl "https://api.onpipeline.com/ActionMenuAdd"
-H "Authorization: your-token-here"
-d '{ "Label" : "Name", "Zone": "person", "Url": "https://server/pagetolink?{ID}" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/ActionMenuAdd";
/* Call the Resource URL */


$query = array(
"Label" => 'My Link Name',
"Zone" => 'person',
"Url" => 'https://server/pagetolink?{ID}',
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

Endpoint: /ActionMenuAdd

Field Description
Label Name of the link (max 35 chars)
Zone person/organization/deal
Url Page to link to
Icon Icon Url 20x20px - Optional value

More information about the shortcuts you can use in the Url param can be found here. You can get the custom fields labels via API with this resource.

Please know that each zone can receive max 10 links.

curl "https://api.onpipeline.com/ActionMenuDelete"
-H "Authorization: your-token-here"
-d '{ "LinkID" : "1" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/ActionMenuDelete";
/* Call the Resource URL */


$query = array(
"LinkID" => '1'
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

Endpoint: /ActionMenuDelete

Field Description
LinkID ID of the link

Log History

HistoryLogAdd - Sample JSON object:

{
"AppName":"Online Booking",
"Type":"person",
"LinkedID":"ALM016574928",
"Title":"Order received",
"IconUrl":"https://server/icon.png",
"Descr":"You can add here your order details"

}

Endpoint: /HistoryLogAdd

Field Description
AppName Name of the source
LinkedID ID of the linked person org or deal
Type person/org/deal
Title Name of the event and main references
IconUrl Icon Url 24x24px - Optional value
Descr Add all details here - no html (read below)
curl "https://api.onpipeline.com/HistoryLogAdd"
-H "Authorization: your-token-here"
-d '{ "AppName":"Online Booking", "Type":"person", "LinkedID":"ALM016574928", "Title":"Order received", "IconUrl":"https://server/icon.png", "Descr":"You can add here your order details"}'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/HistoryLogAdd";
/* Call the Resource URL */


$query = array(
"AppName"=> "Online Booking",
"Type"=> "org",
"LinkedID"=> "ALM016574928",
"Title"=> "A new order",
"IconUrl"=> "https://yourserver/icon.png",
"Descr"=> "",
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

You are not allowed to store HTML code but you can create links and bold text wthin the description (Descr) by using the following format.

Link: {a href=”……..”}Text{/a}
Bold: {b}Text{/b}
Line break = \n

The event date and time is created automatically when you call this resource.
Since it is not possible to delete log entries, we kindly suggest that you use a unique value as AppName, this will help our support team to identify specific records.

Widgets

Widgets - Sample JSON output:

{
"ID":"1",
"Label":"Widget Name",
"Zone":"deal",
"Url":"https://server/page",
"Icon":"https://server/icon.png",
"Created":"2019-06-07 11:13:38"
}

Endpoint: /WidgetList

Field Description
Label Name of the Widget
ID ID of the Widget
Zone person/organization/deal
Url Frame Url
Icon Icon Url 20x20px - Optional value
Created Time when it was created (datetime)

Add Widget

curl "https://api.onpipeline.com/WidgetAdd"
-H "Authorization: your-token-here"
-d '{ "Label" : "Name", "Zone": "person", "Url": "https://server/page" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/WidgetAdd";
/* Call the Resource URL */


$query = array(
"Label" => 'My Name',
"Zone" => 'person',
"Url" => 'https://server/page',
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

Endpoint: /WidgetAdd

Field Description
Label Name of the Widget (max 35 chars)
Zone person/organization/deal
Url Frame Url
Icon Icon Url 20x20px - Optional value

Please know that each zone can receive max 10 widget.

Delete Widget

curl "https://api.onpipeline.com/WidgetDelete"
-H "Authorization: your-token-here"
-d '{ "ID" : "1" }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/WidgetDelete";
/* Call the Resource URL */


$query = array(
"ID" => '1'
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 400 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

Endpoint: /WidgetDelete

Field Description
ID ID of the Widget

Users

Users - Sample JSON output:

{
"ID": "1234567",
"Name": "Mike",
"Email": "user@email",
"Status": "1",
"AdminFlag": "0",
"Permissions":[
"Pipeline": "0",
"CustomFields": "0",
"Delete": "0",
"WriteTeamEmails": "0",
"BulkImport": "0",
"BulkExport": "0",
"Leads": "0",
"WebForms": "0",
]
}

Endpoint: /UsersList

Field Description
ID User ID
Name User Name
Email User Email
Status 1 = Active
AdminFlag 1 = Administrator
Permissions: (array)
Pipeline 1 = Can edit pipelines
CustomFields 1 = Can edit custom fields
Delete 1 = Authorized to delete
WriteTeamEmails 1 = Can send email from its team SMTP
BulkImport 1 = Can import from files
BulkExport 1 = Can export data from files
Leads 1 = Can manage leads and sources
WebForms 1 = Can manage web forms

Teams

Team - Sample JSON output:

{
"Name": "Team Name",
"ID": "1234567",
"Members":[
{
"UserID":"000000000",
"Leader":"1",
},
{
"UserID":"000000000",
"Leader":"0",
}
]

}

Endpoint: /TeamsList

Field Description
ID Team ID
Name Team Name
Members: (array)
UserID User ID of the member
Leader 1 = team leader

Pipelines

Pipeline - Sample JSON output:

{
"PipelineName": "Pipeline Name",
"PipelineID": "1",
"Team": "",
"Stages":[
{
"ID": "1",
"Name": "Stage1"
},
{
"ID": "2",
"Name": "Stage2"
},
{
"ID": "3",
"Name": "Stage3"
}
]

}

Endpoint: /PipelineList

Field Description
PipelineName Name of the pipeline
PipelineID ID of the pipeline
Team If reserved to a team it will show the team ID
Stages: (array)
ID ID of stage
Name Stage name

Products (Deal Categories)

Endpoint: /ProductList

Sample JSON output

[
“Product1”,
“Product2”,
“Product3”
]

Last Update

curl "https://api.onpipeline.com/LastUpdate"
-H "Authorization: your-token-here"
-d '{ "Resource": "DealsList", "Hours": "12" }'

It allows you to list records from your CRM based on the last update. It is useful when you need to change data in other applications, for example in a billing software when the deal is won or when you change contact details and want to save the new information.

Endpoint: /LastUpdate

Field Description
Resource Specify here the data you want to read (accepted values: PersonList, OrgList or DealsList)
Hours Time frame for last update (accepted values: 24, 12, 6, 3). It will show the records that have been updated within the previous X hours.

The output is relative to the type of resource you are calling.

Leads IN

curl "https://api.onpipeline.com/Leadsin"
-H "Authorization: your-token-here"
-d '{ "FirstName": "Mike", "LastName": "Smith", "OrgName": "Company Inc.",
"Email":[ { "Address":"mike@company.com", "Type":"work" } ],
"Phone":[ { "Number":"111111111111", "Type":"work" } ],
"Extra":[ { "ID":"1111111", "Value":"Managing Director" } ] }'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/Leadsin";
/* Call the Resource URL */

$query = array(
"FirstName" => 'Mike',
"LastName" => 'Smith',
"Phone" => array(
array( "Number" => "+1111111111111", "Type"=>"work" ),
array( "Number" => "+2222222222222" , "Type"=>"home")
),
"Email" => array(
array( "Address" => "mike@company.com", "Type"=>"other" ),
),
"Postcode" => '12345',
"Extra" => array(
array( "ID" => "000000000000", "Value"=>"Any value" ),
),
);

$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}
token = "your-token-here"
url = "https://api.onpipeline.com/Leadsin"

import json, requests

headers = {
'Authorization' : token
}

data = { "FirstName": "Mike", "LastName": "Smith", "OrgName": "Company Inc.",
"Email":[ { "Address":"mike@company.com", "Type":"work" } ],
"Phone":[ { "Number":"111111111111", "Type":"work" } ],
"Extra":[ { "ID":"1111111", "Value":"Managing Director" } ] }

jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

JSON response for accepted calls

{
"Header":{
"Status":"Created",
"Code":"201",
"Time":"0000-00-00 00:00:00",
"Endpoint":"Leadsin"
},

"Data":{
"LeadID":"123456789HSY7584306"
}
}

You or your partners may store new leads into the application. Access to this resource is grant to “Lead Sources” or API Tokens as follows. Please be advised that before you connect to our API the client IP address(es) shall be always whitelisted.

Endpoint: /Leadsin

Field Description
FirstName * Contact first name
LastName * Contact family/last name
Phone Phone numbers (array)
Type:work/home/mobile/other
Email Email address (array)
Type:work/home/other
OrgName Name of organization
AddressLine1 Address line
AddressLine2 Additional address (Apt., floor, etc.)
Postcode Postal / ZIP code
City City or town
Region Region or State
Country Country
Extra Custom fields (array), if any

(*) mandatory field

Extra: You don’t have to use custom fields if the information you are uploading is covered by standard fields, and/or the company admin does not instruct you to use them by providing proper IDs.

Custom Field

Each table can store custom fields as described here.

Add Custom Field

curl "https://api.onpipeline.com/FieldAdd"
-H "Authorization: your-token-here"
-d '{ "Table" : "organizations", "Name": "BillingID" }'

Endpoint: /FieldAdd

Field Description
Table persons/organizations/deals
Name Name of the field

The API creates only text fields.

Delete Custom Field

curl "https://api.onpipeline.com/FieldDelete"
-H "Authorization: your-token-here"
-d '{ "ID" : "1411084437" }'

Endpoint: /FieldDelete

Field Description
ID ID of the field

Call Tracking and Recording

curl "https://api.onpipeline.com/CallRecord"
-H "Authorization: your-token-here"
-d '{
"Type":"inbound",
"FromNumber":"+00 0000 0000 0000",
"ToNumber":"+00 0000 0000 0000",
"Start":"0000-00-00 00:00:00",
"End":"0000-00-00 00:00:00",
"mp3file": "BASE64FILECONTENTS"
}'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/CallRecord";
/* Call the Resource URL */

$audio_name='example.mp3'; /*file name*/
$audio_path=''; /*file path*/

$audiofile = file_get_contents($audio_path.$audio_name, true);
$audiofile = base64_encode($audiofile);

$query = array(
"Type"=>"inbound",
"FromNumber"=>"+00 0000 0000 0000",
"ToNumber"=>"+00 0000 0000 0000",
"Start"=>"0000-00-00 00:00:00",
"End"=>"0000-00-00 00:00:00",
"mp3file" => $audiofile
);

$json_query = json_encode($query);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

//print_r($output);

JSON response for accepted calls

{
"Header":{
"Status":"Created",
"Code":"201",
"Time":"0000-00-00 00:00:00",
"Endpoint":"CallRecord"},

"Data":
{
"CallID":"a867e5709368b0139076f3ed9879f7f3",
"LinkedTo":
[
{
"Person":"XXXXXXXXXXXX",
"Org":"YYYYYYYYYYY",
"Deal":"ZZZZZZZZZZZZ"
}
]
}
}

JSON Error Example

{
"Error":
{

"Code": "406",
"Message": "Not acceptable - The file must be mp3",
"Time": "0000-00-00 00:00:00",
"IP": "127.0.0.1"

}

}

This Resource allows your sales team to leverage all benefits of Onpipeline. It is available only to specific -write only- Tokens (Call Recorders), or Read and Write Tokens. If you provide the Token to a 3rd party call center we strongly advise that your generate a “Call Recorder” token (a Read and Write Token allows full access to your company data).

Endpoint: /CallRecord

Field Description
Type Accepted values are “inbound” or “outbound”
FromNumber Caller Phone Number
ToNumber Call Receiver Phone Number
Start Start date and time
End End date and time
mp3file File content (optional)
Note Call comments (optional)

The “phone number” (FromNumber/ToNumber) will be used to attach the record to the proper contact > organization > deal. Numbers will be matched against digits (+44 (001) 1234-5678-910 will match with 4400112345678910 and vice versa). In case of unrecognized phone numbers our API returns an error message (406).

Call Recording
If you want to send the mp3 file of the phone call you will send the file contents - converted to base64 - within the API request (“mp3file” field). The connection will remain open until the file is completely uploaded (Max file size is 70 MBytes).

Webhook

The webhook provides your applications with real-time information about

Persons
Organizations
Deals
Calendar events

The webhook will POST exactly the json object you receive by querying our API.

#Deals
#Person
#Organization
#Events

Webhook - Sample JSON output:

{
"ID":"1",
"Zone":"deal",
"Url":"https://server/page",
"Created":"2019-06-07 11:13:38"
"Lastrun_GMT":"2019-06-07 05:13:38"
}

Endpoint: /WebhookList

Field Description
ID ID of the Webhook
Zone person/org/deal/event
Url Url where you want to receive POST
Created Time when it was created (datetime)
Lastrun_GMT Time when it was called (datetime GMT)
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/WebhookList";

$json_query = json_encode($query);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

print_r($output);

Add Webhook

Endpoint: /WebhookAdd

Field Description
Zone person/org/deal/event
Url Url where you want to receive POST
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/WebhookAdd";


$query = array(
"Zone"=>"person",
"Url"=>"https://yourserver/endpoint",
);

$json_query = json_encode($query);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

print_r($output);

Delete Webhook

Endpoint: /WebhookDelete

Field Description
ID ID of the webhook
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/WebhookDelete";


$query = array(
"ID"=>"1111111"
);

$json_query = json_encode($query);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: ". $token));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];
echo "Error: ".$errorcode." - ".$errormess;
exit;
}

print_r($output);

Custom Fields

curl "https://api.onpipeline.com/ListCustomFields"
-H "Authorization: Token"
-d '{"Table":"Persons"}'
$token = "your-token-here"; 
/* use your personal API token */
$url = "https://api.onpipeline.com/ListCustomFields";
/* Call the Resource URL */
$table = "Persons";
/* table name (Persons/Organizations/Deals) */

$query = array("Table" => $table);
$json_query = json_encode($query);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Authorization: ". $token
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_query);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$output = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);

if($http_code > 200 || isset($output['Error'])) {
$errorcode=$output['Error']['Code'];
$errormess=$output['Error']['Message'];

echo "Error: ".$errorcode." - ".$errormess;
exit;
}

/* print_r($output); */

if($output){

foreach ($output['Data'] as $item){
echo $item['ID'].': '.$item['Name'].'<br>';
}

}
token = "your-token-here"
url = "https://api.onpipeline.com/ListCustomFields"

import json, requests

headers = {
'Authorization' : token
}

data = {"Table":"Persons"}
jsondata = json.dumps(data);

try:
response = requests.post(url,data=jsondata,headers=headers)
except:
print 'Error'
exit()

output = response.json()

for x in output['Data']:
print 'ID: ' + x['ID'] + ': ' + x['Name']

JSON Response Example

{
"Header":
{

"Status":"Accepted",
"Code": "200",
"Time": "2018-05-27 15:53:59",
"Endpoint": "ListCustomFields",
"Table":"Persons"

},

"Data": [

{
"Name":"Frequent Buyer",
"ID":"123456789"
},
{
"Name":"Role",
"ID":"123456789"
}
]
}

Custom fields (if any) could exist in

and can be retrieved or modified through the “Extra” array.

Please know the key of a custom field is its ID.
JSON post structure shall be the following:

“Extra”: [
{
“ID”:”1111111”,
“Value”:”any_value”
}
]

IDs and Names are accessible by admins or any user with permissions to edit custom fields (can be obained within Onpipeline). If you need to interact with custom fields through our API and don’t know the ID or the Name we suggest the following methods:

You can add and delete custom fields with API.

HTTP Responses / Errors

Sample JSON response with an error message
------------------------------------------

{
    "Error": 
        {

            "Code": "401",
            "Message": "Invalid Token",
            "Time": "2018-05-27 15:53:59",
            "IP": "127.0.0.1"

        }

}

Sample JSON response for a valid request
----------------------------------------

{
    "Header": 
        {

            "Status":"Created",
            "Code": "201",
            "Time": "2018-05-27 15:53:59",
            "Endpoint": "PersonAdd",
        },

    "Data": 
        {

            "PersonID":"00000000000000",

        }       

}

When API requests are successful, the API returns a 200-201-202 status code. If an error occurs, the API returns a higher code. Response codes are sent with the http header but are also part of the JSON response.

In case of errors you will find the “Code” in the “Error” array.
For other responses the “Code” is passed to the client with the “Header” array.

The body of the response contains a description of what caused the error.

Onpipeline uses the following HTTP response codes:

Code Meaning
200 OK (Query accepted)
201 Created (Item successfully created)
202 Accepted (Item modified or deleted)
400 Bad Request (Invalid Header, Missing Token etc.)
401 Unauthorized (Your API Token is wrong or inactive)
403 Forbidden (Invalid IP, No permissions to access)
404 Not Found (Resorce name not found)
406 Not Acceptable (Invalid JSON)
409 Conflict (Duplicate)
500 Internal Server Error (Try again later)