API Guide

SF10 Rest API V 2.0

Overview

 Soffront offers REST based web service for integrating with CRM platform. At Soffront we look forward to make your life easier, by providing a cloud solution to empower businesses in Sales, Marketing, Customer Service, and Business Management efforts. Soffront API is designed to be intuitive and easy to integrate. It is based on a REST (Representational State Transfer) architecture inheriting all the simplicity the Web has to offer as a platform for distributed computing. It utilizes JSON (JavaScript Object Notation) to send back data to the caller. JSON is easily readable and can be parsed easily with different programming languages. Request for the service can be made by using normal HTTP GET or POST method. A token based authentication system is there for method access authorization.

It is assumed that the developer who uses this API is familiar with the following topics.

1.    REST API

2.    JSON and JSON parsers

3.    HTTP communications

Note: In case you intend to host your client in a different domain then you need to use “Cross-Origin Resource (COR) Sharing” supported calls like JSONP.

Authentication

Ideally, for authentication, it would support both oAuth and tokens. In current implementation it considers only the basic token-based authentication.

Note: To enable Web Services please contact Soffront Support.

Token

The token is obtained after proper authentication. The token method will return a time sensitive token to the developer. It is a string that needs to be retained and passed with all other methods for authentication purpose.

URI:

<URI>/token/{developerKey}/{userName}/{password}

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  •  Developer key (mandatory)
  •  Username (mandatory) – CRM user name.
  • Password (mandatory) – CRM password.

The response elements:

 Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]

  •  Message – status message.
  •  Token

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>Token</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>Verify the user credentials & generate api token.</td>

</tr>

<tr>

<td>Developer Key : </td>

<td>

<input type=”text” id=”txtDeveloperKey” value=”” size=”50″ />

</td>

</tr>

<tr>

<td>User Name : </td>

<td>

<input type=”text” id=”txtUserName” value=”admin ” size=”50″ />

</td>

</tr>

<tr>

<td>Password : </td>

<td>

<input type=”text” id=”txtPassword” value=”welcome123 ” size=”50″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td><input type=”button” value=”Generate Token” onclick=”fnGetApiToken();” />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”Token”></td>

</tr>

</table>

 

Javascript:

function fnGetApiToken()

