0% found this document useful (0 votes)
178 views

Cratio CRM API Reference

This document provides an overview and examples of using the Cratio CRM API to perform common operations like inserting, updating, deleting, and retrieving records. It describes how to set up API keys for authentication and access. The frequently used API methods section includes examples of inserting records with different scenarios for handling duplicates, and retrieving status of inserted records. Other API methods covered at a high level include getting all records, searching records, getting related records, updating records, and deleting records. Examples are provided for each method to illustrate usage.

Uploaded by

ilango thavasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
178 views

Cratio CRM API Reference

This document provides an overview and examples of using the Cratio CRM API to perform common operations like inserting, updating, deleting, and retrieving records. It describes how to set up API keys for authentication and access. The frequently used API methods section includes examples of inserting records with different scenarios for handling duplicates, and retrieving status of inserted records. Other API methods covered at a high level include getting all records, searching records, getting related records, updating records, and deleting records. Examples are provided for each method to illustrate usage.

Uploaded by

ilango thavasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Cratio CRM API Reference

Introduction

Setup & Administration


Enabling API Key Administration
API Key Errors
API URL , Security & Limits

Frequently Using API Methods


To Insert a Record
Scenario 1 (Create New Entry if Duplicate Occurs)
Scenario 2 (Update Existing Entry if Duplicate Occurs)
Scenario 3 (Insert with Date and Time value)
To get Status about Inserted Record

Other API Methods Overview

Other API Details


General Errors
getAllRecords
Example Scenario:
getRecordsBySearch
Example Scenario:
getRecordsByTemplate
Example Scenario:
getRelatedrecords
Example Scenario:
insertRecords
Example Scenario:
updateRecords
Example Scenario:
deleteRecords
Introduction
API (Application Programming Interface) for integrating CRM modules with any
third-party applications such as, accounting, ERP, e-commerce, self-service portals and
others. you can extract CRM data in JSON format and develop new applications or
integrate with your existing business applications.

---------------------------------------------------------------------

Setup & Administration

Enabling API Key Administration

1. Log in to CRM with Administrator's privilege User.


2. Go to Setup > Crm API Key menu item..
3. Generate the Api key based on (username+appid)

API Key Errors

Error Message Description

{"error":"Please give the valid API key"} API Key value is Empty, Enter the API Key