{

$.getJSON(“token/” + $(“#txtDeveloperKey”).val() + “/” + $(“#txtUserName”).val() + “/” + $(“#txtPassword”).val(),

function (data) {

$(‘#Token’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#Token’).text(‘Error: ‘ + err);

});

}

 

Response JSON:

{“Status”:1,”Message”:””,”Token”:”U1FMVFJBQ0tTRVJWRVJ8U0YxMHxhZG1pbnx3ZWxjb21lMTIzfE1qQXhNaTh4TWk4d05Yd3dORG94TUE9PQ==”}

Find

Find CRM for records of a particular object based on some search condition.

URI:

<URI>/find/{apiKey}/{objectName}/{fieldsName}/?{condition}={Search string}

<URI>/find/{apiKey}/{objectName}/?{condition}={Search string}

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  •   Api Key (mandatory)
  •  Object (mandatory) – table name
  • Columns (optional) –the columns returned in the results. If not specified, it will return all fields.Search string (mandatory)

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  •  Message – status message.
  • Results – the result set.
  • Count – number of records returned.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>Find</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>Find CRM for records of a particular object based on some search condition.</td>

</tr>

<tr>

<td>Api Key : </td>

<td><input type=”text” id=”txtFind_ApiKey” size=”50″ />    </td>

</tr>

<tr>

<td>Object : </td>

<td><input type=”text” id=”txtFindObject” size=”50″ />

</td>

</tr>

<tr>

<td>Fields :</td>

<td><input type=”text” id=”txtFindFields” size=”50″ />

</td>

</tr>

<tr>

<td>Condition : </td>

<td><input type=”text” id=”txtFindCondition” size=”50″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td><input type=”button” value=”Search” onclick=”fnSearch();” /></td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”searchResult”></td>

</tr>

</table>

Javascript:

function fnSearch() {

var url = ”;

if ($(“#txtFindFields”).val() != “”)

url = “find/” + $(“#txtFind_ApiKey”).val() + “/” + $(“#txtFindObject”).val() + “/” + $(“#txtFindFields”).val() + “/?condition=” + escape($(“#txtFindCondition”).val());

else

url = “find/” + $(“#txtFind_ApiKey”).val() + “/” + $(“#txtFindObject”).val() + “/?condition=” + escape($(“#txtFindCondition”).val());

$.getJSON(url,

function (data) {

$(‘#searchResult’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#searchResult’).text(‘Error: ‘ + err);

});

}

Response JSON:

{“Status”:1,”Message”:””,”Results”:[{“acctid”:1,”company”:”BCD Corp. “,”address1”:”123 Main St “},{“acctid”:2,”company”:”New Moon Company “,”address1”:”111 Moon Dr. “},{“acctid”:5,”company”:”Full Sun Inc “,”address1”:”111 Sunny Lane “},{“acctid”:8,”company”:”Metal Housing Company “,”address1”:”5432 Main St. “},{“acctid”:9,”company”:”The Chemical Co. “,”address1”:”456 Clean Street “},{“acctid”:10,”company”:”Bahama Corp “,”address1”:”789 Breezy Lane “},{“acctid”:11,”company”:”Hi Tech Inc. “,”address1”:”24, Executive Ct., “},{“acctid”:12,”company”:”Half Moon Company “,”address1”:”1220 Half Moon Bay Drive “},{“acctid”:13,”company”:”TestCo Inc. “,”address1”:”123 Fourth Avenue “},{“acctid”:17,”company”:”RC Test Systems “,”address1”:”134, Martin Drive “},{“acctid”:19,”company”:”Big Company “,”address1”:”246 23rd St. “},{“acctid”:22,”company”:”Carson Machines “,”address1”:”4569 Cable Way “}],”Count”:12}

Find Related

This method will return the related (child) records against a record.

URI:

<URI>/findrelated/{apiKey}/{objectName}/{recordId}/{childObjectName}/{fieldsName}

/?{condition}={Search string}

<URI>/findrelated/{apiKey}/{objectName}/{recordId}/{childObjectName}

/?{condition}={Search string}

 

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  • Api Key (mandatory)
  •  Object(mandatory) – This is the main object name.
  • Recordid (mandatory) – This is the main record id.
  •  Relatedobject (mandatory). This is the child object name.
  • Columns (optional) – If not specified, it will return all fields.
  •  Searchstring (mandatory)

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • Message – status message.
  • Results – the result set.
  • Count – number of records returned. 

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>Find Related</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This method will return the related (child) records against a record.</td>

</tr>

<tr>

<td>Api Key :</td>

<td><input type=”text” id=”txtFindRelated_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>Parent Object : </td>

<td><input type=”text” id=”txtFindRelatedObject” size=”50″ />

</td>

</tr>

<tr>

<td>Main Record Id : </td>

<td><input type=”text” id=”txtFindRelatedRecId” size=”50″ />

</td>

</tr>

<tr>

<td>Child Object : </td>

<td><input type=”text” id=”txtFindRelatedChildObject” size=”50″ />

</td>

</tr>

<tr>

<td>Fields : </td>

<td><input type=”text” id=”txtFindRelatedFields” size=”50″ />

</td>

</tr>

<tr>

<td>Condition : </td>

<td><input type=”text” id=”txtFindRelatedCondition” size=”50″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td><input type=”button” value=”Search” nclick=”fnFindRelated();”                                    />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”findRelated”></td>

</tr>

</table>

Javascript:

function fnFindRelated()

{

var url = ”;

if ($(“#txtFindRelatedFields”).val() != “”)

url = “findrelated/” + $(“#txtFindRelated_ApiKey”).val() + “/” + $(“#txtFindRelatedObject”).val() + “/” + $(“#txtFindRelatedRecId”).val() + “/” + $(“#txtFindRelatedChildObject”).val() + “/” + $(“#txtFindRelatedFields”).val() + “/?condition=” + escape($(“#txtFindRelatedCondition”).val());

else

url = “findrelated/” + $(“#txtFindRelated_ApiKey”).val() + “/” + $(“#txtFindRelatedObject”).val() + “/” + $(“#txtFindRelatedRecId”).val() + “/” + $(“#txtFindRelatedChildObject”).val() + “?condition=” + escape($(“#txtFindRelatedCondition”).val());

 

$.getJSON(url,

function (data) {

$(‘#findRelated’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#findRelated’).text(‘Error: ‘ + err);

});

}

 

Response JSON:

{“Status”:1,”Message”:””,”Results”:[{“fname”:”Ron “,”lname”:”Jackson “,”email”:”rjackson@bcd.com “},{“fname”:”Jeff “,”lname”:”Watson “,”email”:”jw@gmail.com “},{“fname”:”Susan “,”lname”:”Sanders “,”email”:”ssaunders@gmail.com “}],”Count”:3}

Create

This method will create a record in CRM.

URI:

<URI>/create/{apiKey}/{objectName}

HTTP Method: Post

Return Format: JSON OBJECT

Parameters:

  •  Api Key (mandatory)
  • Object (mandatory) – table name.
  •  Fieldvalues (mandatory) –field value pairs of the record values.

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  •   Message – status message.
  •  Recordid – Return newly created record id.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>Create Record</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>The create method will create a record.</td>

</tr>

<tr>

<td>Api Key : </td>

<td><input type=”text” id=”txtCreate_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>Object : </td>

<td><input type=”text” id=”txtCreateObject” size=”50″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td>

<table cellpadding=”0″ cellspacing=”0″ border=”1″ width=”100%”>

<tr>

<td>Field Name : </td>

<td>Field Value : </td>

<td>&nbsp; </td>

</tr>

<tr>

<td>

<input type=”text” id=”txtCreateFldName” size=”50″ />

</td>

<td>

<input type=”text” id=”txtCreateFldVal” size=”50″ />

</td>

<td>

<input type=”button” value=”Add” onclick=”fnAddFieldValuePair(‘A’);” />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td>

<input type=”button” value=”Create Record” onclick=”fnCreateRecord();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘A’);” />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”createRecord”></td>

</tr>

<input type=”hidden” id=”txtCreateFldValPair” size=”10″ />

</table>

Javascript [Ajax POST]:

function fnCreateRecord() {

$(‘#createRecord’).html(“”);

var data = “{” + $(“#txtCreateFldValPair”).val() + “}”;

var jqxhr = $.post(“create/” + $(“#txtCreate_ApiKey”).val() + “/” + $(“#txtCreateObject”).val(), { “RecordData”: data })

.success(function (data) {

$(‘#createRecord’).html(JSON.stringify(data));

})

.error(function () {

$(‘#createRecord’).html(“Error posting the update.”);

});

$(‘#txtCreateFldValPair’).val(“”);

}

function fnAddFieldValuePair(type)

{

if (type == “A”) {

var data = $(“#txtCreateFldValPair”).val();

var jsonTxt = “\”” + $(“#txtCreateFldName”).val() + “\” : \”” + escape($(“#txtCreateFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtCreateFldValPair”).val(data);

$(“#txtCreateFldName”).val(“”);

$(“#txtCreateFldVal”).val(“”);

$(“#createRecord”).html(data);

}

else if (type == “L”) {

var data = $(“#txtCreateRelatedFldValPair”).val();

var jsonTxt = “\”” + $(“#txtCreateRelatedFldName”).val() + “\” : \”” + escape($(“#txtCreateRelatedFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtCreateRelatedFldValPair”).val(data);

$(“#txtCreateRelatedFldName”).val(“”);

$(“#txtCreateRelatedFldVal”).val(“”);

$(“#createRelatedRecord”).html(data);

}

else if (type == “U”) {

var data = $(“#txtUpdateFldValPair”).val();

var jsonTxt = “\”” + $(“#txtUpdateFldName”).val() + “\” : \”” + escape($(“#txtUpdateFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtUpdateFldValPair”).val(data);

$(“#txtUpdateFldName”).val(“”);

$(“#txtUpdateFldVal”).val(“”);

$(“#updateRecord”).html(data);

}

}

Response JSON:

{“Status”:1,”Message”:”Record added successfully.”,”RecordId”:40}

Add Related

This method will add related records against a record.

URI:

<URI>/addrelated/{apiKey}/{parentObjectName}/{parentRecordId}/{objectName}

HTTP Method: Post

Return Format: JSON OBJECT

Parameters:

  • Api Key (mandatory)
  •  Object(mandatory). This is the main object name.
  •  Recordid (mandatory). This is the main record id.
  • Relatedobject (mandatory). This is the child object name.
  •  Fieldvalues (mandatory) –field value pairs of the child record values.

The response elements:

  •  Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  •  Message – status message.
  •  Recordid – Return newly created record id.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>Add Related Record</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This will create & Link child record.</td>

</tr>

<tr>

<td>Api Key : </td>

<td><input type=”text” id=”txtCreateRelated_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>Parent Object : </td>

<td><input type=”text” id=”txtCreateRelatedParentObject” size=”50″ />

</td>

</tr>

<tr>

<td>Parent Id : </td>

<td>

<input type=”text” id=”txtCreateRelatedParentId” size=”10″ />

</td>

</tr>

<tr>

<td>Object : </td>

<td><input type=”text” id=”txtCreateRelatedObject” size=”50″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td>

<table cellpadding=”0″ cellspacing=”0″ border=”1″ width=”100%”>

<tr>

<td>Field Name : </td>

<td>Field Value : </td>

<td>&nbsp; </td>

</tr>

<tr>

<td><input type=”text” id=”txtCreateRelatedFldName” size=”50″ />

</td>

<td><input type=”text” id=”txtCreateRelatedFldVal” size=”50″ />

</td>

<td><input type=”button” value=”Add” onclick=”fnAddFieldValuePair(‘L’);” />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td><input type=”button” value=”Create Child Record” onclick=”fnCreateRelatedRecord();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘L’);” />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”createRelatedRecord”></td>

</tr>

<input type=”hidden” id=”txtCreateRelatedFldValPair” size=”10″ />

</table>

 

Javascript [Ajax POST]:

function fnCreateRelatedRecord()

{

$(‘#createRelatedRecord’).html(“”);

var data = “{” + $(“#txtCreateRelatedFldValPair”).val() + “}”;

var jqxhr = $.post(“addrelated/” + $(“#txtCreateRelated_ApiKey”).val() + “/” + $(“#txtCreateRelatedParentObject”).val() + “/” + $(“#txtCreateRelatedParentId”).val() + “/” + $(“#txtCreateRelatedObject”).val(), { “RecordData”: data })

.success(function (data) {

$(‘#createRelatedRecord’).html(JSON.stringify(data));

})

.error(function () {

$(‘#createRelatedRecord’).html(“Error posting the update.”);

});

$(‘#txtCreateRelatedFldValPair’).val(“”);

}

function fnAddFieldValuePair(type)

{

if (type == “A”) {

var data = $(“#txtCreateFldValPair”).val();

var jsonTxt = “\”” + $(“#txtCreateFldName”).val() + “\” : \”” + escape($(“#txtCreateFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtCreateFldValPair”).val(data);

$(“#txtCreateFldName”).val(“”);

$(“#txtCreateFldVal”).val(“”);

$(“#createRecord”).html(data);

}

else if (type == “L”) {

var data = $(“#txtCreateRelatedFldValPair”).val();

var jsonTxt = “\”” + $(“#txtCreateRelatedFldName”).val() + “\” : \”” + escape($(“#txtCreateRelatedFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtCreateRelatedFldValPair”).val(data);

$(“#txtCreateRelatedFldName”).val(“”);

$(“#txtCreateRelatedFldVal”).val(“”);

$(“#createRelatedRecord”).html(data);

}

else if (type == “U”) {

var data = $(“#txtUpdateFldValPair”).val();

var jsonTxt = “\”” + $(“#txtUpdateFldName”).val() + “\” : \”” + escape($(“#txtUpdateFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtUpdateFldValPair”).val(data);

$(“#txtUpdateFldName”).val(“”);

$(“#txtUpdateFldVal”).val(“”);

$(“#updateRecord”).html(data);

}

}

Response JSON:

{“Status”:1,”Message”:”Record added successfully.”,”RecordId”:531}

Update

This method will update a record in CRM.

URI:

<URI>/update/{apiKey}/{objectName}/{recordId}

HTTP Method: Post

Return Format: JSON OBJECT

Parameters:

  •  Api Key (mandatory)
  •  Object (mandatory) – table name.
  •  Recordid (mandatory).
  •  Fieldvalues (mandatory) –field value pairs of the record values.

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  •  Message – status message. 

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>Update Record</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This method to update a record.</td>

</tr>

<tr>

<td>Api Key : </td>

<td><input type=”text” id=”txtUpdate_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>Object : </td>

<td><input type=”text” id=”txtUpdateObject” size=”50″ />

</td>

</tr>

<tr>

<td>Record Id : </td>

<td><input type=”text” id=”txtUpdateRecordId” size=”10″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td>

<table cellpadding=”0″ cellspacing=”0″ border=”1″ width=”100%”>

<tr>

<td>Field Name : </td>

<td>Field Value : </td>

<td>&nbsp; </td>

</tr>

<tr>

<td><input type=”text” id=”txtUpdateFldName” size=”50″ />

</td>

<td><input type=”text” id=”txtUpdateFldVal” size=”50″ />

</td>

<td><input type=”button” value=”Add”                                   onclick=”fnAddFieldValuePair(‘U’);” />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td><input type=”button” value=”Update Record” onclick=”fnUpdateRecord();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘U’);” />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”updateRecord”></td>

</tr>

<input type=”hidden” id=”txtUpdateFldValPair” size=”10″ />

</table>

 

Javascript [Ajax POST]:

function fnUpdateRecord()

{

$(‘#updateRecord’).html(“”);

var data = “{” + $(“#txtUpdateFldValPair”).val() + “}”;

var jqxhr = $.post(“update/” + $(“#txtUpdate_ApiKey”).val() + “/” + $(“#txtUpdateObject”).val() + “/” + $(“#txtUpdateRecordId”).val(), { “RecordData”: data })

.success(function (data) {

$(‘#updateRecord’).html(JSON.stringify(data));

})

.error(function () {

$(‘#updateRecord’).html(“Error posting the update.”);

});

}

 

function fnAddFieldValuePair(type)

{

if (type == “A”) {

var data = $(“#txtCreateFldValPair”).val();

var jsonTxt = “\”” + $(“#txtCreateFldName”).val() + “\” : \”” + escape($(“#txtCreateFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtCreateFldValPair”).val(data);

$(“#txtCreateFldName”).val(“”);

$(“#txtCreateFldVal”).val(“”);

$(“#createRecord”).html(data);

}

else if (type == “L”) {

var data = $(“#txtCreateRelatedFldValPair”).val();

var jsonTxt = “\”” + $(“#txtCreateRelatedFldName”).val() + “\” : \”” + escape($(“#txtCreateRelatedFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtCreateRelatedFldValPair”).val(data);

$(“#txtCreateRelatedFldName”).val(“”);

$(“#txtCreateRelatedFldVal”).val(“”);

$(“#createRelatedRecord”).html(data);

}

else if (type == “U”) {

var data = $(“#txtUpdateFldValPair”).val();

var jsonTxt = “\”” + $(“#txtUpdateFldName”).val() + “\” : \”” + escape($(“#txtUpdateFldVal”).val()) + “\””;

if (data != “”)

data = data + “, ” + jsonTxt;

else

data = jsonTxt;

$(“#txtUpdateFldValPair”).val(data);

$(“#txtUpdateFldName”).val(“”);

$(“#txtUpdateFldVal”).val(“”);

$(“#updateRecord”).html(data);

}

}

 

Response JSON:

{“Status”:1,”Message”:”Record updated successfully.”,”RecordId”:40}

Delete

This method will delete a record from CRM.

URI:

<URI>/ delete/{apiKey}/{objectName}/{recordId}

 

HTTP Method: Post

Return Format: JSON OBJECT

Parameters:

  •  Api Key (mandatory)
  • Object (mandatory) – table name.
  •  Recordid (mandatory).

The response elements:

  •  Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • Message – status message.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>Delete Record</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This method will delete a record.</td>

</tr>

<tr>

<td>Api Key : </td>

<td><input type=”text” id=”txtDelete_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>Object : </td>

<td><input type=”text” id=”txtDeleteObject” size=”50″ />

</td>

</tr>

<tr>

<td>Record Id : </td>

<td>

<input type=”text” id=”txtDeleteRecordId” size=”10″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td><input type=”button” value=”Delete Record” onclick=”fnDeleteRecord();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘D’);” />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”deleteRecord”></td>

</tr>

</table>

Javascript :

function fnDeleteRecord() {

$(‘#deleteRecord’).html(“”);

var jqxhr = $.post(“delete/” + $(“#txtDelete_ApiKey”).val() + “/” + $(“#txtDeleteObject”).val() + “/” + $(“#txtDeleteRecordId”).val())

.success(function (data) {

$(‘#deleteRecord’).html(JSON.stringify(data));

})

.error(function () {

$(‘#deleteRecord’).html(“Error posting the delete.”);

});

}

 

Response JSON:

{“Status”:1,”Message”:”Record deleted successfully.”,”RecordId”:531}

Get Objects

This method will return a list of all objects (user tables) in the project.

URI:

<URI>/objects/{apiKey}

<URI>/objects/{apiKey}/{id}

 

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  •  Api Key (mandatory)

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  •  Message – status message.
  • Results – the result set. 

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>All Objects</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This method will return a list of all objects in the project.</td>

</tr>

<tr>

<td>Api Key : </td>

<td><input type=”text” id=”txtAllObj_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>&nbsp; </td>

<td><input type=”button” value=”Populate Objects” onclick=”fnPopulateObjects();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘O’);” />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”objects”></td>

</tr>

<tr>

<td>Find By : </td>

<td>

<table cellpadding=”0″ cellspacing=”0″>

<tr>

<td>

<select id=”selFindBy”>

<option value=”id”>Id</option>

<option value=”name”>Name</option>

<option value=”label”>Label</option>

</select>

</td>

<td><input type=”text” id=”txtFindBy” size=”50″ />

</td>

<td><input type=”button” value=”Search” onclick=”fnFindObject();” />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”object”></td>

</tr>

</table>

 

Javascript :

function fnPopulateObjects()

{

.getJSON(“objects/” + $(“#txtAllObj_ApiKey”).val(),

function (data) {

$(‘#objects’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#object’).text(‘Error: ‘ + err);

});

}

 

function fnFindObject()

{

var findBy = $(‘#selFindBy’).val();

var searchText = $(‘#txtFindBy’).val();

$(‘#object’).text(“”);

if (findBy == “id”) {

$.getJSON(“objects/” + $(“#txtAllObj_ApiKey”).val() + “/” + searchText,

function (data) {

$(‘#object’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#object’).text(‘Error: ‘ + err);

});

}

else {

$.getJSON(“objects/” + $(“#txtAllObj_ApiKey”).val() + “?” + findBy + “=” + searchText,

function (data) {

$(‘#object’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#object’).text(‘Error: ‘ + err);

});

}

}

 

Response JSON:

[{“Id”:1,”Name”:”Account”,”Label”:”Accounts”}]

Get Fields

This method will return a list of all fields for an object.

URI:

<URI>/fields/{apiKey}/{objectName}

<URI>/fields/{apiKey}/{objectName}/{id}

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  • Api Key (mandatory)
  •  Object (mandatory) – table name. 

The response elements:

  •  Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • Message – status message.
  • Results – the result set. 

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″><h3>All Fields</h3></td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This method will return a list of all fields for an object.</td>

</tr>

<tr>

<td>Api Key : </td>

<td><input type=”text” id=”txtField_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>Object : </td>

<td><input type=”text” id=”txtObject” size=”50″ /></td>

</tr>

<tr>

<td>&nbsp; </td>

<td>

<input type=”button” value=”Populate Fields” onclick=”fnPopulateFields();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘F’);” />

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”fields”></td>

</tr>

<tr>

<td>Find By :</td>

<td>

<table cellpadding=”0″ cellspacing=”0″>

<tr>

<td>

<select id=”selFindByField”>

<option value=”id”>Id</option>

<option value=”name”>Name</option>

<option value=”label”>Label</option>

</select>

</td>

<td>

<input type=”text” id=”txtFindByField” size=”50″ />

</td>

<td>

<input type=”button” value=”Search” onclick=”fnFindField();” />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td valign=”top”><strong>Result :</strong></td>

<td id=”field”></td>

</tr>

</table>

 

Javascript :

function fnPopulateFields()

{

$.getJSON(“fields/” + $(“#txtField_ApiKey”).val() + “/” + $(“#txtObject”).val(),

function (data)

{

$(‘#fields’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#fields’).text(‘Error: ‘ + err);

});

}

 

function fnFindField()

{

var findBy = $(‘#selFindByField’).val();

var searchText = $(‘#txtFindByField’).val();

$(‘#field’).text(“”);

if (findBy == “id”) {

$.getJSON(“fields/” + $(“#txtField_ApiKey”).val() + “/” + $(“#txtObject”).val() + “/” + searchText,

function (data)

{

$(‘#field’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#field’).text(‘Error: ‘ + err);

});

}

else

{

$.getJSON(“fields/” + $(“#txtField_ApiKey”).val() + “/” + $(“#txtObject”).val() + “/?” + findBy + “=” + searchText,

function (data)

{

$(‘#field’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#field’).text(‘Error: ‘ + err);

});

}

}

Response JSON:

[{“Id”:465,”Name”:”Subject”,”Label”:”Subject”,”Type”:”TEXT”,”Required”:false,”Size”:”128″}, {“Id”:466,”Name”:”NoteText”,”Label”:”Note Text”,”Type”:”MEMO”,”Required”:false,”Size”:”102″}, {“Id”:461,”Name”:”Record”,”Label”:”Note ID”,”Type”:”ID”,”Required”:false,”Size”:”16″}, {“Id”:464,”Name”:”NoteType”,”Label”:”Note Type”,”Type”:”LIST”,”Required”:true,”Size”:”64″}, {“Id”:1455,”Name”:”Status”,”Label”:”Status”,”Type”:”LIST”,”Required”:true,”Size”:”16″}, {“Id”:462,”Name”:”Author”,”Label”:”Author”,”Type”:”USER_LIST”,”Required”:false,”Size”:”30″}, {“Id”:463,”Name”:”NoteDate”,”Label”:”Date time”,”Type”:”SQL_DATETIME”,”Required”:false,”Size”:”25″}, {“Id”:1454,”Name”:”RCode”,”Label”:”Result Code”,”Type”:”LIST”,”Required”:true,”Size”:”16″}]\

Response JSON:

{“Status”:1,”Message”:”Record added successfully.”,”RecordId”:40}

Link Record

Linking two different types of record in the CRM.

URI:

<URI> / linkrelated / {apiKey} / {parentObjectName} / {parentRecordId} / {childObjectName } / {childRecordId}

HTTP Method: Post

Return Format: JSON OBJECT

Parameters:

  •  Api Key (mandatory)
  •  Parent Object (mandatory). This is the main object name.
  •  Parent Id (mandatory). This is the main record id.
  • Child Object (mandatory). This is the child object name.
  • Child Id (mandatory) – This is the child record id.

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  •  Message – status message.
  • Recordid – Return 0. 

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

11. Link Related Record</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This will Link child record.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtLinkRelated_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>

Parent Object :

</td>

<td>

<input type=”text” id=”txtLinkRelatedParentObject” size=”50″ />

</td>

</tr>

<tr>

<td>

Parent Id :

</td>

<td>

<input type=”text” id=”txtLinkRelatedParentId” size=”10″ />

</td>

</tr>

<tr>

<td>

Child Object :

</td>

<td>

<input type=”text” id=”txtLinkRelatedChildObject” size=”50″ />

</td>

</tr>

<tr>

<td>

Child Id :

</td>

<td>

<input type=”text” id=”txtLinkRelatedChildId” size=”10″ />

</td>

</tr>

 

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Link Child Record” onclick=”fnLinkRelatedRecord();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘LC’);” />

</td>

</tr>

 

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”linkRelatedRecord”>

</td>

</tr>

</table>

 

Javascript [Ajax POST]:

function fnLinkRelatedRecord() {

$(‘#linkRelatedRecord’).html(“”);

var jqxhr = $.post(“linkrelated/” + $(“#txtLinkRelated_ApiKey”).val() + “/” + $(“#txtLinkRelatedParentObject”).val() + “/” + $(“#txtLinkRelatedParentId”).val() + “/” + $(“#txtLinkRelatedChildObject”).val() + “/” + $(“#txtLinkRelatedChildId”).val())

.success(function (data) {

$(‘#linkRelatedRecord’).html(JSON.stringify(data));

})

.error(function () {

$(‘#linkRelatedRecord’).html(“Error posting the update.”);

});

}

Response JSON:

{“Status”:1,”Message”:”contact and note records linked successfully.”,”RecordId”:0}

Fetch Record

To fetch a specific record from the CRM and return to the caller.

URI:

<URI>/fetch / {apiKey} / {objectName} /{recordId}/? { fieldsName }={field string}

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

Api Key (mandatory)

Object (mandatory) – table name

Columns (optional) –the columns returned in the results. If not specified, it will return all fields.

Record ID string (mandatory)

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • Message – status message.
  • object – the object on which the search was performed, like Account or Contact.
  •  recordid – unique id of the fetched record.
  • value_list – JSON Array of JSON objects.  Each JSON object contains name and value elements for each field mentioned in the field list sent during the call and its corresponding value.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

12. Fetch Record</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>To fetch a specific record from the CRM and return to the caller.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtFetch_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>

Object :

</td>

<td>

<input type=”text” id=”txtFetchObject” size=”50″ />

</td>

</tr>

<tr>

<td>

Fields :

</td>

<td>

<input type=”text” id=”txtFetchFields” size=”50″ />

</td>

</tr>

<tr>

<td>

Record :

</td>

<td>

<input type=”text” id=”txtFetchRecord” size=”50″ />

</td>

</tr>

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Search” onclick=”fnFetch();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘SF’);” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”fetchResult”>

</td>

</tr>

</table>

Javascript:

function fnFetch() {

var url = ”;

url = “fetch/” + $(“#txtFetch_ApiKey”).val() + “/” + $(“#txtFetchObject”).val() + “/” + $(“#txtFetchRecord”).val() + “/?fieldsName=” + escape($(“#txtFetchFields”).val());

 

$.getJSON(url,

function (data) {

$(‘#fetchResult’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#fetchResult’).text(‘Error: ‘ + err);

});

}

Response JSON:

{“Status”:1,”Message”:””,”Object”:”note”,”RecordId”:”741″,

“Value_list”:[

{“name”:”Subject”,”value”:”Followup Call”}, {“name”:”NoteText”,”value”:”test”}, {“name”:”Record”,”value”:”741″}, {“name”:”NoteType”,”value”:”Call”}, {“name”:”Status”,”value”:””},{“name”:”Author”,”value”:”admin”},{“name”:”NoteDate”,”value”:”10/31/2013 5:52:24 PM”},{“name”:”RCode”,”value”:””}]}

Search Record

To search the CRM for a set of records of a particular object based on some selection criteria.

URI:

<URI> /search / {apiKey} / {objectName} /?{count}={rowcount}

&{condition}={Search string}&{fieldsName}={columns}
HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  • Api Key (mandatory)
  • Object (mandatory) – table name
  •  Rowcount (optional) – Maximum number of records that can be returned in a single call. If no value is mentioned then a value of 500 is set by the system itself.
  • Search string (optional) – a valid SQL where clause excluding the where keyword.
  • Columns (optional) –the columns returned in the results. If not specified, it will return all fields.  It is a comma separated string of field names. 

The response elements:

  •  Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • Message – status message.
  •  Results – the result set.
  • Count – number of records returned.
  • Columns – JSON Array of the fields mentioned during the call. The result set contains the value.
  • Object – the object on which the search was performed, like Company or Contact.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

13. Search Record</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>To search the CRM for a set of records of a particular object based on some selection criteria.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtSearch_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>

Object :

</td>

<td>

<input type=”text” id=”txtSearchObject” size=”50″ />

</td>

</tr>

<tr>

<td>

Fields :

</td>

<td>

<input type=”text” id=”txtSearchFields” size=”50″ />

</td>

</tr>

<tr>

<td>

Condition :

</td>

<td>

<input type=”text” id=”txtSearchCondition” size=”50″ />

</td>

</tr>

<tr>

<td>

Count :

</td>

<td>

<input type=”text” id=”txtSearchCount” size=”50″ />

</td>

</tr>

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Search” onclick=”fnSearchEx();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘SE’);” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”searchexResult”>

</td>

</tr>

</table>

 

Javascript:

function fnSearchEx() {

var url = ”;

var count=$(“#txtSearchCount”).val();

var condition=$(“#txtSearchCondition”).val();

 

url = “search/” + $(“#txtSearch_ApiKey”).val() + “/” + $(“#txtSearchObject”).val() + “/?count=”+escape(count)+”&condition=” + escape(condition) + “&fieldsName=” + escape($(“#txtSearchFields”).val());

 

$.getJSON(url,

function (data) {

$(‘#searchexResult’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#searchexResult’).text(‘Error: ‘ + err);

});

}

Response JSON:

{“Status”:1,”Message”:””,”Results”:[{“Subject”:”Follow up prospect “,”NoteText”:”Test3″,”Record”:739,”NoteType”:”Meeting “,”Status”:null,”Author”:”admin “,”NoteDate”:”2013-09-30T15:39:13″,”RCode”:null},{“Subject”:”Follow up prospect “,”NoteText”:”test4″,”Record”:740,”NoteType”:”Visit “,”Status”:null,”Author”:”admin “,”NoteDate”:”2013-09-30T15:39:44″,”RCode”:null},{“Subject”:”Followup Call “,”NoteText”:”test”,”Record”:741,”NoteType”:”Call “,”Status”:null,”Author”:”admin “,”NoteDate”:”2013-10-31T17:52:24″,”RCode”:null}],”Count”:3,”Columns”:[“Subject”,”NoteText”,”Record”,”NoteType”,”Status”,”Author”,”NoteDate”,”RCode”],”Object”:”note”}

Find Contact

The find method will return one or more contacts.

URI:

<URI> /findcontact / {apiKey}  /?{count}={rowcount}

&{condition}={Search string}&{fieldsName}={columns}

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

The following search parameters are supported.

  • Company
  •  Email
  •  First Name
  • Last Name
  •  Salesrep

 

Any of these parameters can be combined together.

If no search parameter is passed, it will return all companies accessible to the user account used for the API.

The other parameters are:

  • Api Key (mandatory)
  • Rowcount (optional) – Maximum number of records that can be returned in a single call. If no value is mentioned then a value of 500 is set by the system itself.
  • Search string (optional) – JSON format, ex. { “Company” : “Soffront”, “FName” : “John”}.
  • Columns (optional) –the columns returned in the results. If not specified, it will return all fields. It is a comma separated string of field names.

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • Message – status message.
  •  Results – the result set.
  •  Count – number of records returned.
  •  Columns – JSON Array of the fields mentioned during the call. The result set contains the value.
  • Object – Contact

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

14. Find Contact</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>The find method will return one or more contacts.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtFindContact_ApiKey” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Fields :

</td>

<td>

<input type=”text” id=”txtFindContactFields” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Row Count :

</td>

<td>

<input type=”text” id=”txtFindContactCount” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Find By :

</td>

<td>

<table cellpadding=”0″ cellspacing=”0″ border=”1″ width=”100%”>

<tr>

<td>Field Name :</td>

<td>Field Value :</td>

<td>&nbsp;</td>

</tr>

<tr>

<td>

<select id=”selFindContactBy”>

<option value=”Company”>Company</option>

<option value=”email”>Email</option>

<option value=”FName”>First Name</option>

<option value=”LName”>Last Name</option>

<option value=”SalesRep”>Sales Rep</option>

</select>

 

</td>

<td>

<input type=”text” id=”txtFindContactFldVal” size=”50″ />

</td>

<td>

<input type=”button” value=”Add” onclick=”fnAddFieldValuePair(‘SC’);” />

</td>

</tr>

</table>

</td>

</tr>

 

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Search” onclick=”fnFindContact();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘SC’);” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

<input type=”hidden” id=”txtFindContactPair”  />

</td>

<td >

</td>

</tr>

</table>

<table><tr><td id=”findcontactResult”></td></tr></table>

Javascript:

function fnFindContact() {

var url = ”;

var count = $(“#txtFindContactCount”).val();

var condition = $(“#txtFindContactPair”).val();

if (condition != “”) {

condition = “{” + condition + “}”;

}

url = “findcontact/” + $(“#txtFindContact_ApiKey”).val() + “/?count=” + escape(count) + “&condition=” + escape(condition) + “&fieldsName=” + escape($(“#txtFindContactFields”).val());

$.getJSON(url,

function (data) {

$(‘#findcontactResult’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#findcontactResult’).text(‘Error: ‘ + err);

});

}

Response JSON:

{“Status”:1,”Message”:””,”Results”:[{“Company”:”BCD Corp. “,”SalesRep”:”admin “},{“Company”:”Big Company. “,”SalesRep”:”admin “},{“Company”:”The Chemical Co. “,”SalesRep”:”admin “},{“Company”:”Bahama Corp “,”SalesRep”:”admin “},{“Company”:”New Moon Company “,”SalesRep”:”admin “}],”Count”:5,”Columns”:[“Company”,”SalesRep”],”Object”:”Contact”}

Attach a file to Contact / Attach s file to Record

The attach method will upload and link an attachment with a contact record.

URI:

<URI> /attach / {apiKey} / {Object} / {RecordId}

HTTP Method: Post

Return Format: JSON OBJECT

Parameters:

  •  Api Key (mandatory)
  • Object (mandatory) – table name
  •  Record ID string (mandatory) – unique id of the contact record with whom the attachment will be linked file html multi part form file element through which file will be uploaded

The response elements:

  • Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • Message – status message.
  •  Recordid – unique id of the fetched record.

Example:

HTML:

<form id=”Attachcontact” name=”Attachcontact” encype=”multipart/form-data” method=”Post”>

<table>

<tr>

<td colspan=”2″>

<h3>

16. Attach a file to Contact</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>The attach method will upload and link an attachment with a contact record.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtAttachContact_ApiKey” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Object :

</td>

<td>

<input type=”text” id=”txtAttachObject” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Record Id :

</td>

<td>

<input type=”text” id=”txtAttachRecordId” size=”10″ />

</td>

</tr>

 

<tr>

<td>

File :

</td>

<td>

<input type=”FILE” ID=”uploadfile” name=”uploadfile” size=”10″ />

</td>

</tr>

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Upload” onclick=”fnAttachContact();” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

 

</td>

<td id=”attachcontactResult”>

</td>

</tr>

</table>

</form>

Javascript:

function fnAttachContact() {

var data = $(“#uploadfile”).val();

if (data) {

var file = document.getElementById(‘uploadfile’).files[0];

var formData = new FormData();

formData.append(file.name, file);

var xhr = new XMLHttpRequest();

var url = “attach/” + $(“#txtAttachContact_ApiKey”).val() + “/” + $(“#txtAttachObject”).val() + “/” + $(“#txtAttachRecordId”).val();

xhr.open(‘POST’, url, true);

xhr.onload = function (e) {

if (xhr.readyState == 4) {

var returnedValue = xhr.responseText;

if (xhr.status == 200) {

var returnedJSONObject = JSON.parse(returnedValue);

if (returnedJSONObject != null) {

var message = returnedJSONObject.Message;

var status = returnedJSONObject.Status;

var RecordId = returnedJSONObject.RecordId;

var strReturn = “{\”status\”:” + status + “,\”message\”:\”” + message + “\”,\”recordId\”:” + RecordId + “}”;

$(‘#attachcontactResult’).text(strReturn);

}

 

}

else {

$(‘#attachcontactResult’).text(“Error posting the update.”);

}

}

};

 

xhr.send(formData);  // multipart/form-data

}

}

 

Response JSON:

{“status”:1,”message”:”File attached successfully.”,”recordId”:1}

Add Photo to Contact / Add Photo to Record

The Add Photo method uploads and links an attachment with a contact record that will be displayed as the photo of the contact in the record view in the CRM.

URI:

<URI> /attach / {apiKey} / {Object} / {RecordId}

HTTP Method: Post

Return Format: JSON OBJECT

Parameters:

  • Api Key (mandatory)
  • Object (mandatory) – table name
  •  Record ID string (mandatory) – unique id of the contact record with whom the attachment will be linked file html multi part form file element through which photo will be uploaded

The response elements:

·         Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]

·         Message – status message.

·         Recordid – unique id of the fetched record.

Example:

HTML:

<form id=”Addphotocontact” name=”Addphotocontact” encype=”multipart/form-data” method=”Post”>

<table>

 

<tr>

<td colspan=”2″>

<h3>

17. Add Photo to Contact</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>The addphoto method uploads and links an attachment with a contact record that will

be displayed as the photo of the contact in the record view in the CRM.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtAddPhotoContact_ApiKey” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Object :

</td>

<td>

<input type=”text” id=”txtAddPhotoObject” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Record Id :

</td>

<td>

<input type=”text” id=”txtAddPhotoRecordId” size=”10″ />

</td>

</tr>

 

<tr>

<td>

Photo :

</td>

<td>

<input type=”FILE” ID=”uploadphoto” name=”uploadphoto” size=”10″ />

</td>

</tr>

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Upload” onclick=”fnAddPhotoContact();” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

 

</td>

<td id=”AddPhotoContactResult”>

</td>

</tr>

</table>

</form>

Javascript:

function fnAddPhotoContact() {

var data = $(“#uploadphoto”).val();

if (data) {

var file = document.getElementById(‘uploadphoto’).files[0];

var formData = new FormData();

formData.append(file.name, file);

var xhr = new XMLHttpRequest();

var url = “addphoto/” + $(“#txtAddPhotoContact_ApiKey”).val() + “/” + $(“#txtAddPhotoObject”).val() + “/” + $(“#txtAddPhotoRecordId”).val();

xhr.open(‘POST’, url, true);

xhr.onload = function (e) {

if (xhr.readyState == 4) {

var returnedValue = xhr.responseText;

if (xhr.status == 200) {

var returnedJSONObject = JSON.parse(returnedValue);

if (returnedJSONObject != null) {

var message = returnedJSONObject.Message;

var status = returnedJSONObject.Status;

var RecordId = returnedJSONObject.RecordId;

var strReturn = “{\”status\”:” + status + “,\”message\”:\”” + message + “\”,\”recordId\”:” + RecordId + “}”;

$(‘#AddPhotoContactResult’).text(strReturn);

}

 

}

else {

$(‘#AddPhotoContactResult’).text(“Error posting the update.”);

}

}

 

};

 

xhr.send(formData);  // multipart/form-data

}

}

Response JSON:

{“status”:1,”message”:”Photo added successfully.”,”recordId”:1}

Find Company

The find method will return one or more contacts.

URI:

<URI> /findcompany / {apiKey}  /?{count}={rowcount}

&{condition}={Search string}&{fieldsName}={columns}

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

The following search parameters are supported.

·         company

·         Address1

·         Address2

·         Salesrep

 

Any of these parameters can be combined together.

If no search parameter is passed, it will return all companies accessible to the user account used for the API.

The other parameters are:

·         Api Key (mandatory)

·         Rowcount (optional) – Maximum number of records that can be returned in a single call. If no value is mentioned then a value of 500 is set by the system itself.

·         Search string (optional) – JSON format, ex. { “Company” : “abc”, “SalesRep” : “admin”}.

·         Columns (optional) –the columns returned in the results. If not specified, it will return all fields.

The response elements:

·         Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]

·         Message – status message.

·         Results – the result set.

·         Count – number of records returned.

·         Columns – JSON Array of the fields mentioned during the call. The result set contains the value.

·         Object – Account

Example:

HTML:

<tr>

<td>

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

15. Find Company</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>The find method will return one or more companies.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtFindCompany_ApiKey” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Fields :

</td>

<td>

<input type=”text” id=”txtFindCompanyFields” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Row Count :

</td>

<td>

<input type=”text” id=”txtFindCompanyCount” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Find By :

</td>

<td>

<table cellpadding=”0″ cellspacing=”0″ border=”1″ width=”100%”>

<tr>

<td>Field Name :</td>

<td>Field Value :</td>

<td>&nbsp;</td>

</tr>

<tr>

<td>

<select id=”selFindCompanyBy”>

<option value=”Address1″>Address1</option>

<option value=”Address2″>Address2</option>

<option value=”Company”>Company</option>

<option value=”SalesRep”>Sales Rep</option>

</select>

 

</td>

<td>

<input type=”text” id=”txtFindCompanyFldVal” size=”50″ />

</td>

<td>

<input type=”button” value=”Add” onclick=”fnAddFieldValuePair(‘SA’);” />

</td>

</tr>

</table>

</td>

</tr>

 

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Search” onclick=”fnFindCompany();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘SA’);” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

<input type=”hidden” id=”txtFindCompanyPair”  />

</td>

<td >

</td>

</tr>

</table>

<table><tr><td id=”findcompanyResult”></td></tr></table>

</td>

</tr>

 

Javascript:

function fnFindCompany() {

 

var url = ”;

var count = $(“#txtFindCompanyCount”).val();

var condition = $(“#txtFindCompanyPair”).val();

if (condition != “”) {

condition = “{” + condition + “}”;

}

url = “findcompany/” + $(“#txtFindCompany_ApiKey”).val() + “/?count=” + escape(count) + “&condition=” + escape(condition) + “&fieldsName=” + escape($(“#txtFindCompanyFields”).val());

$.getJSON(url,

function (data) {

$(‘#findcompanyResult’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#findcompanyResult’).text(‘Error: ‘ + err);

});

}

 

Response JSON:

{“Status”:1,”Message”:””,”Results”:[{“Company”:”BCD Corp “,”salesrep”:”admin “},{“Company”:”New Moon Company “,”salesrep”:”admin “},{“Company”:”Big Company “,”salesrep”:”admin “},{“Company”:”ABC Corp. “,”salesrep”:”Pat Miller “},{“Company”:”Full Sun Inc “,”salesrep”:”Kevin Davis “}],”Count”:5,”Columns”:[“Company”,”salesrep”],”Object”:”Account”}

Get list of objects for mobile

To get the allowed list of objects for mobile.

(Mobile Setup is required.)

URI:

<URI> / mobileobjects /{apiKey}

 

<URI> /mobileobjects /{apiKey}/{id} or {Name} or {label}
HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

·         Api Key (mandatory)

The response elements:

·         Status – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]

·         Message – status message.

·         Results – the result set.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

31. Get list of objects for mobile</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This method will return a list of mobile objects in the project.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtMobileObj_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Populate Mobile Objects” onclick=”fnPopulateMobileObjects();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘MO’);” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”Mobileobjects”>

</td>

</tr>

<tr>

<td>

Find By :

</td>

<td>

<table cellpadding=”0″ cellspacing=”0″>

<tr>

<td>

<select id=”selMobileFindBy”>

<option value=”id”>Id</option>

<option value=”name”>Name</option>

<option value=”label”>Label</option>

</select>

</td>

<td>

<input type=”text” id=”txtMobileFindBy” size=”50″ />

</td>

<td>

<input type=”button” value=”Search” onclick=”fnFindMobileObject();” />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”Mobileobject”>

</td>

</tr>

</table>

 

Javascript :

function fnPopulateMobileObjects() {

$.getJSON(“mobileobjects/” + $(“#txtMobileObj_ApiKey”).val(),

function (data) {

 

$(‘#Mobileobjects’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#Mobileobject’).text(‘Error: ‘ + err);

});

}

 

function fnFindMobileObject() {

 

var findBy = $(‘#selMobileFindBy’).val();

var searchText = $(‘#txtMobileFindBy’).val();

$(‘#Mobileobject’).text(“”);

if (findBy == “id”) {

$.getJSON(“mobileobjects/” + $(“#txtMobileObj_ApiKey”).val() + “/” + searchText,

function (data) {

 

$(‘#Mobileobject’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#Mobileobject’).text(‘Error: ‘ + err);

});

}

else {

$.getJSON(“mobileobjects/” + $(“#txtMobileObj_ApiKey”).val() + “?” + findBy + “=” + searchText,

function (data) {

 

$(‘#Mobileobject’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#Mobileobject’).text(‘Error: ‘ + err);

});

}

}

 

Response JSON:

[{“Id”:1,”Name”:”Account”,”Label”:”Accounts”},{“Id”:2,”Name”:”TREVENT”,”Label”:”Activities”},{“Id”:3,”Name”:”Contact”,”Label”:”Contacts”},{“Id”:39,”Name”:”LEADS”,”Label”:”Leads”},{“Id”:13,”Name”:”Note”,”Label”:”Notes”},{“Id”:20,”Name”:”Ticket”,”Label”:”Tickets”}]

Get field list for mobile 

Get field details of the specified object available through Web Service API.

(Mobile Setup is required.)

URI:

 

<URI> / mobilefields / {apiKey} / {objectName}

 

<URI> / mobilefields / {apiKey} / {objectName} / {id}

 

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

·         Api Key (mandatory)

·         Object (mandatory) – table name.

The response elements:

A JSON Array containing JSON objects for each field in the object. Each JSON object representing an individual field contains the following name value pairs

  •  “Id” – Field ID
  •  “Name” – actual field name. This needs to be used for all other operations like creation of records, update of records, and writing where clause for the search operation
  •   “Label” – This is a descriptive label of the field that is used in the CRM
  • Type” – This is the data type of field like Text, List, URL in CRM forms
  • Required” – whether this is field is mandatory in CRM forms
  • Size” – length of the field
  • Default” – Default value of the field
  •  “Value_list” – List values of the field in CRM forms.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

32. Get field list for mobile</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>Get field details of the specified object available through Web Service API.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtMField_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>

Object :

</td>

<td>

<input type=”text” id=”txtMObject” size=”50″ />

</td>

</tr>

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Populate Fields” onclick=”fnPopulateMFields();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘FM’);” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”Mfields”>

</td>

</tr>

<tr>

<td>

Find By :

</td>

<td>

<table cellpadding=”0″ cellspacing=”0″>

<tr>

<td>

<select id=”selFindByMField”>

<option value=”id”>Id</option>

<option value=”name”>Name</option>

<option value=”label”>Label</option>

</select>

</td>

<td>

<input type=”text” id=”txtFindByMField” size=”50″ />

</td>

<td>

<input type=”button” value=”Search” onclick=”fnFindMField();” />

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”Mfield”>

</td>

</tr>

</table>

 

Javascript :

function fnPopulateMFields() {

$.getJSON(“mobilefields/” + $(“#txtMField_ApiKey”).val() + “/” + $(“#txtMObject”).val(),

function (data) {

$(‘#Mfields’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#Mfields’).text(‘Error: ‘ + err);

});

}

 

function fnFindMField() {

var findBy = $(‘#selFindByMField’).val();

var searchText = $(‘#txtFindByMField’).val();

$(‘#Mfield’).text(“”);

if (findBy == “id”) {

$.getJSON(“mobilefields/” + $(“#txtMField_ApiKey”).val() + “/” + $(“#txtMObject”).val() + “/” + searchText,

function (data) {

$(‘#Mfield’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#Mfield’).text(‘Error: ‘ + err);

});

}

else {

$.getJSON(“mobilefields/” + $(“#txtMField_ApiKey”).val() + “/” + $(“#txtMObject”).val() + “/?” + findBy + “=” + searchText,

function (data) {

$(‘#Mfield’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#Mfield’).text(‘Error: ‘ + err);

});

}

}

 

Response JSON:

[{“Id”:6,”Name”:”SalesRep”,”Label”:”Sales Rep”,”Type”:”LIST”,”Required”:false,”Size”:”16″,”Default”:”Current User”,”Value_list”:””},{“Id”:4,”Name”:”Priority”,”Label”:”Priority”,”Type”:”LIST”,”Required”:true,”Size”:”64″,”Default”:””,”Value_list”:”Cold,Hot,Warm”},{“Id”:2,”Name”:”Status”,”Label”:”Status”,”Type”:”LIST”,”Required”:false,”Size”:”24″,”Default”:””,”Value_list”:”Customer,Duplicate,Ex-Customer,Ex-Partner,Partner”},{“Id”:3,”Name”:”Company”,”Label”:”Company”,”Type”:”TEXT”,”Required”:false,”Size”:”36″,”Default”:””,”Value_list”:””}]

 

Response JSON:

[{“Id”:2,”Name”:”Status”,”Label”:”Status”,”Type”:”LIST”,”Required”:false,”Size”:”24″,”Default”:””,”Value_list”:”Customer,Duplicate,Ex-Customer,Ex-Partner,Partner”}]

Get list of relations for mobile

Get list of relations for a specified object available through Web Service API.

(Mobile Setup is required.)

URI:

<URI> / tablerelated / {apiKey} / {objectName}

 

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  • Api Key (mandatory)
  • Object (mandatory) – table name.

 

The response elements:

JSON object containing relation name and structure. Each JSON object representing an individual field contains the following name value pairs

  • Status” – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  • “Message” – status message.
  • Table” – Relation object.
  •  “Operation” – Operations allowed for each relation object.
  • Table_Id” – Relation object id.
  • Parent_Table_Id” – Parent object id.

Example:

HTML:

 

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

33.Get list of relations for mobile</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>Get list of relations for a specified object available through Web Service API.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtTableRelated_ApiKey” size=”50″ />

</td>

</tr>

<tr>

<td>

Object :

</td>

<td>

<input type=”text” id=”txtTableRelatedObject” size=”50″ />

</td>

</tr>

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Search” onclick=”fnTableRelated();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘T’);” />

</td>

</tr>

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td id=”TableRelatedRecord”>

</td>

</tr>

</table>

 

Javascript :

function fnTableRelated() {

$.getJSON(“tablerelated/” + $(“#txtTableRelated_ApiKey”).val() + “/” + $(“#txtTableRelatedObject”).val(),

function (data) {

$(‘#TableRelatedRecord’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#TableRelatedRecord’).text(‘Error: ‘ + err);

});

}

 

Response JSON:

{“Status”:1,”Message”:””,”Results”:[{“Table”:”Contact”,”Table_Id”:3,”Operation”:[{“find_and_link”:true,”unlink”:true,”add”:true}],”Parent_Table_Id”:1},{“Table”:”LEADS”,”Table_Id”:39,”Operation”:[{“find_and_link”:false,”unlink”:false,”add”:false}],”Parent_Table_Id”:1},{“Table”:”Opprtnty”,”Table_Id”:4,”Operation”:[{“find_and_link”:false,”unlink”:false,”add”:false}],”Parent_Table_Id”:1},{“Table”:”Ticket”,”Table_Id”:20,”Operation”:[{“find_and_link”:false,”unlink”:false,”add”:false}],”Parent_Table_Id”:1},{“Table”:”Ticket”,”Table_Id”:20,”Operation”:[{“find_and_link”:false,”unlink”:false,”add”:false}],”Parent_Table_Id”:1}]}

Get linked records for mobile

This method will return the linked (child) records against a specific parent record.

(Mobile Setup is required.)

URI:

<URI> /linkedrecords / {apiKey} / {objectName} /{RecordId}/?{count}={rowcount}

HTTP Method: Get

Return Format: JSON OBJECT

Parameters:

  • Api Key (mandatory)
  • Object (mandatory) – table name.
  • RecordId (mandatory) – This is the main record ID.
  •  Count (optional) – Maximum number of records that can be returned in a linked table in a single call.

If no value is mentioned then a value of 50 is set by the system itself.

The response elements:

JSON object containing relation name and structure. Each JSON object representing an individual field contains the following name value pairs

  •  “Status” – 0 or 1. [The “Status” value “1” in the response object indicates a successful operation. If the value is “0” then it indicates failure.]
  •  “Message” – status message.
  •  “Results” – This represents the result set that is linked to the parent record.
  • Table” – Relation object.
  • Records” – Records that can be returned in a linked table.
  •  “Count ” – Total number of records included in a linked table.
  •  “Columns” – The result set contains the value of these fields for each record returned.

Example:

HTML:

<table cellpadding=”3″ cellspacing=”2″>

<tr>

<td colspan=”2″>

<h3>

35. Get linked records for mobile</h3>

</td>

</tr>

<tr>

<td style=”width: 120px;” valign=”top”>Purpose :</td>

<td valign=”top”>This method will return the linked (child) records against a specific parent record.</td>

</tr>

<tr>

<td>

Api Key :

</td>

<td>

<input type=”text” id=”txtLinkRecords_ApiKey” size=”50″ />

</td>

</tr>

 

<tr>

<td>

Object :

</td>

<td>

<input type=”text” id=”txtLinkRecordsObj” size=”50″ />

</td>

</tr>

<tr>

<td>

Record Id :

</td>

<td>

<input type=”text” id=”txtLinkRecordsId” size=”50″ />

</td>

</tr>

<tr>

<td>

Row Count :

</td>

<td>

<input type=”text” id=”txtLinkRecordsCount” size=”50″ />

</td>

</tr>

 

<tr>

<td>

&nbsp;

</td>

<td>

<input type=”button” value=”Search” onclick=”fnFindLinkRecords();” />

<input type=”button” value=”Clear” onclick=”fnClear(‘LR’);” />

</td>

</tr>

 

<tr>

<td valign=”top”>

<strong>Result :</strong>

</td>

<td >

</td>

</tr>

</table>

<table><tr>

<td id=”LinkRecordsResult”>

</td>

</tr></table>

Javascript :

function fnFindLinkRecords() {

var url = ”;

var count = $(“#txtLinkRecordsCount”).val();

url = “linkedrecords/” + $(“#txtLinkRecords_ApiKey”).val() + “/” + $(“#txtLinkRecordsObj”).val() + “/” + $(“#txtLinkRecordsId”).val() + “/?count=” + escape(count);

$.getJSON(url,

function (data) {

$(‘#LinkRecordsResult’).text(JSON.stringify(data));

})

.fail(

function (jqXHR, textStatus, err) {

$(‘#LinkRecordsResult’).text(‘Error: ‘ + err);

});

}

Response JSON:

{“Status”:1,”Message”:””,”Results”:[{“Table”:”Account”,”Records”:[{“Company”:”BCD Corp”,”SalesRep”:”admin”,”Priority”:”Hot”,”Status”:”Customer”}],”Count”:1,”Columns”:”Company,SalesRep,Priority,Status”},{“Table”:”Note”,”Records”:[{“Subject”:””,”Status”:””,”NoteText”:”Ron Jackson (rjackson@bcd.com) : Unable to login\nSoffrontSupport : Ok let us know..\nRon Jackson (rjackson@bcd.com) : Please log a case that I can not run report”},{“Subject”:””,”Status”:””,”NoteText”:”Ron Jackson (rjackson@bcd.com) : Want to create a ticket”},{“Subject”:””,”Status”:””,”NoteText”:”SoffrontSupport : Hi how are you…”},{“Subject”:””,”Status”:””,”NoteText”:”SoffrontSupport : Hi how are you…”},{“Subject”:””,”Status”:””,”NoteText”:”Ron Jackson (rjackson@bcd.com) : Hello What is a chat server\nSoffrontSupport : Thanks for the Questions\nSoffrontSupport : Teh Chat server is a tool to chat”}],”Count”:5,”Columns”:”Subject,Status,NoteText”},{“Table”:”Opprtnty”,”Records”:[{“Company”:”BCD Corp.”,”OppProb”:”50″,”EAmount”:”14500″,”FAmount”:”10150″},{“Company”:”BCD Corp.”,”OppProb”:”50″,”EAmount”:”70000″,”FAmount”:”35000″}],”Count”:2,”Columns”:”Company,OppProb,EAmount,FAmount”},{“Table”:”Ticket”,”Records”:[{“Product”:”Soffront Enterprise”,”Priority”:””,”AssignTo”:”Bill Johnson”,”Status”:”Group Queue”},{“Product”:”Soffront Enterprise”,”Priority”:””,”AssignTo”:”Bill Johnson”,”Status”:”Group Queue”},{“Product”:””,”Priority”:”3-Medium”,”AssignTo”:”Susan Smith”,”Status”:”Agent Queue”},{“Product”:”Soffront Enterprise”,”Priority”:””,”AssignTo”:”Bill Johnson”,”Status”:”Group Queue”},{“Product”:”Product”,”Priority”:””,”AssignTo”:”Bill Johnson”,”Status”:”Group Queue”}],”Count”:5,”Columns”:”Product,Priority,AssignTo,Status”}]}