{"error":"Access denied.Please provide Incorrect API Key. Check the API key
valid api key."} entered.

.{"error":"your api daily limit crossed for API call cannot be completed as the limit
this operation"} rate exceeds.

API URL , Security & Limits


● https://www.cratiocrm.com/api/apirequest.php
● We restrict API calls to 250 Calls/Day by default. Please contact support if you
want to increase this limits.
● By default API allows access from all IP address. If you want IP based API access
restrictions, please contact our support team.
● API based Insert,update,delete operations can be performed as per user id and profile
based security restriction as defined by CRM admin. E.g Use admin user key for
performing delete or update on specific forms.

Frequently Using API Methods

To Insert a Record

Purpose : You can use the insertRecords operation to insert records into the required
CRM module.

Important: Use the POST operation to pass these parameters instead of GET
operation.

Parameter Data Type Description

apikey * String Provide api key to access


crm module

formname * String Specify crm module to


perform operation

operation * String Specify valid operation

overwrite String true-it overwrite the


records when duplicate
found.
false-it skip the duplicate
handle operation

records Array Specify records sets in


array
* - Mandatory parameter
Request Sample

{
"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"false",
"Records":
[
{
"Contact Name":"Prabhu1",
"Company Name":"Quick Sales1",
"Email":"[email protected]",
"Mobile":"9710247372",
"Assigned To":"Prabhu",
"Lead Date":"2017-08-05"
},
{
"Contact Name":"Prabhu2",
"Company Name":"Quick Sales2",
"Email":"[email protected]",
"Mobile":"9710247373",
"Assigned To":"Prabhu",
"Lead Date":"2017-08-05"}
]
}

Error Message:

Error Message Description

“ {"error":"{\"success\":\"Deleted\"} Already Existed record with same value is


{\"success\":\"Deleted\"}" Deleted and New Record is been Inserted.
Example Scenario:

Scenario 1 (Create New Entry if Duplicate Occurs)


Inserting two record in lead with record duplication enabled.

● Enter the formname as “Leads” and operation as “insertRecords”.


● Enter the fields that to be inserted.for example, here we chose six fields
( Contact name,Company Name,Email,Mobile,Assigned To,Lead Date )
● Lead Date is to be in this format eg.(YYYY-MM-DD or DD-MM-YYYY).
● When the record duplication is enabled,
Incase, if the records that are already exist in Lead is once again inserted means,
instead of overwritting the record, it create new record with another ID.
● Inorder to enable record duplication, give overwrite value as “false”.
● Once the record is created with overwrite value as “false”, new ID will be given
to it.
Request sample:
{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTQ6NDE6MjA=",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"false",
"Records":
[
{
"Contact Name":"vinoth",
"Company Name":"Cratio",
"Email":"[email protected]",
"Mobile":"9797979797",
"Assigned To":"",
"Lead Date":"2017-08-07"
},
{
"Contact Name":"Bharathi",
"Company Name":"Cratio2",
"Email":"[email protected]",
"Mobile":"8189890706",
"Assigned To":"",
"Lead Date":"2017-08-07"}
]
}
Response sample:

"{
"Success":
[
{
"Rowindex":1,
"Formid":3683,
"Info":"created"
},
{
"Rowindex":2,
"Formid":3684,
"Info":"created"
}
]
}"
Rowindex - represents row of the record inserted.
Formid - represents ID of the record inserted.
Info - represents the action that performed.

Scenario 2 (Update Existing Entry if Duplicate Occurs)


Inserting two record that are already exist in lead with record duplication disabled.

● Enter the formname as “Leads” and operation as “insertRecords”.


● Enter the fields that to be inserted.for example, here we chose six fields
( Contact name,Company Name,Email,Mobile,Assigned To,Lead Date )
● Lead Date is to be in this format eg.(YYYY-MM-DD or DD-MM-YYYY).
● When the record duplication is disabled,
Incase, if the records that are already exist in Lead is once again inserted means,it
overwrite the record with same ID.
● Inorder to disable record duplication, give overwrite value as “true”.

Request sample:
{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTQ6NDE6MjA=",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"true",
"Records":
[
{
"Contact Name":"vinoth",
"Company Name":"Cratio",
"Email":"[email protected]",
"Mobile":"9797979797",
"Assigned To":"",
"Lead Date":"2017-08-07"
},
{
"Contact Name":"Bharathi",
"Company Name":
"Cratio2",
"Email":"[email protected]",
"Mobile":"8189890706",
"Assigned To":"",
"Lead Date":"2017-08-07"
}
]
}

Response sample:

“{
"Success":
[
{
"Rowindex":1,
"Formid":"3683",
"Info":"updated"
},
{
"Rowindex":2,
"Formid":"3684"
,"info":"updated"
}
]
}"

Rowindex - represents row of the record inserted.


Formid - represents ID of the record inserted.
Info - represents the action that performed.

Scenario 3 (Insert with Date and Time value)


To Insert records in lead form with Date and Time value

● Enter the formname as “Leads” and operation as “insertRecords”.


● Enter the fields that to be inserted.for example, here we chose seven fields
( Contact name,Company Name,Email,Mobile,Lead Stage,Assigned To,Time Test ).
● Here,Time Test is date and time field.
● Lead Date is to be in this format eg.(YYYY-MM-DD or DD-MM-YYYY).and Time
is to be in this format ( hh:mm TT (TT is AM or PM) or hh:mm:ss (24 hours format) ).
● For Date and Time field, format is to be like this ( DATE TIME ).
● For example, we are inserting Date and Time value as ( 09-08-2017 10:21 PM )

Request sample:

{
"apikey":"QXJhdmluZCRAMzcjIzIwMTctMDgtMTYgMTE6MDE6MjI=",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"false",
"Records":
[
{
"Contact Name":"Bharathi1",
"Company Name":"Cratio1",
"Email":"[email protected]",
"Mobile":"9790606709",
"Lead Stage":"Yet To Talk",
"Assigned To":"",
"Time Test":"09-08-2017 10:21 PM"
},
{
"Contact Name":"Bharathi2",
"Company Name":"Cratio2",
"Email":"[email protected]",
"Mobile":"8189890706",
"Lead Stage":"Hot",
"Assigned To":"",
"Time Test":"09-08-2017 10:21 PM"
}
]
}
Response sample:
“{
"Success":
[
{
"Rowindex":1,
"Formid":3462,
"Info":"created"
}
,
{
"Rowindex":2,
"Formid":3463,
"Info":"created"
}
]
}"

Rowindex - represents row of the record inserted.


Formid - represents ID of the record inserted.
Info - represents the action that performed.

For reference
Refer insertRecords.php in same folder.

To get Status about Inserted Record

Purpose

You can use the updateRecords operation to update or modify the records in CRM.
Important: Use the POST operation to pass these parameters instead of GET
operation.
Parameter Data Type Description

apikey * String Provide api key to access


crm module

formname * String Specify crm module to


perform operation

operation * String Specify valid operation

records Array Specify records sets in


array
* - Mandatory parameter

Request Sample

{"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"updateRecords",
"Records":
[
{
"Form ID":"3522",
"Contact Name":"Prabhu11",
"Company Name":"Quick Sales11",
"Email":"[email protected]",
"Mobile":"9710247372",
"Assigned To":"Suresh Shamalan",
"Lead Date":"2017-08-05"
}
,{
"Form ID":"3523",
"Contact Name":"Prabhu22",
"Company Name":"Quick Sales22",
"Email":"[email protected]",
"Mobile":"9710247373",
"Assigned To":"Suresh Shamalan",
"Lead Date":"2017-08-05"
}
]
}

Error Message:

Error Message Description

"{"error":[{"rowindex":1,"formid":"3522","info":"re Incorrect FormID or record not found for


cord not found"}] }” that FormID

Example Scenario:

Scenario 1: To update a particular lead record based on its ID.


● Enter the formname as “Leads” and operation as “updateRecords”.
● Enter Form ID of the lead record that is to be updated, followed by the fields
● Here we chose six fields ( Contact name,Company
Name,Email,Mobile,Assigned To,Lead Date ).
● Lead Date is to be in this format eg.( YYYY-MM-DD or DD-MM-YYYY ).

Request sample:

{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTQ6NDE6MjA=",
"formname":"Leads",
"operation":"updateRecords",
"Records":
[
{
"Form ID":"3671",
"Contact Name":"Bharathi",
"Company Name":"Bharathi Electronics",
"Email":"[email protected]",
"Mobile":"9710247372",
"Assigned To":"vinoth",
"Lead Date":"2017-08-05"
},
{
"Form ID":"3672",
"Contact Name":"vinoth",
"Company Name":"vinoth constructions",
"Email":"[email protected]",
"Mobile":"9710247370",
"Assigned To":"vinoth",
"Lead Date":"2017-08-05"
}
]
}

Response sample:

"{
"Success":
[
{
"Rowindex":1,
"Info":"updated"
},
{
"Rowindex":2,
"Info":"updated"
}
]
}"

Rowindex - represents row of the record inserted.


Formid - represents ID of the record inserted.
Info - represents the action that performed.

For reference
Refer updateRecords.php in Source Code folder.

Other API Methods Overview


● getAllRecords
○ Get all records on a specific Form
● getRecordsBySearch
○ Get specific record of a form as per search condition. E.g Last week created
leads, or lead status = New
● getRecordByTemplate
○ Get specific record of a form as per view template name . E.g Get all records of
view template Hot Leads
● getRelatedRecord
○ Get subtable records of a specific form. E.g you can fetch activities linked to
specific lead.
● insertRecords
○ Create a new record in CRM
● updateRecords
○ Update existing record
● deleteRecords
○ Delete existing Record.
Other API Details

General Errors

Error Message Description

{"error":"Please specify the operation"} Operation value is Empty,It should not be


empty.

{"error":"Please specify the formname"} Formname value is Empty,It should not be


empty.

{"error":"Invalid Operation"} Incorrect Operation name, check the


operation name

{"error":"Please specify valid formname"} Incorrect Formname, Enter the valid


formname.

getAllRecords
Purpose
You can use the getAllRecords operation to fetch all users data specified in the API request.

Parameter Data Type Description

Apikey * String Api key to access crm

Formname * String Specify form name to fetch its


relevant records

Operation * String Specify operation to fetch all


records

Displayfields Array To select the required fields


data alone from crm module

Pageno Integer Default value is 1.Per page


you can fetch upto 250
records.
Numofrecords Integer Maximum 250.Specify value to
limit the record access

sortcolumn String You can select one of the


fields in CRM in to sort the
data.
Ex: sortcolumn=Company
Here, sorting of the data will
happen based on the
Company field

Sortorder String Sorting order: asc or desc


If you use the sortcolumn
parameter, by default data is
sorted in ascending order.

Isnull Integer isnull=0: To exclude fields


with "null" values while
fetching data from your CRM
account.
isnull=1: To include fields with
"null" values while fetching
data from your CRM account.

* - Mandatory parameter

In Security, Recently Created template fields only shown at the time of api call to avoid
all fields display and data sharing will apply based on api key(user+appid).

Request Sample:

{
"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"getAllRecords",
"displayfields":["Contact Name","Company Name","Email","Mobile","Assigned To"],
"Pageno":2,
"Numofrecords":100,
"sortcolumn":"Mobile",
"Sortorder":"desc",
"Isnull":1
}

Example Scenario:

Scenario 1: To get first 5 Record from Lead form Based on Lead date (descending
order).
● Chose formname as “Leads” and operation as "getAllRecords".
● For example, here we chose four fields as displayfield. ( "Contact
Name","Company Name","Mobile","Lead Date" ).
● To fetch first five records,set Pageno as 1 and number records as 5.
● Sort column as Lead Date, sort order as desc

(Incase,if you need next five record means,change pageno as “2”)

Request sample:

{
"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU=", //Mandatory field
"formname":"Leads", //Mandatory field
"operation":"getAllRecords", //Mandatory field
"displayfields":["Contact Name","Company Name","Mobile","Lead Date",""],
"Pageno":1, //Represent page Number
"Numofrecords":5, //Represent Number of Records per page
"sortcolumn":"Lead Date",
"Sortorder":"desc",
"Isnull":1
}

Response sample:

{
"pageno":1,
"Totalrows":167,
"Responserows":5,
"data":
[{"Contact Name":"Mr. Navab Rajan","Company
Name":"Negm","Mobile":"9745188823","Lead Date":"2017-08-07"},
{"Contact Name":"SREESHANT MADHAVAN","Company
Name":"homergize.com","Mobile":"9446020160","Lead Date":"2017-08-07"},
{"Contact Name":"Mr. Ankit Dara","Company Name":"Scientific
Corporation","Mobile":"9975310010","Lead Date":"2017-08-06"},
{"Contact Name":"Mr. Nikhil","Company
Name":"Kindersports","Mobile":"9623369464","Lead Date":"2017-08-06"},
{"Contact Name":"Mr. Madan","Company Name":"Future development Consumption
Company","Mobile":"9145067847","Lead Date":"2017-08-06"}]
}"

pageno - current page number.


totalrows - total no. of records available.
responserows - no. of records got by request

Scenario 2: To get Records from Opportunities form based on Opportunity date


(descending order) by removing empty value and chose reference field for display
● Chose formname as “Opportunities” and operation as "getAllRecords".
● For example, here we chose four fields as displayfield. In it two fields are
Reference.
● ( "Contact Name","Company Name","Assigned To","Opportunity date" ).
● To fetch next five records, set Pageno as 1 and number records as 5.
● Sort column as Opportunity Date, sort order as desc.
● To remove the fields with empty value, enter Isnull as “0”
● (if you need fields with empty value to be visible means, change Isnull as “1”)
Request sample:
{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTc6MTM6MjU=",
"formname":"Opportunities",
"operation":"getAllRecords",
"Displayfields":
["Contact Name","Company Name","Assigned To","Opportunity Date","",""],
"Pageno":1,
"Numofrecords":5,
"sortcolumn":"Opportunity Date",
"Sortorder":"desc",
"Isnull":0
}.
Response sample:

"{
"Pageno":1,
"Totalrows":112,
"Responserows":5,
"Data":
[{"Contact Name":"Mr. Anup Raut","Opportunity Date":"2017-07-27","Assigned
To":"Aravindh"},
{"Contact Name":"Ms. Neha","Company Name":"Takshila Learning Pvt Ltd","Opportunity
Date":"2017-07-26","Assigned To":"Aravindh"},
{"Contact Name":"Ms. Vanshika singh","Company Name":"Radish
Technologies","Opportunity Date":"2017-07-26","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Bhanu","Company Name":"Telugu Realty","Opportunity
Date":"2017-07-25","Assigned To":"Aravindh"},
{"Contact Name":"Mr. NAGESH","Company Name":"COSMOS","Opportunity
Date":"2017-07-25","Assigned To":"Aravindh"}]
}"
(In response sample, you can see in the first response record,the empty company name
is removed from display)
pageno - current page number.
totalrows - total no. of records available.
responserows - no. of records got by request

For reference
Refer getAllRecords.php in same folder.

getRecordsBySearch

Purpose
You can use this operation to search records by expressions of the selected columns.

Parameter Data Type Description


Apikey * String Api key to access crm

Formname * String Specify form name to fetch its


relevant records

Operation * String Specify operation to fetch all


records

displayfields Array To select the required fields


data alone from crm module

pageno Integer Default value is 1.Per page you


can fetch upto 250 records.

numofrecords Integer Maximum 250.Specify value to


limit the record access

sortcolumn String You can select one of the fields


in CRM in to sort the data.
Ex: sortcolumn=Company
Here, sorting of the data will
happen based on the
Company field

sortorder String Sorting order: asc or desc


If you use the sortcolumn
parameter, by default data is
sorted in ascending order.

isnull Integer isnull=0: To exclude fields with


"null" values while fetching
data from your CRM account.
isnull=1: To include fields with
"null" values while fetching
data from your CRM account.

searchcondition String Use search condition like Lead


Date@Last
Week@2017-07-23|2017-07-2
9@AND\$Assigned
To@is@Aravindh@AND$

* - Mandatory parameter
Request Sample:
{
"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Email","Mobile","Assigned To"],
"Pageno":1,
"Numofrecords":100,
"sortcolumn":"Mobile",
"Sortorder":"desc",
"Isnull":1,
"searchcondition":"Lead Date@Last Week@2017-07-23|2017-07-29@AND\$Assigned
To@is@Aravindh@AND$"
}

Error Messages:

Error Message Description

{"error":"NO RECORDS FOUND"} No records match the search condition.

" {"error":"Invalid column( Lead ) is presented Incorrect search condition Label Name.
in search condition"}"

Example Scenario:

Scenario 1: To Get last week records from lead form by Search


● Choose formname as “Leads” and operation as "getRecordsBySearch".
● For example, here we chose four fields as displayfield.
( "Contact Name","Company Name",”Assigned To","Lead Date" ).
● Pageno as 1 and number records as 5.
● For last week record searchcondition is be given like this,
( Lead Date@Last Week@StartingDate|EndingDate@AND )
● Date should be in this format ( YYYY-MM-DD or DD-MM-YYYY ).Based on your
requirement enter
StartingDate and EndingDate in the condition.
● For example, we take StartingDate and EndingDate in the condition like this
( Lead Date@Last Week@2017-08-1|2017-08-07@AND )

Request sample:
{
"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU=",
"formname":"Leads",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Assigned To","Lead Date",""],
"Pageno":1,
"Numofrecords":5,
"Sortcolumn":"",
"Sortorder":"",
"Isnull":1,
"searchcondition":"Lead Date@Last Week@2017-08-1|2017-08-07@AND"
}

Response sample:

{
"Pageno":1,
"Totalrows":11,
"Responserows":5,
"data":
[{"Contact Name":"Ms. Vailane Fernandes","Company Name":"CG GROUP","Lead
Date":"2017-08-05","Assigned To":"Aravindh"},
{"Contact Name":"sudarshan more","Company Name":"Athiya developers","Lead
Date":"2017-08-04","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Ashok Kumar Mali","Company Name":"InNow India Private
Limited","Lead Date":"2017-08-04","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Andrei","Company Name":"Alesonor","Lead
Date":"2017-08-03","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Pankaj Joshi","Company Name":"Punjab Kesari","Lead
Date":"2017-08-02","Assigned To":"Aravindh"}]
}"

pageno - current page number.


totalrows - total no. of records available.
responserows - no. of records got by request

Scenario 2: To get the leads record,that are assigned to particular user by search.
● Chose formname as “Leads” and operation as "getRecordsBySearch".
● For example, here we chose four fields as displayfield.
( "Contact Name","Company Name",”Assigned To","Lead Date" ).
● Pageno as 1 and number records as 5.
● Inorder to get a record related to particular user, searchfield is to be like this
( Assigned To@is@USERNAME )
● Replace the USERNAME in above condition as you require. For example, here
we take USERNAME in condition like this ( "Assigned To@is@Aravindh")

( Incase,if you need all records,except the records that are assigned to particular
user means, change the condition as “is not” like this (Assigned To@is
not@USERNAME ) )

Request sample:
{
{"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU=",
"formname":"Leads",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Assigned To","Lead Date",""],
"Pageno":1,
"Numofrecords":5,
"Sortcolumn":"",
"Sortorder":"",
"Isnull":1,
"searchcondition":"Assigned To@is@Aravindh"
}

Response sample:

{
"Pageno":1,
"Totalrows":102,
"Responserows":5,
"data":
[{"Contact Name":"SREESHANT MADHAVAN","Company
Name":"homergize.com","Lead Date":"2017-08-07","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Navab Rajan","Company Name":"Negm","Lead
Date":"2017-08-07","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Madan","Company Name":"Future development Consumption
Company","Lead Date":"2017-08-06","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Nikhil","Company Name":"Kindersports","Lead
Date":"2017-08-06","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Ankit Dara","Company Name":"Scientific Corporation","Lead
Date":"2017-08-06","Assigned To":"Aravindh"}]
}"

pageno - current page number.


totalrows - total no. of records available.
responserows - no. of records got by request

Scenario 3: To get lead records which have empty Company Name and remove the
empty value.
● Chose formname as “Leads” and operation as "getRecordsBySearch".
● For example, here we chose four fields as displayfield.
( "Contact Name","Company Name",”Assigned To","Lead Date" ).
● Pageno as 1 and number records as 5.
● To remove the fields with empty value, set Isnull value as 0.
● Inorder to get lead records which have empty Company Name,
searchcondition is to be
(LabelName@is empty).
● Insert the LabelName in condition as you require. For example, here we take
Company name in condition like this ( Company Name@is empty).

( Incase, if you need the records which should not be empty means, change the
condition like this (LabelName@is not empty) )

Request sample:
{
"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU=",
"formname":"Leads",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Assigned To","Lead Date",""],
"Pageno":1,
"numofrecords":5,
"Sortcolumn":"",
"Sortorder":"",
"Isnull":0,
"searchcondition":"Company Name@is empty"
}

Response sample:

{
"Pageno":1,
"Totalrows":5,
"Responserows":5,
"data":
[{"Contact Name":"roshni","Lead Date":"2017-05-18","Assigned To":"Ashwin"},
{"Contact Name":"Rakesh Sharma","Lead Date":"2017-05-07","Assigned To":"Ashwin"},
{"Contact Name":"Abhishek","Lead Date":"2017-05-02","Assigned To":"Ashwin"},
{"Contact Name":"Alok","Lead Date":"2017-04-28","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Abhay","Lead Date":"2017-04-19","Assigned To":"Aravindh"}]
}"

pageno - current page number.


totalrows - total no. of records available.
responserows - no. of records got by request

(In response sample, you can see the empty company name is removed from display)

Scenario 4: To search a lead records which have a field that contain particular value.
● Chose formname as “Leads” and operation as "getRecordsBySearch".
● For example, here we chose three fields as displayfield.
( "Contact Name","Company Name",”Mobile”).
● Pageno as 1 and number records as 5.
● Inorder to get leads with a Mobile field that contains particular value,
searchcondition is to be (LabelName@contains@Value).
● In above condition enter the field as per your requirement.here, we take condition
like this ( Mobile@contains@9819 )

( Incase, if you need to get the records with field that should not contain particular value
means, change condition as (LabelName@not contains@Value) )

Request sample:
{
"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU=",
"formname":"Opportunities",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Mobile","",""],
"Pageno":1,
"Numofrecords":5,
"Sortcolumn":"",
"Sortorder":"",
"Isnull":1,
"searchcondition":"Mobile@contains@9819"
}

Response sample:

"{
"Pageno":1,
"Totalrows":3,
"Responserows":3,
"Data":
[{"Contact Name":"Mr. Amit Jasani","Company Name":"Smartnet
Infotech","Mobile":"9819728316"},
{"Contact Name":"Mr. Gaurav Agarwal","Company Name":"Krisha
Impex","Mobile":"9819631007"},
{"Contact Name":"Mr. B.K. Bhatiya (Hindi Person)","Company Name":"Samrath
Services","Mobile":"9981997777"}]}"

pageno - current page number.


totalrows - total no. of records available.
responserows - no. of records got by request
Scenario 5:To get the record that assigned to particular user today.
( here, we are going to use two conditions combined together in
searchcondition,likewise we can do more than one condition as long as it fits the logic
for search )
● Chose formname as “Leads” and operation as "getRecordsBySearch".
● For example, here we chose three fields as displayfield.
( "Contact Name","Company Name",”Email”,”Mobile”,”Assigned To” ).
● Pageno as 1 and number records as 100.
● First condition: To get todays record the condition is to be like this format (Lead
Date@Today@StartingDate|EndingDate@AND). Today means both the StartingDate
and EndingDate is same, so here we take condition as ( Lead
Date@Today@2017-08-11|2017-08-11@AND )
● Second condition: Inorder to get a record related to particular user, searchfield
is to be like this ( Assigned To@is@USERNAME ).Replace the USERNAME in above
condition as you require. For example, here we take USERNAME in condition like this (
"Assigned To@is@Aravindh")
● Combine two Condition: now we are going to combine above two condition like
this format. ( First condition@AND\$Second condition@AND$ ).after entering the
condition it will be like this
( "Lead Date@Today@2017-08-11|2017-08-11@AND\$Assigned
To@is@Aravindh@AND$" )

Request sample:
{
"apikey":"dmlub3RoJEAyIyMyMDE3LTA4LTExIDE2OjUwOjE3",
"formname":"Leads",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Email","Mobile","Assigned To"],
"Pageno":1,
"Numofrecords":100,
"sortcolumn":"Mobile",
"Sortorder":"desc",
"Isnull":1,
"searchcondition":"Lead Date@Today@2017-08-11|2017-08-11@AND\$Assigned
To@is@Aravindh@AND$"
}

Response sample:
"{
"Pageno":1,
"Totalrows":1,
"Responserows":1,
"Data":
[
{
"Contact Name":"test",
"Company Name":"test",
"Mobile":"",
"Assigned To":"Aravindh"
}
]
}"
For reference
Refer getRecordsBySearch.php in same folder.

getRecordsByTemplate

Purpose
You can use this operation to search records by template of the selected columns.

Parameter Data Type Description

Apikey * String Api key to access crm

Formname * String Specify form name to fetch its


relevant records

Operation * String Specify operation to fetch all


records

displayfields Array To select the required fields


data alone from crm module
pageno Integer Default value is 1.Per page
you can fetch upto 250
records.

numofrecords Integer Maximum 250.Specify value to


limit the record access

sortcolumn String You can select one of the


fields in CRM in to sort the
data.
Ex: sortcolumn=Company
Here, sorting of the data will
happen based on the
Company field

sortorder String Sorting order: asc or desc


If you use the sortcolumn
parameter, by default data is
sorted in ascending order.

isnull Integer isnull=0: To exclude fields


with "null" values while
fetching data from your CRM
account.
isnull=1: To include fields with
"null" values while fetching
data from your CRM account.

templatename String Provide template name to filter


records
* - Mandatory parameter

Request Sample:

{
"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Email","Mobile","Assigned To"],
"Pageno":1,
"Numofrecords":100,
"sortcolumn":"Mobile",
"Sortorder":"desc",
"Isnull":1,
"templatename":"Suresh_Leads"
}

Error Message:

Error Message Description

{"error":"Invalid Template Name"}" Incorrect Template name.Check Template


Name

Example Scenario:

Senario 1: To get the lead records that have lead stage as Hot from Template.
● Chose formname as “Leads” and operation as "getRecordsBySearch".
● For example, here we chose five fields as displayfield.
( "Contact Name","Company Name",”Email”,”Mobile”,”Assigned To”).
● Pageno as 1 and number records as 100.
● To get the leads from view template that have lead stage as Hot,give the
templatename as (Hot Leads).
● Verify and give correct templatename for successful request.

Request sample:
{
"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU=",
"formname":"Leads",
"operation":"getRecordsBySearch",
"Displayfields":["Contact Name","Company Name","Email","Mobile","Assigned To"],
"Pageno":1,
"Numofrecords":100,
"sortcolumn":"Mobile",
"Sortorder":"desc",
"Isnull":1,
"templatename":"Hot Leads"
}

Response sample:

{
"Pageno":1,
"Totalrows":6,
"Responserows":6,
"Data":
[{"Contact Name":"Mr. Navab Rajan","Company
Name":"Negm","Mobile":"9745188823","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Nikhil","Company
Name":"Kindersports","Mobile":"9623369464","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Debasish","Company
Name":"Eugenix","Mobile":"9599803060","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Shivprakash","Company Name":"MEC SHOT BLASTING
EQUIPMENTS","Mobile":"9530053850","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Madan","Company Name":"Future development Consumption
Company","Mobile":"9145067847","Assigned To":"Aravindh"},
{"Contact Name":"Mr. Parth Pathak","Company Name":"Sneh World
Studio","Mobile":"8866003372","Assigned To":"Aravindh"}]
}"

pageno - current page number.


totalrows - total no. of records available.
responserows - no. of records got by request

Scenario 2: Get last 7 days Oppotunity records using template.


● Chose formname as “Opportunities” and operation as "getRecordsBySearch".
● For example, here we chose five fields as displayfield.
( "Contact Name","Company Name",”Email”,”Mobile”,”Assigned To”).
● Pageno as 1 and number records as 100.
● To get the leads from view template that have lead stage as Hot,give the
templatename as (Last 7 Days).
● Verify and give correct templatename for successful request.

Request sample:

{
"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU=",
"formname":"Opportunities",
"operation":"getRecordsBySearch",
"displayfields":["Contact Name","Company Name","Email","Mobile","Assigned To"],
"Pageno":1,
"Numofrecords":100,
"sortcolumn":"Mobile",
"Sortorder":"desc",
"Isnull":1,
"templatename":"Last 7 Days"
}

Response sample:

{
"Pageno":1,
"Totalrows":5,
"Responserows":5,
"Data":
[{"Contact Name":"Mr. Pankaj","Company
Name":"Intellistocks","Mobile":"9999404366","Email":"[email protected]","Assig
ned To":"Aravindh"},
{"Contact Name":"Mr. Amit Jasani","Company Name":"Smartnet
Infotech","Mobile":"9819728316","Email":"[email protected]","Assigned
To":"Aravindh"},
{"Contact Name":"Mr. Karan Singh","Company Name":"Sowar Private
Limited","Mobile":"9810518432","Email":"[email protected]","Assigned
To":"Aravindh"},
{"Contact Name":"Mr. Kirti","Company Name":"Swikar
Garments","Mobile":"9322287939","Email":"[email protected]","Assigned
To":"Aravindh"},
{"Contact Name":"Mr. Thomas","Company Name":"Sun
Estates","Mobile":"9075097917","Email":"[email protected]","Assigned
To":"Aravindh"}]
}"
pageno - current page number.
totalrows - total no. of records available.
responserows - no. of records got by request
For reference:
Refer getRecordsByTemplate.php in same folder.

getRelatedrecords

Purpose
To fetch all subtable or related records of given base record details.

Parameter Data Type Description

Apikey * String Api key to access crm

Formname * String Specify form name to fetch its


relevant records

Operation * String Provide operation to perform

id* Integer Specify base form id to get


all subtable information

isnull Integer isnull=0: To exclude fields


with "null" values while
fetching data from your CRM
account.
isnull=1: To include fields
with "null" values while
fetching data from your CRM
account.
* - Mandatory parameter

Request Sample

{"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"getRelatedRecord",
"Id":2817,
"isnull":1}

Error Message:

Error Message Description

{"error":"Please specify id"}" ID value is zero. Enter correct ID

Example Scenario:

Scenario 1: To get all Subtable records that are related to particular Lead using ID.
● Chose formname as “Leads” and operation as "getRelatedRecords".
● Inorder to get all subtable values that are related to particular lead,we have to
give correct ID, eg:3458.

Request sample:

{
"apikey":"dGVzdCRAMzcjIzIwMTctMDgtMDkgMTA6MTQ6NTU="
,"formname":"Leads",
"operation":"getRelatedRecord",
"Id":3458,
"Isnull":1
}

Response sample:

{
"Leads_Mailing_History":[],

"Leads_History":[{"Time Line":"00:00:00","Assigned To":"Aravindh","Lead


Stage":"New","Next Followup":null,"Next Action":null,"Updated
Username":"Aravindh","Updated Time":"2017-07-26 05:50:38"}],
"Outbound_Mails":[],

"Outbound_SMS":[{"Mobile No":"9080501289","SMS Content":"Hi, Aravindh! A new lead


has been assigned for you, Company: Smartbridge Trading Solutions Pvt Ltd, Contact:
Pankaj Bhagchandani, Mobile: 9811416700. Logon CRATIO for more
details.","Status":"Success","Delivered Time":"2017-07-26 05:50:39"}],

"Call_Log":[],

"Activities":[{"Assigned To":"Aravindh","Notes":"1 user, Not interested for 5


user","Status":"Closed","Due Date":"2017-07-26
07:02:00","Comments":"","Type":"Notes","Created Date\/ Time":"2017-07-26 07:02:00"}],

"Documents":[]
}"

For reference
Refer getRelatedrecords.php for your reference.

insertRecords

Purpose
You can use the insertRecords operation to insert records into the required CRM
module.
Important: Use the POST operation to pass these parameters instead of GET
operation.

Parameter Data Type Description

apikey * String Provide api key to access


crm module

formname * String Specify crm module to


perform operation
operation * String Specify valid operation

overwrite String true-it overwrite the


records when duplicate
found.
false-it skip the duplicate
handle operation

records Array Specify records sets in


array
* - Mandatory parameter

Request Sample

{
"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"false",
"Records":
[
{
"Contact Name":"Prabhu1",
"Company Name":"Quick Sales1",
"Email":"[email protected]",
"Mobile":"9710247372",
"Assigned To":"Prabhu",
"Lead Date":"2017-08-05"
},
{
"Contact Name":"Prabhu2",
"Company Name":"Quick Sales2",
"Email":"[email protected]",
"Mobile":"9710247373",
"Assigned To":"Prabhu",
"Lead Date":"2017-08-05"}
]
}
Error Message:

Error Message Description

“ {"error":"{\"success\":\"Deleted\"} Already Existed record with same value is


{\"success\":\"Deleted\"}" Deleted and New Record is been Inserted.

Example Scenario:

Scenario 1: Inserting two record in lead with record duplication enabled.


● Enter the formname as “Leads” and operation as “insertRecords”.
● Enter the fields that to be inserted.for example, here we chose six fields
( Contact name,Company Name,Email,Mobile,Assigned To,Lead Date )
● Lead Date is to be in this format eg.(YYYY-MM-DD or DD-MM-YYYY).
● When the record duplication is enabled,
Incase, if the records that are already exist in Lead is once again inserted means,
instead of overwritting the record, it create new record with another ID.
● Inorder to enable record duplication, give overwrite value as “false”.
● Once the record is created with overwrite value as “false”, new ID will be given
to it.
Request sample:
{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTQ6NDE6MjA=",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"false",
"Records":
[
{
"Contact Name":"vinoth",
"Company Name":"Cratio",
"Email":"[email protected]",
"Mobile":"9797979797",
"Assigned To":"",
"Lead Date":"2017-08-07"
},
{
"Contact Name":"Bharathi",
"Company Name":"Cratio2",
"Email":"[email protected]",
"Mobile":"8189890706",
"Assigned To":"",
"Lead Date":"2017-08-07"}
]
}
Response sample:

"{
"Success":
[
{
"Rowindex":1,
"Formid":3683,
"Info":"created"
},
{
"Rowindex":2,
"Formid":3684,
"Info":"created"
}
]
}"
Rowindex - represents row of the record inserted.
Formid - represents ID of the record inserted.
Info - represents the action that performed.

Scenario 2: Inserting two record that are already exist in lead with record duplication
disabled.
● Enter the formname as “Leads” and operation as “insertRecords”.
● Enter the fields that to be inserted.for example, here we chose six fields
( Contact name,Company Name,Email,Mobile,Assigned To,Lead Date )
● Lead Date is to be in this format eg.(YYYY-MM-DD or DD-MM-YYYY).
● When the record duplication is disabled,
Incase, if the records that are already exist in Lead is once again inserted means,it
overwrite the record with same ID.
● Inorder to disable record duplication, give overwrite value as “true”.

Request sample:

{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTQ6NDE6MjA=",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"true",
"Records":
[
{
"Contact Name":"vinoth",
"Company Name":"Cratio",
"Email":"[email protected]",
"Mobile":"9797979797",
"Assigned To":"",
"Lead Date":"2017-08-07"
},
{
"Contact Name":"Bharathi",
"Company Name":
"Cratio2",
"Email":"[email protected]",
"Mobile":"8189890706",
"Assigned To":"",
"Lead Date":"2017-08-07"
}
]
}

Response sample:

“{
"Success":
[
{
"Rowindex":1,
"Formid":"3683",
"Info":"updated"
},
{
"Rowindex":2,
"Formid":"3684"
,"info":"updated"
}
]
}"

Rowindex - represents row of the record inserted.


Formid - represents ID of the record inserted.
Info - represents the action that performed.

Scenario 3: To Insert records in lead form with Date and Time value
● Enter the formname as “Leads” and operation as “insertRecords”.
● Enter the fields that to be inserted.for example, here we chose seven fields
( Contact name,Company Name,Email,Mobile,Lead Stage,Assigned To,Time Test ).
● Here,Time Test is date and time field.
● Lead Date is to be in this format eg.(YYYY-MM-DD or DD-MM-YYYY).and Time
is to be in this format ( hh:mm TT (TT is AM or PM) or hh:mm:ss (24 hours format) ).
● For Date and Time field, format is to be like this ( DATE TIME ).
● For example, we are inserting Date and Time value as ( 09-08-2017 10:21 PM )

Request sample:

{
"apikey":"QXJhdmluZCRAMzcjIzIwMTctMDgtMTYgMTE6MDE6MjI=",
"formname":"Leads",
"operation":"insertRecords",
"Overwrite":"false",
"Records":
[
{
"Contact Name":"Bharathi1",
"Company Name":"Cratio1",
"Email":"[email protected]",
"Mobile":"9790606709",
"Lead Stage":"Yet To Talk",
"Assigned To":"",
"Time Test":"09-08-2017 10:21 PM"
},
{
"Contact Name":"Bharathi2",
"Company Name":"Cratio2",
"Email":"[email protected]",
"Mobile":"8189890706",
"Lead Stage":"Hot",
"Assigned To":"",
"Time Test":"09-08-2017 10:21 PM"
}
]
}
Response sample:
“{
"Success":
[
{
"Rowindex":1,
"Formid":3462,
"Info":"created"
}
,
{
"Rowindex":2,
"Formid":3463,
"Info":"created"
}
]
}"

Rowindex - represents row of the record inserted.


Formid - represents ID of the record inserted.
Info - represents the action that performed.

For reference
Refer insertRecords.php in same folder.

updateRecords

Purpose

You can use the updateRecords operation to update or modify the records in CRM.
Important: Use the POST operation to pass these parameters instead of GET
operation.
Parameter Data Type Description

apikey * String Provide api key to access


crm module

formname * String Specify crm module to


perform operation

operation * String Specify valid operation

records Array Specify records sets in


array
* - Mandatory parameter

Request Sample

{"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"updateRecords",
"Records":
[
{
"Form ID":"3522",
"Contact Name":"Prabhu11",
"Company Name":"Quick Sales11",
"Email":"[email protected]",
"Mobile":"9710247372",
"Assigned To":"Suresh Shamalan",
"Lead Date":"2017-08-05"
}
,{
"Form ID":"3523",
"Contact Name":"Prabhu22",
"Company Name":"Quick Sales22",
"Email":"[email protected]",
"Mobile":"9710247373",
"Assigned To":"Suresh Shamalan",
"Lead Date":"2017-08-05"
}
]
}

Error Message:

Error Message Description

"{"error":[{"rowindex":1,"formid":"3522","info":"re Incorrect FormID or record not found for


cord not found"}] }” that FormID

Example Scenario:

Scenario 1: To update a particular lead record based on its ID.


● Enter the formname as “Leads” and operation as “updateRecords”.
● Enter Form ID of the lead record that is to be updated, followed by the fields
● Here we chose six fields ( Contact name,Company
Name,Email,Mobile,Assigned To,Lead Date ).
● Lead Date is to be in this format eg.( YYYY-MM-DD or DD-MM-YYYY ).

Request sample:
{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTQ6NDE6MjA=",
"formname":"Leads",
"operation":"updateRecords",
"Records":
[
{
"Form ID":"3671",
"Contact Name":"Bharathi",
"Company Name":"Bharathi Electronics",
"Email":"[email protected]",
"Mobile":"9710247372",
"Assigned To":"vinoth",
"Lead Date":"2017-08-05"
},
{
"Form ID":"3672",
"Contact Name":"vinoth",
"Company Name":"vinoth constructions",
"Email":"[email protected]",
"Mobile":"9710247370",
"Assigned To":"vinoth",
"Lead Date":"2017-08-05"
}
]
}

Response sample:

"{
"Success":
[
{
"Rowindex":1,
"Info":"updated"
},
{
"Rowindex":2,
"Info":"updated"
}
]
}"

Rowindex - represents row of the record inserted.


Formid - represents ID of the record inserted.
Info - represents the action that performed.

For reference
Refer updateRecords.php in Source Code folder.

deleteRecords

Purpose
You can use this operation to delete the selected record (you must specify unique ID of
the record)

Parameter Data Type Description

apikey * String Provide api key to access


crm module

formname * String Specify crm module to


perform operation

operation * String Specify valid operation

Deletedids* Array Specify listed unique ids in


array format

* - Mandatory parameter

Request Sample

{
"apikey":"Y3JhdGlvJEAwIyMyMDE3LTA4LTAzIDEyOjQ5OjM0",
"formname":"Leads",
"operation":"deleteRecords",
"Deletedids":["3522","3523"]
}

Example Scenario:
Scenario 1: To delete a lead record based on its ID.
● Enter the formname as “Leads” and operation as deleteRecords”.
● To perform delete operation, ID is important.
● Verity and enter the correct ID. eg: “Deletedids” : “[“3671”]”

Request sample:

{
"apikey":"dGVzdCRAMTIjIzIwMTctMDgtMDkgMTY6MzQ6NDI=",
"formname":"Leads",
"operation":"deleteRecords",
"Deletedids":["3671","3672"]
}

Response sample:
"{
"success":"Deleted Successfully"
}"

You might also like