Account

Account is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Account

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
AccountID
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier(UUID) to identify an account uniquely.
AccountNumber
GET | SET, Required, Type: String, Length: 32
Stores the Account Number (Auto genrated sequence)
Site
GET | SET, Optional, Type: String, Length: 16
Stores the Branch/Site information only
AccountCoreName
GET, ReadOnly, Type: String
Stores the account name with no site or branch information.
Account
GET, ReadOnly, Type:String, Length: 64
Stores the full account name along with branch or site information.
Name
SET, Required, Type: String, Length: 64
Stores the full account name.
Description
GET | SET, Optional, Type: String, Length: 2048
Stores a multiline short description
Address1
GET | SET Optional, Type: String, Length: 64
Stores the billing address segment Addresss1
Address2
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment Addresss2
City
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment City
State
GET | SET, Optional, Type: String, Length: 32
Stores the billing address segment State/Province/County
ZipCode
GET | SET, Optional, Type: String, Length: 10
Stores the billing address segment Pin or Zip Code
Country
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment Country Name (Fully identified country)
CountryName
GET, ReadOnly, Type: String
Stores the billing address segment Country Code (Short code for country)
CompanyPhone
GET | SET, Optional, Type: String, Length: 32
Stores the phone number
CompanyFax
GET | SET, Optional, Type: String, Length: 32
Stores the fax number
Website
GET | SET, Optional, Type: String, Length: 255
Stores Website
ShippingAddress1
GET | SET, Optional, Type: String, Length: 64
Stores the shipping address segment Addresss1
ShippingAddress2
GET | SET, Optional, Type: String, Length: 64
Stores the shipping address segment Addresss2
ShippingCity
GET | SET, Optional, Type: String, Length: 64
Stores the shipping address segment City
ShippingState
GET | SET, Optional, Type: String, Length: 32
Stores the shipping address segment State/Province/County
ShippingZipCode
GET | SET, Optional, Type: String, Length: 10
Stores the shipping address segment Pin or Zip Code
ShippingCountry
GET, ReadOnly, Type: String
Stores the shipping address segment Country Code (Short code for country)
ShippingCountryName
GET | SET, Optional, Type: String, Length: 64
Stores the shipping address segment Country Name (Fully identified country)
Owner
GET | SET, Optional, Type: String, Length: 97
Stores the Owner Full Name.
OwnerId
GET | SET, Optional, Type: UUID
Stores the Owner Reference as an UUID
Leadsources
GET | SET, Optional, Type: String, Length: 256
Stores the lead source type
LeadsourceID
GET | SET, Optional, Type: UUID
Stores the lead source reference UUID
LastEditDate
GET, Read Only, Type: DateTime
Gets the Date of Last Modification
CreationDate
GET, Read Only, Type: DateTime
Gets the Creation Date
Last Touch Date
GET, Read Only, Type: DateTime
Gets the LastTouched Date
UserType
GET, Read Only, Type: String
Gets the UserType associated with the owner
UserRegion
GET, Read Only, Type: String
Gets the UserRegion associated with the owner
IsPrivate
GET | SET, Optional, Type: Boolean
Checks if the account marked as private or not.

Operations

Account/Get

Get operation contract allows you to perform read operation on the Account resource.
ErrorCode Description
30201 General Error occurred while checking permission
30202 View permission denied
30203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Account/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Account resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Account resource contract, you need to Pass "Account" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Account. Please check the allowed operations on this resource Account. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Account. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Account that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
AccountId String By using the AccountId parameter you can get a specific Account resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one account in the response.
Note : When the AccountId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Account resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Account resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Account established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Account who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Account who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Account resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Account records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Account records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Account resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Account record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Account resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Account resource filtered by Account identifier AccountId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Get",
  "AccountId" : "68F9649F-9E6B-421D-956D-483AA0ED576B"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "AccountId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
    "Account": "Stark Industries-USA",
    "AccountNumber": "AC000009",
    "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "Owner": "Willy Wonka",
    "Type A1": null,
    "Type A2": null,
    "CompanyPhone": "45123436",
    "CompanyFax": "",
    "Website": "www.starkinc.com",
    "CoreName": "Stark Industries",
    "Site": "USA",
    "HasShippingAddress": false,
    "Description": "",
    "Address1": "12 AB Street",
    "Address2": "",
    "City": "Memphis",
    "State": "Colorado",
    "ZipCode": "102223",
    "Country": "US",
    "countryname": "",
    "ShippingAddress1": "12 AB Street",
    "ShippingAddress2": "",
    "ShippingCity": "Memphis",
    "ShippingState": "Colorado",
    "ShippingZipCode": "102223",
    "ShippingCountry": "US",
    "ShippingCountryName": "USA",
    "leadsourceid": null,
    "leadsources": null,
    "UserType": "",
    "UserRegion": "",
    "Last Touch Date": null,
    "CreationDate": "2017-11-01T07:54:59.9",
    "LastEditDate": "2017-11-01T08:10:48.3",
    "AccountCoreName": "Stark Industries"
  }
}							
Request for a list of all Account resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Get",
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Account": "Magnetic-USA",
      "AccountNumber": "AC000002",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Type A1": null,
      "Type A2": null,
      "CompanyPhone": "901-761-2220",
      "CompanyFax": "901-761-2220",
      "Website": "http://www.mosdskids.org",
      "CoreName": "Magnetic",
      "Site": "USA",
      "HasShippingAddress": false,
      "Description": "",
      "Address1": "Germantown",
      "Address2": "",
      "City": "Memphis",
      "State": "Tennessee",
      "ZipCode": "37501",
      "Country": "US",
      "countryname": "",
      "ShippingAddress1": "Germantown",
      "ShippingAddress2": "",
      "ShippingCity": "Memphis",
      "ShippingState": "Tennessee",
      "ShippingZipCode": "37501",
      "ShippingCountry": "",
      "ShippingCountryName": "United States",
      "leadsourceid": null,
      "leadsources": null,
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T06:46:48.71",
      "LastEditDate": "2017-11-01T08:10:48.3",
      "AccountCoreName": "Magnetic"
    },
    {
      "RowNumber": 2,
      "AccountId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "Account": "Stark Industries-USA",
      "AccountNumber": "AC000009",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Type A1": null,
      "Type A2": null,
      "CompanyPhone": "45123436",
      "CompanyFax": "",
      "Website": "www.starkinc.com",
      "CoreName": "Stark Industries",
      "Site": "USA",
      "HasShippingAddress": false,
      "Description": "",
      "Address1": "12 AB Street",
      "Address2": "",
      "City": "Memphis",
      "State": "Colorado",
      "ZipCode": "102223",
      "Country": "US",
      "countryname": "",
      "ShippingAddress1": "12 AB Street",
      "ShippingAddress2": "",
      "ShippingCity": "Memphis",
      "ShippingState": "Colorado",
      "ShippingZipCode": "102223",
      "ShippingCountry": "US",
      "ShippingCountryName": "USA",
      "leadsourceid": null,
      "leadsources": null,
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T07:54:59.9",
      "LastEditDate": "2017-11-01T08:10:48.3",
      "AccountCoreName": "Stark Industries"
    }
  ]
}						
Request for a list of all Account resources, with just 4 columns, who are present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Get",
  "Columns": [ "AccountId","Account","AccountNumber","Website" ],
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Account": "Magnetic-USA",
      "AccountNumber": "AC000002",
      "Website": "http://www.mosdskids.org"
    },
    {
      "AccountId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "Account": "Stark Industries-USA",
      "AccountNumber": "AC000009",
      "Website": "www.starkinc.com"
    }
  ]
}						
Request for the first page in the list of all Account resources sorted by Account in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Get",
  "Columns": [ "AccountId","Account","AccountNumber","Website" ],
  "Sort": {
    "Column": "Account",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "AccountId": "d34f671e-8968-4164-bd52-ab63b8a4f989",
        "Account": "Vlcano-UK",
        "AccountNumber": "AC000003",
        "Website": "https://volcanoes.org"
      },
      {
        "AccountId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
        "Account": "Stark Industries-USA",
        "AccountNumber": "AC000009",
        "Website": "www.starkinc.com"
      },
      {
        "AccountId": "41300695-693f-4358-ae06-00cd01bedf81",
        "Account": "Muffin-UK",
        "AccountNumber": "AC000005",
        "Website": "muffingroup.com"
      },
      {
        "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
        "Account": "Magnetic-USA",
        "AccountNumber": "AC000002",
        "Website": "http://www.mosdskids.org"
      },
      {
        "AccountId": "dea52671-39ab-4ea1-9039-9d29598d31dd",
        "Account": "LexCorp-FR",
        "AccountNumber": "AC000008",
        "Website": "www.LexCorp.com"
      },
      {
        "AccountId": "9e737c59-3b2f-4ce7-b7d5-b8f1c67b7f07",
        "Account": "Kitchen Table International-UK",
        "AccountNumber": "AC000011",
        "Website": "www.ktiusa.com"
      },
      {
        "AccountId": "1b52550a-8310-4fa3-9770-b384ae4e4ba1",
        "Account": "Kitchen Chairs International-UK",
        "AccountNumber": "AC000012",
        "Website": "www.ktiusa.com"
      },
      {
        "AccountId": "a3ae7565-77f7-4e1a-9409-fa4450f7ceda",
        "Account": "Dynamo-USA",
        "AccountNumber": "AC000004",
        "Website": "dinamorichmond.com"
      },
      {
        "AccountId": "e4dc7d81-34c6-41b7-a856-5d117fbe1bf0",
        "Account": "Coco Factory Inc-UK",
        "AccountNumber": "AC000010",
        "Website": "coco.org"
      },
      {
        "AccountId": "d2d85241-f5eb-47fd-9b7a-3339c6b4c212",
        "Account": "Astro-UK",
        "AccountNumber": "AC000001",
        "Website": "astro.com"
      },
      {
        "AccountId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
        "Account": "Acme Corporation-USA",
        "AccountNumber": "AC000006",
        "Website": "www.acme.com"
      },
      {
        "AccountId": "9e14107e-60c9-4292-9998-ed5d549a01bb",
        "Account": "Ace Chemicals-Columbus",
        "AccountNumber": "AC000007",
        "Website": "www.acechems.com"
      }
    ],
    "RecordInfo": {
      "RecordCount": 12,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						
Request for the first page in the list of all Account resources present in the City of Memphis or Columbus in the Country US. The list sorted by Account in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Get",
  "Columns": [ "Account","City", "Country" ],
  "SQLFilter": "City in ('Memphis','Columbus') and Country = 'US'",
  "Sort": {
    "Column": "Account",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "Account": "Stark Industries-USA",
        "City": "Memphis",
        "Country": "US"
      },
      {
        "Account": "Magnetic-USA",
        "City": "Memphis",
        "Country": "US"
      },
      {
        "Account": "Ace Chemicals-Columbus",
        "City": "Columbus",
        "Country": "US"
      }
    ],
    "RecordInfo": {
      "RecordCount": 3,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an account.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Account",
Operation = "Get",
Columns = new string[] { "AccountId", "Account", "AccountNumber", "Website" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"City","Memphis"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Account": "Magnetic-USA",
      "AccountNumber": "AC000002",
      "Website": "http://www.mosdskids.org"
    },
    {
      "AccountId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "Account": "Stark Industries-USA",
      "AccountNumber": "AC000009",
      "Website": "www.starkinc.com"
    }
  ]
}                 

Account/Exists

Exists operation checks if the Account resource exists or not.
ErrorCode Description
30301 General Error occurred while checking the account

API Url

http://liveapi.claritysoftcrm.com/api/v1/Account/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Account resource. Resource String http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Account resource contract, you need to Pass "Account" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Account. Please check the allowed operations on this resource Account. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Account. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
AccountId String By using the AccountId parameter you can get a specific Account resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one account in the response.
Note : When the AccountId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Account resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Account resource filtered by Account identifier AccountId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Exists",
  "AccountId" : "68F9649F-9E6B-421D-956D-483AA0ED576B"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							
Request for a list of all Account resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Exists",
  "Data": {
    "City": "Memphis"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Account",
Operation = "Exists",
AccountId = "68F9649F-9E6B-421D-956D-483AA0ED576B"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

Account/Permission

Permission operation contract allows you to know the access priviledges on the Account resource.
ErrorCode Description
30401 General Error occurred while checking the account permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Account/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Account resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Account resource contract, you need to Pass "Account" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Account. Please check the allowed operations on this resource Account. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Account. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Account. Account resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Account resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Permission",
  "Type" : "All"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							
Request to get the View access priviledges assigned to your API-key on the Account resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}							

Example programs

Request to get all the available access priviledges assigned to your API-key on the Account resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Account resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Account",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "View": true,
      "Create": true,
      "Edit": true,
      "Delete": false,
      "EditShared": true,
      "DeleteShared": false
    }
  }							

Account/Create

Create operation contract allows you to perform create operation on the Account resource.
ErrorCode Description
30701 Response error while creating account
30702 Access Denied! You do not have the permission
30703 General Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Account/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Account resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Account resource contract, you need to Pass "Account" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Account. Please check the allowed operations on this resource Account. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Account. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Account resource for that particular Create operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test account 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Account resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Create",
  "Data" : {
     "Name" : "Test Account 1",
     "Site" : "US",
     "WebSite" : "www.test.com"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "AccountId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Created"
  }
}							

Example programs

Create an Account
The sample C#.Net code is a simple RestClient that uses the API to create an Account.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Account",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Test Account 1"},
{"Site" , "US"},
{"WebSite" , "www.test.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "AccountId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Created"
  }
}								    

Account/Edit

Edit operation contract allows you to perform edit operation on the Account resource.
ErrorCode Description
30601 General Error occurred while checking the account permission
30602 Edit permission denied
30603 AccountId parameter is missing
30604 Error occurred while checking the account is existing or not
30605 Account is not existing
30606 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Account/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Account resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Account resource contract, you need to Pass "Account" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Account. Please check the allowed operations on this resource Account. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Account. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
AccountId String By using the AccountId parameter you can update a specific Account resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one account in the response.
Note : When the AccountId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Account resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test account 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Account resource by Account identifier AccountId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Edit",
  "Data" : {
       "Name" : "Test Account 123",
       "Site" : "UK",
       "WebSite" : "www.testaccount.com"
  },
  "AccountId" : "6b981082-15ac-4f40-820b-5a94049f542f"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "AccountId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Created"
  }
}							

Example programs

Edit an Account.
The sample C#.Net code is a simple RestClient that uses the API to edit an Account.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example edit program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Account",
Operation = "Edit",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Test Account 123"},
{"Site" , "UK"},
{"WebSite" , "www.testaccount.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "AccountId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Updated"
  }
}							  

Account/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Account resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Account]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Account resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Account resource contract, you need to Pass "Account" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Account. Please check the allowed operations on this resource Account. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Account. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
AccountId String By using the AccountId parameter you can update a specific Account resource by its identifier. Also, by not using the AccountId parameter you can update a specific Account resource by its identifier. This parameter is provided as a UUID.
Note : When the AccountId parameter is defined, then the api will edit else if its not provided it will create a new Account resource.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Account resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test account 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Account resource by Account identifier, AccountId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Create Or Edit",
  "AccountId" : "68f9649f-9e6b-421d-956d-483aa0ed576b",
  "Data" : {
    "Name" : "Stark Industries" 
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "AccountId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Updated"
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create Or Update request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Account",
Operation = "Create Or Edit",
AccountId = "68f9649f-9e6b-421d-956d-483aa0ed576b",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Stark Industries"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "AccountId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Updated"
  }
}								    

Account/Delete

Delete operation contract allows you to perform delete operation on the Account resource.
ErrorCode Description
30501 General Error occurred while checking the account permission
30502 Delete permission denied
30503 Only occurs when attempted an account delete by Id and the account do not exists
30504 General Error occurred while deleting an account
30505 Validation error, any of the three should be provided, 1. AccountId, 2. Filter, 3. SQLFilter. Which is missing
30506 Error occurred while checking the account is existing or not. (Only occurs when attempted an account delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Account/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Account resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Account resource contract, you need to Pass "Account" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Account. Please check the allowed operations on this resource Account. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Account. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
AccountId String By using the AccountId parameter you can delete a specific Account resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one account in the response.
Note : When the AccountId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Account resource for the particular Delete operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Account resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Account established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Account who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Deleting the List of all Account who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request to delete an Account resource by AccountId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Delete",
  "AccountId" : "3d9cfa6f-473b-4503-aa20-30513ad8305"
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
        "AccountId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
        "AccountName": "Kitchen Chairs International-UK",
        "Status": "Deleted"
    }
}							
Request to delete one or many Account resource by filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Delete",
  "Filter" : {
    "AccountName": "Kitchen Chairs International-UK"
  }
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "AccountId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
            "AccountName": "Kitchen Chairs International-UK",
            "Status": "Deleted"
        }
    ]
}							
Request to delete one or many Account resource by SQL filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Delete",
  "SQLFilter" : "AccountName = 'Kitchen Chairs International-UK'"
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "AccountId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
            "AccountName": "Kitchen Chairs International-UK",
            "Status": "Deleted"
        }
    ]
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete program using id.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Account",
Operation = "Delete",
AccountId = "3d9cfa6f-473b-4503-aa20-30513ad8305"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
        "AccountId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
        "AccountName": "Kitchen Chairs International-UK",
        "Status": "Deleted"
    }
}								    

Activity

Activity is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Activity

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
Subject
GET | SET, Optional, Type: String, Length: 2048
Stores a multiline short Subject.
Note
GET | SET, Optional, Type: String, Length: Max
Stores the activity note.
StartDate
GET, Read Only, Type: DateTime
Gets the Start Date for an activity.
EndDate
GET, Read Only, Type: DateTime
Gets the End Date for an activity.
Status
GET | SET, Optional, Type: String, Length: 64
Stores Status of the activity.
AssignedToId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier(UUID) to identify an activity uniquely.
Priority
GET, Read Only, Type: String
Gets the Priority associated with the activity.
Location
GET | SET, Optional, Type: String, Length: 64
Stores the location for activity.
CategoryId
GET, ReadOnly, Type: UUID
Stores a categoryid to identify an activity uniquely.
AllDayEvent
GET, ReadOnly, Type: String
Stores the alldayevent information for reference.
ReminderEnabled
GET | SET, Optional, Type: Boolean
Checks if the activity marked as ReminderEnabled or not.
IsSchedule
GET | SET, Optional, Type: Boolean
Checks if the activity marked as IsSchedule or not.
ReminderInterval
GET | SET, Optional, Type: Boolean
Checks if the activity marked as ReminderInterval or not.
IsCalendar
GET | SET, Optional, Type: Boolean
Checks if the activity marked as IsCalendar or not.
Email
GET | SET, Optional, Type: String, Length: 128
Stores the Email of that Contact
AssociatedEmails
GET | SET, Required, Type: String, Length: 32
Send the activity email to the AssociatedEmails (Auto genrated sequence).
ActivityType
GET, Read Only, Type: String
Gets the ActivityType associated with the owner.
ContactId
GET, ReadOnly, Type: UUID
Activity takes a valid contact. Its over-ridden by the ContactId (if specified).
LeadId
GET, ReadOnly, Type: UUID
Activity takes a valid lead. Its over-ridden by the ContactId (if specified).
SourceObjectID
GET, ReadOnly, Type: UUID
Activity associated object Id ( AccountId , OpportunityId, QuotationId, SalesOrderId ).
SourceObjectTypeID
GET, ReadOnly, Type: UUID
Activity associated object type (Account , Opportunity, Quotation, SalesOrder ). Releted Id's :- Account : 011BB264-4FAE-4FD8-A542-8A9ED24559D4 Opportunity : B86A9E23-4D42-42B9-8BB5-D84FFF656898 Quotation : 3E16BDC5-5EF9-4CA0-962B-B7CA66A7E2E8 SalesOrder: 6C003044-0490-48B1-8778-39854EF9E6C1
SourceObjectType
GET, ReadOnly, Type: UUID
Activity Associated object type ( Account , Opportunity, Quotation, SalesOrder ) Overridden by SourceObjectTypeID id specified.

Operations

Activity/Get

Get operation contract allows you to perform read operation on the Activity resource.
ErrorCode Description
130201 General Error occurred while checking permission
130202 View permission denied
130203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Activity/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Activity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Activity resource contract, you need to Pass "Activity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Activity. Please check the allowed operations on this resource Activity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Activity. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Activity that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
ActivityId String By using the ActivityId parameter you can get a specific Activity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one account in the response.
Note : When the ActivityId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Activity resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Activity resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Activity established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Activity who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Activity who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Activity resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Activity records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Activity records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Activity resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Activity record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Activity resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Activity resource filtered by Activity identifier ActivityId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Get",
  "ActivityId" : "a7e381b2-88bd-4d06-a557-f55c5629f1d0"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "ActivityId": "a7e381b2-88bd-4d06-a557-f55c5629f1d0",
    "AccountId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
    "ContactId": "cb67d17c-2a20-4142-ae88-e443c08f2a23",
    "ActivityTypeId": "9e4fbb09-0303-446b-a72a-8eb363b7cc29",
    "OwnerId": "00000000-0000-0000-0000-0000000000ad",
    "AssignedToId": "00000000-0000-0000-0000-0000000000ad",
    "CategoryId1": null,
    "CategoryId2": null,
    "Account": "Stark Industries-USA",
    "AccountName": "Stark Industries",
    "AccountNumber": "AC000009",
    "Contact": "Tony Stark",
    "First Name": "Tony",
    "Middle Name": "",
    "Last Name": "Stark",
    "Salutation": "",
    "PrefixName": "",
    "SuffixName": "",
    "Title": "CEO",
    "Email": "",
    "Phone": "45123436",
    "Mobile": "",
    "Fax": "",
    "Activity": "Internal Group Discussion",
    "Subject": "Program Jarvis",
    "Notes": "",
    "StartDate": "2018-03-08T05:30:00",
    "DueDate": "2018-03-08T06:00:00",
    "CompleteDate": null,
    "Enddate": "2018-03-08T06:00:00",
    "Start Time": "05:30 AM",
    "Complete Time": null,
    "End Time": "06:00 AM",
    "IsCompleted": 0,
    "Status": "In Process",
    "Location": "Ohio",
    "Priority": "Medium",
    "Owner": "Administrator  ",
    "AssignedTo": "Administrator  ",
    "recurrence": "",
    "alldayevent": 0,
    "reminderenabled": 0,
    "reminderinterval": 30,
    "iscalendar": false,
    "CategoryId": 0,
    "category": "",
    "User DC1": "",
    "User DC2": "",
    "leadid": null,
    "lasteditdate": "2018-04-20T13:08:00",
    "creationdate": "2018-03-08T10:11:18.003",
    "sourceobjectid": null,
    "sourceobjecttypeid": null,
    "address1": "12 AB Street",
    "address2": "",
    "city": "Memphis",
    "state": "Colorado",
    "zipcode": "102223",
    "country": "USA",
    "UserType": "",
    "UserRegion": "",
    "caseid": null,
    "module": null,
    "isschedule": false,
    "source": ""
  }
}				
Request for a list of all Activity resources those are Meetings.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Activity",
    "Operation": "Get",
    "Filter": {
        "Activity": "Task"
    }
}						
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "ActivityId": "0c3d3013-f7a6-40b2-b1f0-368d6ddea2da",
      "AccountId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "ContactId": "cb67d17c-2a20-4142-ae88-e443c08f2a23",
      "ActivityTypeId": "b62859dc-3887-46d6-868b-0332fce28d19",
      "OwnerId": "00000000-0000-0000-0000-0000000000ad",
      "AssignedToId": "00000000-0000-0000-0000-0000000000ad",
      "CategoryId1": null,
      "CategoryId2": null,
      "Account": "Stark Industries-USA",
      "AccountName": "Stark Industries",
      "AccountNumber": "AC000009",
      "Contact": "Tony Stark",
      "First Name": "Tony",
      "Middle Name": "",
      "Last Name": "Stark",
      "Salutation": "",
      "PrefixName": "",
      "SuffixName": "",
      "Title": "CEO",
      "Email": "",
      "Phone": "45123436",
      "Mobile": "",
      "Fax": "",
      "Activity": "Task",
      "Subject": "Repair Iron Man Suit",
      "Notes": "",
      "StartDate": "2018-03-08T05:30:00",
      "DueDate": "2018-03-08T06:00:00",
      "CompleteDate": null,
      "Enddate": "2018-03-08T06:00:00",
      "Start Time": "05:30 AM",
      "Complete Time": null,
      "End Time": "06:00 AM",
      "IsCompleted": 0,
      "Status": "In Process",
      "Location": "Dallas",
      "Priority": "Medium",
      "Owner": "Administrator  ",
      "AssignedTo": "Administrator  ",
      "recurrence": "",
      "alldayevent": 0,
      "reminderenabled": 0,
      "reminderinterval": 30,
      "iscalendar": false,
      "CategoryId": 3,
      "category": "Personal",
      "User DC1": "",
      "User DC2": "",
      "leadid": null,
      "lasteditdate": "2018-03-08T10:10:09.08",
      "creationdate": "2018-03-08T10:10:09.08",
      "sourceobjectid": null,
      "sourceobjecttypeid": null,
      "address1": "12 AB Street",
      "address2": "",
      "city": "Memphis",
      "state": "Colorado",
      "zipcode": "102223",
      "country": "USA",
      "UserType": "",
      "UserRegion": "",
      "caseid": null,
      "module": null,
      "isschedule": false,
      "source": ""
    }
  ]
}				
Request for a list of all Activity resources, with just 4 columns, who are present in the City of Memphis.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Activity",
    "Operation": "Get",
    "Columns": [
        "AccountName",
        "Contact",
        "Subject",
        "Activity"
    ],
    "Filter": {
        "Activity": "Task"
    }
}				
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "AccountName": "Stark Industries",
      "Contact": "Tony Stark",
      "Subject": "Repair Iron Man Suit",
      "Activity": "Task"
    }
  ]
}				
Request for the first page in the list of all Activity resources sorted by Activity in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Get",
  "Columns": [ "AccountName","Contact","Subject","Activity" ],
  "Sort": {
    "Column": "Activity",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "AccountName": "Stark Industries",
        "Contact": "Tony Stark",
        "Subject": "Repair Iron Man Suit",
        "Activity": "Task"
      },
      {
        "AccountName": "Stark Industries",
        "Contact": "Tony Stark",
        "Subject": "Program Jarvis",
        "Activity": "Meeting"
      }
    ],
    "RecordInfo": {
      "RecordCount": 2,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						
Request for the first page in the list of all Activity resources present in the City of Memphis or Columbus in the Country US. The list sorted by activity in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Get",
  "Columns": [ "AccountName",
        "Contact",
        "Subject",
        "Activity" ],
  "SQLFilter": "AccountName = 'Stark Industries'",
  "Sort": {
    "Column": "activity",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "AccountName": "Stark Industries",
        "Contact": "Tony Stark",
        "Subject": "Repair Iron Man Suit",
        "Activity": "Task"
      },
      {
        "AccountName": "Stark Industries",
        "Contact": "Tony Stark",
        "Subject": "Program Jarvis",
        "Activity": "Meeting"
      }
    ],
    "RecordInfo": {
      "RecordCount": 2,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an account.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Activity",
Operation = "Get",
Columns = new string[] { "ActivityId", "activity", "activityNumber", "Website" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"City","Memphis"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ActivityId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "activity": "Magnetic-USA",
      "activityNumber": "AC000002",
      "Website": "http://www.mosdskids.org"
    },
    {
      "ActivityId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "activity": "Stark Industries-USA",
      "activityNumber": "AC000009",
      "Website": "www.starkinc.com"
    }
  ]
}                 

Activity/Exists

Exists operation checks if the Activity resource exists or not.
ErrorCode Description
130301 General Error occurred while checking the Activity

API Url

http://liveapi.claritysoftcrm.com/api/v1/Activity/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Activity resource. Resource String http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Activity resource contract, you need to Pass "Activity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Activity. Please check the allowed operations on this resource Activity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Activity. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ActivityId String By using the ActivityId parameter you can get a specific Activity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one account in the response.
Note : When the ActivityId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Activity resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Activity resource filtered by Activity identifier ActivityId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
      "Resource": "Activity",
    "Operation": "Exists",
    "ActivityId": "68F9649F-9E6B-421D-956D-483AA0ED576B"

}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": false
  }
}				
Request for a list of all Activity resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Exists",
  "Data": {
    "City": "Memphis"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}			

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Activity",
Operation = "Exists",
ActivityId = "68F9649F-9E6B-421D-956D-483AA0ED576B"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

Activity/Permission

Permission operation contract allows you to know the access priviledges on the Activity resource.
ErrorCode Description
130401 General Error occurred while checking the activity permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Activity/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Activity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Activity resource contract, you need to Pass "Activity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Activity. Please check the allowed operations on this resource Activity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Activity. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Activity. Activity resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Activity resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Permission",
  "Type" : "All"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							
Request to get the View access priviledges assigned to your API-key on the Activity resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}							

Example programs

Request to get all the available access priviledges assigned to your API-key on the Activity resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Activity resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Activity",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "View": true,
      "Create": true,
      "Edit": true,
      "Delete": false,
      "EditShared": true,
      "DeleteShared": false
    }
  }							

Activity/Create

Create operation contract allows you to perform create operation on the Activity resource.
ErrorCode Description
130701 Response error while creating Activity
130702 Access Denied! You do not have the permission
130703 General Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Activity/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Activity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Activity resource contract, you need to Pass "Activity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Activity. Please check the allowed operations on this resource Activity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Activity. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Activity resource for that particular Create operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test account 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Activity resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Create",
  "Data": {
       "ActivityType": "Task",
       "Subject": "Test Activity by claritysoft",
        "StartDate": "2018-03-08T05:30:00",
       "Enddate": "2018-03-08T06:00:00",
        "Status" : "Completed",
        "Notes": "Put Something here ...." 
   }
  
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ActivityId": "1d4333a3-c930-46ba-a3e6-97c7acbef900",
    "Status": "Created"
  }
}					

Example programs

Create an Activity
The sample C#.Net code is a simple RestClient that uses the API to create an Activity.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Activity",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Test activity 1"},
{"Site" , "US"},
{"WebSite" , "www.test.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ActivityId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Created"
  }
}								    

Activity/Edit

Edit operation contract allows you to perform edit operation on the Activity resource.
ErrorCode Description
130601 General Error occurred while checking the account permission
130602 Edit permission denied
130603 ActivityId parameter is missing
130604 Error occurred while checking the Activity is existing or not
130605 Activity is not existing
130606 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Activity/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Activity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Activity resource contract, you need to Pass "Activity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Activity. Please check the allowed operations on this resource Activity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Activity. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ActivityId String By using the ActivityId parameter you can update a specific Activity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one account in the response.
Note : When the ActivityId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Activity resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test account 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Activity resource by Activity identifier ActivityId.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Activity",
    "Operation": "Edit",
    "Data": {
        "Subject": "Test activity 123",
    },
    "ActivityId": "a7e381b2-88bd-4d06-a557-f55c5629f1d0"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ActivityId": "a7e381b2-88bd-4d06-a557-f55c5629f1d0",
    "Status": "Updated"
  }
}					

Example programs

Edit an Activity.
The sample C#.Net code is a simple RestClient that uses the API to edit an Activity.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example edit program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Activity",
Operation = "Edit",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Test activity 123"},
{"Site" , "UK"},
{"WebSite" , "www.testaccount.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ActivityId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Updated"
  }
}							  

Activity/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Activity resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Activity]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Activity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Activity resource contract, you need to Pass "Activity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Activity. Please check the allowed operations on this resource Activity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Activity. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ActivityId String By using the ActivityId parameter you can update a specific Activity resource by its identifier. Also, by not using the ActivityId parameter you can update a specific Activity resource by its identifier. This parameter is provided as a UUID.
Note : When the ActivityId parameter is defined, then the api will edit else if its not provided it will create a new Activity resource.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Activity resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test account 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Activity resource by Activity identifier, ActivityId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Create",
  "Data": {
       "ActivityType": "Task",
       "Subject": "Test Activity by claritysoft",
        "StartDate": "2018-03-08T05:30:00",
       "Enddate": "2018-03-08T06:00:00",
        "Status" : "Completed",
        "Notes": "Put Something here ...." 
   }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ActivityId": "e82c8fca-052a-4ba6-8cbd-c7f2dfc2821c",
    "Status": "Created"
  }
}				

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create Or Update request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Activity",
Operation = "Create Or Edit",
ActivityId = "68f9649f-9e6b-421d-956d-483aa0ed576b",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Stark Industries"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ActivityId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Updated"
  }
}								    

Activity/Delete

Delete operation contract allows you to perform delete operation on the Activity resource.
ErrorCode Description
130501 General Error occurred while checking the Activity permission
130502 Delete permission denied
130503 Only occurs when attempted an activity delete by Id and the activity do not exists
130504 General Error occurred while deleting an Activity
130505 Validation error, any of the three should be provided, 1. ActivityId, 2. Filter, 3. SQLFilter. Which is missing
130506 Error occurred while checking the account is existing or not. (Only occurs when attempted an Activity delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Activity/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Activity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Activity resource contract, you need to Pass "Activity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Activity. Please check the allowed operations on this resource Activity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Activity. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ActivityId String By using the ActivityId parameter you can delete a specific Activity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one account in the response.
Note : When the ActivityId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Activity resource for the particular Delete operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Activity resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Activity established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Activity who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Deleting the List of all Activity who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request to delete an Activity resource by ActivityId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Delete",
  "ActivityId" : "3d9cfa6f-473b-4503-aa20-30513ad8305"
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
        "ActivityId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
        "activityName": "Kitchen Chairs International-UK",
        "Status": "Deleted"
    }
}							
Request to delete one or many Activity resource by filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Delete",
  "Filter" : {
    "ActivityName": "Kitchen Chairs International-UK"
  }
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "ActivityId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
            "ActivityName": "Kitchen Chairs International-UK",
            "Status": "Deleted"
        }
    ]
}							
Request to delete one or many Activity resource by SQL filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Activity",
  "Operation": "Delete",
  "SQLFilter" : "activityName = 'Kitchen Chairs International-UK'"
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "ActivityId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
            "activityName": "Kitchen Chairs International-UK",
            "Status": "Deleted"
        }
    ]
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete program using id.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Activity",
Operation = "Delete",
ActivityId = "3d9cfa6f-473b-4503-aa20-30513ad8305"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
        "ActivityId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
        "activityName": "Kitchen Chairs International-UK",
        "Status": "Deleted"
    }
}								    

Attachment

Attachment is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Attachment

Available operations

Get,Exists,Create,Delete

List of standard fields

FieldDescription
AttachmentId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify an attachment uniquely.
AttachmentName
GET, RaedOnly, Type: String
Stores the Attachment name for reference.
Title
GET | SET, Optional, Type: String, Length: 64
Stores the Title of that Attachment
FileContent
SET, Required, Type: String,
Stores the full Attachment with Base64.
Note
GET | SET, Optional, Type: String, Length: Max
Stores the attachment note.
CreatedByUserId
GET | SET, Optional, Type: UUID
Stores the CreatedByUserId Reference of that SourceObject as an UUID.
FileLen
GET | SET, Optional, Type: String, Length: Max
Stores the attachment note.
LastEditDate
GET, Read Only, Type: DateTime
Gets the Date of Last Modification
FileUploaded
GET, Read Only, Type: DateTime
Gets the Date of File Uploaded.
SourceObjectId
GET | SET, Optional, Type: UUID
Stores the SourceObjectId Reference of that SourceObject as an UUID
SourceObjectTypeId
GET | SET, Optional, Type: UUID
Stores the SourceObjectTypeId Reference of that SourceObjectType as an UUID
SourceObjectType
GET, Read Only, Type: String
Stores the SourceObjectType information of that Attachment.
LastEditDate
GET, Read Only, Type: DateTime
Gets the Date of Last Modification
CreationDate
GET, Read Only, Type: DateTime
Gets the Creation Date
SysRepCreationDate
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the Sales Rep Creation Date.
SysRepEditDate
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the Sales Rep Edit Date.
SysRepCreateSessionID
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the Sales Rep Create SessionID.
SysRepEditSessionID
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the Sales Rep Edit SessionID.

Operations

Attachment/Get

Attachment is a resource contract that allows you to perform various operations on the resource.
ErrorCode Description
140201 General Error occurred while checking permission
140202 View permission denied
140203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Attachment/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Attachment resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Attachment resource contract, you need to Pass "Attachment" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Attachment. Please check the allowed operations on this resource Attachment. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Attachment. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Attachment that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
AttachmentId String By using the AttachmentId parameter you can get a specific Attachment resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one attachment in the response.
Note : When the AttachmentId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Attachment resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Attachment resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Attachment established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Attachment who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Attachment who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Attachment resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Attachment records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Attachment records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Attachment resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column name>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Attachment record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Attachment resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Attachment resource filtered by Attachment identifier AttachmentId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Get",
  "AttachmentId" : "5da8b858-c4ae-4af7-a4ce-32d70809ba51"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "FileHeader": {
      "RowNumber": 1,
      "AttachmentID": "5da8b858-c4ae-4af7-a4ce-32d70809ba51",
      "SourceObjectID": "13b4673b-6881-4b3c-8268-69a059c597fc",
      "SourceObjectTypeID": "736e8cdf-6f73-45af-869d-84da02a61576",
      "FileName": "08-2014-world-cup-us-ghana.jpg",
      "Title": "08-2014-world-cup-us-ghana",
      "LastEditDate": "2018-02-12T19:03:25.283",
      "CreationDate": "2018-02-12T19:03:25.28",
      "Note": null,
      "Note_b": null,
      "CreatedByUserID": "00000000-0000-0000-0000-0000000000ad",
      "FileLen": 5880379,
      "FileEncoding": 0,
      "FileHashMode": 0,
      "FileHash": null,
      "FileUploaded": "2018-02-12T19:03:25.28",
      "SysRepCreationDate": "2018-02-12T19:03:25.283",
      "SysRepEditDate": "2018-02-12T19:03:25.283",
      "SysRepCreateSessionID": "e2a3e297-2ab7-4f4e-a02f-dbf8518c2a2a",
      "SysRepEditSessionID": "e2a3e297-2ab7-4f4e-a02f-dbf8518c2a2a"
    },
    "FileContent": null
  }
}
Request for a list of all Attachment resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Get",
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
      "AccountNumber": "AC000002",
      "AccountName": "Magnetic-USA",
      "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Site": "USA",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Attachment": "Martin Manning",
      "Type C1": null,
      "Type C2": null,
      "PrefixName": "",
      "FirstName": "Martin",
      "MiddleName": "",
      "LastName": "Manning",
      "SuffixName": "",
      "Salutation": "Mr",
      "Title": "",
      "Phone": "9017612220 (21)",
      "PhoneExt": "21",
      "Mobile": "3450980021",
      "Fax": "9017612220",
      "Email": "martinmanning@company.com",
      "Address1": "Germantown",
      "Address2": "",
      "City": "Memphis",
      "State": "Tennessee",
      "ZipCode": "37501",
      "Country": "United States",
      "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
      "LeadSources": "Website",
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T07:34:25.833",
      "LastEditDate": "2017-11-01T07:34:26.217",
      "OptOutFromMassMail": false,
      "IsPrimaryContact": false,
      "AccountCoreName": "Magnetic"
    },
    {
      "RowNumber": 2,
      "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
      "AccountNumber": "AC000002",
      "AccountName": "Magnetic-USA",
      "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Site": "USA",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Attachment": "Tony Turgeon",
      "Type C1": null,
      "Type C2": null,
      "PrefixName": "",
      "FirstName": "Tony",
      "MiddleName": "",
      "LastName": "Turgeon",
      "SuffixName": "",
      "Salutation": "Mr",
      "Title": "",
      "Phone": "9017612220 (21)",
      "PhoneExt": "21",
      "Mobile": "4453300980",
      "Fax": "9017612220",
      "Email": "tonyturgeon@company.com",
      "Address1": "Germantown",
      "Address2": "",
      "City": "Memphis",
      "State": "Tennessee",
      "ZipCode": "37501",
      "Country": "United States",
      "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
      "LeadSources": "Website",
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T07:33:21.927",
      "LastEditDate": "2017-11-01T07:33:22.253",
      "OptOutFromMassMail": false,
      "IsPrimaryContact": false,
      "AccountCoreName": "Magnetic"
    }
  ]
}							
Request for a list of all Attachment resources, with just any 4 selected columns, who are present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Get",
  "Columns": [ "ContactId","Attachment","City","CreationDate" ],
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
      "Attachment": "Martin Manning",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:34:25.833"
    },
    {
      "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
      "Attachment": "Tony Turgeon",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:33:21.927"
    }
  ]
}	
Request for the first page in the list of all Attachment resources sorted by Attachment in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Get",
  "Columns": [ "ContactId","Attachment","CreationDate","Last Touch Date" ],
  "Sort": {
    "Column": "Attachment",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "ContactId": "8b934c59-b333-4b61-aacb-89c06ea4aaba",
        "Attachment": "Wheth Shaw",
        "CreationDate": "2017-11-01T07:41:55.61",
        "Last Touch Date": null
      },
      {
        "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
        "Attachment": "Tony Turgeon",
        "CreationDate": "2017-11-01T07:33:21.927",
        "Last Touch Date": null
      },
      {
        "ContactId": "241a4a2d-6445-4105-81fb-33705336075f",
        "Attachment": "Sandy Hook",
        "CreationDate": "2017-11-01T07:30:26.527",
        "Last Touch Date": null
      },
      {
        "ContactId": "d89ec1dd-32a8-4e3f-b844-6538be95bf9e",
        "Attachment": "Mary Rose",
        "CreationDate": "2017-11-01T07:40:37.827",
        "Last Touch Date": null
      },
      {
        "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
        "Attachment": "Martin Manning",
        "CreationDate": "2017-11-01T07:34:25.833",
        "Last Touch Date": null
      },
      {
        "ContactId": "1d10a118-234a-45af-99c8-ab6545bebf75",
        "Attachment": "Joe Peter",
        "CreationDate": "2017-11-01T07:38:42.03",
        "Last Touch Date": null
      },
      {
        "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
        "Attachment": "Jey Trumph",
        "CreationDate": "2017-11-01T07:50:17.09",
        "Last Touch Date": null
      },
      {
        "ContactId": "9f87b6ad-a85f-4622-9bef-64c031a999e6",
        "Attachment": "Eliana Jones",
        "CreationDate": "2017-11-01T07:19:48.093",
        "Last Touch Date": null
      },
      {
        "ContactId": "b4e811e9-0233-4b28-924d-2db99c16e8f6",
        "Attachment": "Devid Kern",
        "CreationDate": "2017-11-01T07:48:56.14",
        "Last Touch Date": null
      },
      {
        "ContactId": "cb787251-1df2-4988-9534-99def61c2b3e",
        "Attachment": "Devid Kern",
        "CreationDate": "2017-11-01T07:37:33.033",
        "Last Touch Date": null
      },
      {
        "ContactId": "a3e5c939-1ed4-464e-8d3a-bf22d42b826d",
        "Attachment": "David Jones",
        "CreationDate": "2017-11-01T07:31:37.497",
        "Last Touch Date": null
      },
      {
        "ContactId": "96f4f1ae-fd54-4a95-9db7-c934382b6b10",
        "Attachment": "Alicia Kim",
        "CreationDate": "2017-11-01T07:14:25.873",
        "Last Touch Date": null
      }
    ],
    "RecordInfo": {
      "RecordCount": 12,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}						
Request for the first page in the list of all Attachment resources present in the City of Memphis or Ohio in the Country US. The list sorted by Attachment in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Get",
  "Columns": [ "Attachment","City", "Country" ],
  "SQLFilter": "City in ('Bangor','Wales') and Country = 'United Kingdom'",
  "Sort": {
    "Column": "Attachment",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
		{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "Attachment": "Wheth Shaw",
        "City": "Wales",
        "Country": "United Kingdom"
      },
      {
        "Attachment": "Mary Rose",
        "City": "Wales",
        "Country": "United Kingdom"
      },
      {
        "Attachment": "Joe Peter",
        "City": "Bangor",
        "Country": "United Kingdom"
      },
      {
        "Attachment": "Devid Kern",
        "City": "Bangor",
        "Country": "United Kingdom"
      }
    ],
    "RecordInfo": {
      "RecordCount": 4,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}	

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an attachment.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Attachment",
Operation = "Get",
Columns = new string[] { "ContactId", "Attachment", "City","CreationDate" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"City","Memphis"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
      "Attachment": "Martin Manning",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:34:25.833"
    },
    {
      "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
      "Attachment": "Tony Turgeon",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:33:21.927"
    }
  ]
}								    

Attachment/Exists

Exists operation checks if the Attachment resource exists or not.
ErrorCode Description
140301 General Error occurred while checking the attachment

API Url

http://liveapi.claritysoftcrm.com/api/v1/Attachment/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Attachment resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Attachment resource contract, you need to Pass "Attachment" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Attachment. Please check the allowed operations on this resource Attachment. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Attachment. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
AttachmentId String By using the AttachmentId parameter you can get a specific Attachment resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one attachment in the response.
Note : When the AttachmentId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Attachment resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Attachment resource filtered by Attachment identifier AttachmentId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Exists",
  "AttachmentId" : "5da8b858-c4ae-4af7-a4ce-32d70809ba51""
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							
Request for a list of all Attachment resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Exists",
  "Data": {
    "City": "Memphis"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}             

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Attachment",
Operation = "Exists",
ContactId = "96f4f1ae-fd54-4a95-9db7-c934382b6b10"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

Attachment/Create

Create operation contract allows you to perform create operation on the Attachment resource.
ErrorCode Description
140701 Response error while creating attachment
140702 Access Denied! You do not have the permission
140703 Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Attachment/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Attachment resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Attachment resource contract, you need to Pass "Attachment" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Attachment. Please check the allowed operations on this resource Attachment. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Attachment. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Attachment resource for that particular Create operation. The Data object is defined as follows:
 "Data" : {
     "Title" : "Manager",
     "FirstName" : "Test",
     "LastName" : "Attachment",
     "Email" : "test@test.com"
  }
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Attachment resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Create",
   "Data" : {
     "Title" : "Manager",
     "FirstName" : "Test",
     "LastName" : "Attachment",
     "Email" : "test@test.com"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "0d9787ff-6809-4f1f-9ad8-9d5933bd151d",
    "Status": "Created"
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Attachment",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Title","Manager"},
{"FirstName","Test"},
{"LastName","Attachment"},
{"Email","test@test.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
 {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "0d9787ff-6809-4f1f-9ad8-9d5933bd151d",
    "Status": "Created"
  }
}									    

Attachment/Delete

Delete operation contract allows you to perform delete operation on the Attachment resource.
ErrorCode Description
140501 General Error occurred while checking the attachment permission
140502 Contat delete permission denied
140503 Only occurs when attempted an attachment delete by Id and the attachment do not exists
140504 General Error occurred while deleting an attachment
140505 Validation error, any of the three should be provided, 1. ContactId, 2. Filter, 3. SQLFilter. Which is missing
140506 Error occurred while checking the attachment is existing or not. (Only occurs when attempted an attachment delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Attachment/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Attachment resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Attachment resource contract, you need to Pass "Attachment" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Attachment. Please check the allowed operations on this resource Attachment. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Attachment. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
AttachmentId String By using the AttachmentId parameter you can delete a specific Attachment resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one attachment in the response.
Note : When the AttachmentId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Attachment resource for the particular Delete operation. The filer object is defined as follows:
{
      "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
  [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Attachment resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Attachment established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Attachment who has a LeadSource.
    ISNULL([LeadSources],'') <> ''
  • Example 3 :
    Deleting the List of all Attachment who has a LeadSource or established in the country US.
    (ISNULL([LeadSource],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request for a single Attachment resource filtered by Attachment identifier AttachmentId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Delete",
  "AttachmentId" : "5da8b858-c4ae-4af7-a4ce-32d70809ba51"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
    "Attachment": "Test Attachment",
    "Status": "Deleted"
  }
}             
Delete all Attachment resources having Attachment Name as "Test Attachment".

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Delete",
  "Filter": {
    "Attachment": "Test Attachment"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
      "Attachment": "Test Attachment",
      "Status": "Deleted"
    }
  ]
}                
Delete all Attachment resources, having Attachment Name as "Test Attachment".

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Attachment",
  "Operation": "Delete",
  "SQLFilter": "[Attachment] = 'Test Attachment'"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
      "Attachment": "Test Attachment",
      "Status": "Deleted"
    }
  ]
}                

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Attachment",
Operation = "Delete",
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"ContactId","42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
      "Attachment": "Test Attachment",
      "Status": "Deleted"
    }
  ]
}  								    

Contact

Contact is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Contact

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
ContactId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify an contact uniquely.
Contact
GET, RaedOnly, Type: String
Stores the Contact name for reference.
AccountNumber
GET, ReadOnly, Type: String
Stores the full Account number (Auto genrated sequence) information for the account related to that account
Site
GET, ReadOnly, Type: String
Stores the Site information for reference.
AccountCoreName
GET, ReadOnly, Type: String
Stores the Account name with no site or branch information
AccountName
GET | SET, ReadOnly, Type: String
Stores the Account Name information.
AccountId
GET | SET, Required, Type: UUID
Stores the AccountId Reference of that account as an UUID.
PrefixName
GET | SET, Optional, Type: String, Length: 32
Stores the PrefixName of that Contact.
FirstName
SET, Required, Type: String, Length: 32
Stores the FirstName of that Contact
MiddleName
GET | SET, Optional, Type: String, Length: 32
Stores the MiddleName of that Contact
LastName
GET | SET, Optional, Type: String, Length: 32
Stores the LastName of that Contact
SuffixName
GET | SET, Optional, Type: String, Length: 12
Stores the SuffixName of that Contact
Title
GET | SET, Optional, Type: String, Length: 64
Stores the Title of that Contact
Salutation
GET | SET, Optional, Type: String, Length: 100
Stores the Salutation of that Contact
Phone
GET | SET, Optional, Type: String, Length: 32
Stores the Phone number of that Contact
PhoneExt
GET | SET, Optional, Type: String, Length: 6
Stores the PhoneExt number of that Contact
Mobile
GET | SET, Optional, Type: String, Length: 32
Stores the Mobile number of that Contact
Fax
GET | SET, Optional, Type: String, Length: 32
Stores the Fax number of that Contact
Email
GET | SET, Optional, Type: String, Length: 128
Stores the Email of that Contact
OwnerId
GET | SET, Optional, Type: UUID
Stores the OwnerId Reference of that Owner as an UUID
Owner
GET, ReadOnly, Type: String
Stores the Site information for reference.
Address1
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment Addresss1 information of that Contact
Address2
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment Addresss2 information of that Contact
City
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment City information of that Contact
State
GET | SET, Optional, Type: String, Length: 32
Stores the billing address segment State information of that Contact
ZipCode
GET | SET, Optional, Type: String, Length: 10
Stores the billing address segment ZipCode information of that Contact
Country
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment Country of that Contact
LeadSourceId
GET | SET, Optional, Type: UUID
Stores LeadSourceId of that Contact
LeadSources
GET | SET, Optional, Type: String, Length: 256
Stores the LeadSources information of that Contact
CreationDate
GET, Read Only, Type: DateTime
Stores the CreationDate information related to that Contact
LastEditDate
GET, Read Only, Type: DateTime
Stores the LastEditDate information related to that Contact
Last Touch Date
GET, Read Only, Type: DateTime
Stores the Last Touch Date information related to that Contact
UserType
GET, Read Only, Type: String
Stores the UserType information of that Contact
UserRegion
GET, Read Only, Type: String
Stores the UserRegion information of that Contact
OptOutFromMassMail
GET | SET, Optional, Type: Boolean
Indicate the information whether the contact is Opt Out from MassMail
IsPrimaryContact
GET | SET, Optional, Type: Boolean
Indicate the information whether the contact is a Primary Contact

Operations

Contact/Get

Contact is a resource contract that allows you to perform various operations on the resource.
ErrorCode Description
40201 General Error occurred while checking permission
40202 View permission denied
40203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Contact/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Contact resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Contact resource contract, you need to Pass "Contact" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Contact. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Contact. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Contact that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
ContactId String By using the ContactId parameter you can get a specific Contact resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one contact in the response.
Note : When the ContactId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Contact resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Contact resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Contact established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Contact who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Contact who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Contact resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Contact records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Contact records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Contact resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column name>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Contact record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Contact resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Contact resource filtered by Contact identifier ContactId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Get",
  "ContactId" : "96f4f1ae-fd54-4a95-9db7-c934382b6b10"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "ContactId": "96f4f1ae-fd54-4a95-9db7-c934382b6b10",
    "AccountNumber": "AC000001",
    "AccountName": "Astro-UK",
    "AccountId": "d2d85241-f5eb-47fd-9b7a-3339c6b4c212",
    "Site": "UK",
    "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "Owner": "Willy Wonka",
    "Contact": "Alicia Kim",
    "Type C1": null,
    "Type C2": null,
    "PrefixName": "",
    "FirstName": "Alicia",
    "MiddleName": "",
    "LastName": "Kim",
    "SuffixName": "",
    "Salutation": "Mr",
    "Title": "",
    "Phone": "5656231287 (22)",
    "PhoneExt": "22",
    "Mobile": "7776656008",
    "Fax": "5656231287",
    "Email": "alicia.kim@company.com",
    "Address1": "Aiberdeen",
    "Address2": "",
    "City": "Scotland",
    "State": "UK",
    "ZipCode": "",
    "Country": "UK",
    "LeadSourceId": "1048addc-0f6c-47f0-945a-7494695be258",
    "LeadSources": "Outbound Call",
    "UserType": "",
    "UserRegion": "",
    "Last Touch Date": null,
    "CreationDate": "2017-11-01T07:14:25.873",
    "LastEditDate": "2017-11-01T07:14:26.24",
    "OptOutFromMassMail": false,
    "IsPrimaryContact": false,
    "AccountCoreName": "Astro"
  }
}		
Request for a list of all Contact resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Get",
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
      "AccountNumber": "AC000002",
      "AccountName": "Magnetic-USA",
      "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Site": "USA",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Contact": "Martin Manning",
      "Type C1": null,
      "Type C2": null,
      "PrefixName": "",
      "FirstName": "Martin",
      "MiddleName": "",
      "LastName": "Manning",
      "SuffixName": "",
      "Salutation": "Mr",
      "Title": "",
      "Phone": "9017612220 (21)",
      "PhoneExt": "21",
      "Mobile": "3450980021",
      "Fax": "9017612220",
      "Email": "martinmanning@company.com",
      "Address1": "Germantown",
      "Address2": "",
      "City": "Memphis",
      "State": "Tennessee",
      "ZipCode": "37501",
      "Country": "United States",
      "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
      "LeadSources": "Website",
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T07:34:25.833",
      "LastEditDate": "2017-11-01T07:34:26.217",
      "OptOutFromMassMail": false,
      "IsPrimaryContact": false,
      "AccountCoreName": "Magnetic"
    },
    {
      "RowNumber": 2,
      "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
      "AccountNumber": "AC000002",
      "AccountName": "Magnetic-USA",
      "AccountId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Site": "USA",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Contact": "Tony Turgeon",
      "Type C1": null,
      "Type C2": null,
      "PrefixName": "",
      "FirstName": "Tony",
      "MiddleName": "",
      "LastName": "Turgeon",
      "SuffixName": "",
      "Salutation": "Mr",
      "Title": "",
      "Phone": "9017612220 (21)",
      "PhoneExt": "21",
      "Mobile": "4453300980",
      "Fax": "9017612220",
      "Email": "tonyturgeon@company.com",
      "Address1": "Germantown",
      "Address2": "",
      "City": "Memphis",
      "State": "Tennessee",
      "ZipCode": "37501",
      "Country": "United States",
      "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
      "LeadSources": "Website",
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T07:33:21.927",
      "LastEditDate": "2017-11-01T07:33:22.253",
      "OptOutFromMassMail": false,
      "IsPrimaryContact": false,
      "AccountCoreName": "Magnetic"
    }
  ]
}							
Request for a list of all Contact resources, with just any 4 selected columns, who are present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Get",
  "Columns": [ "ContactId","Contact","City","CreationDate" ],
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
      "Contact": "Martin Manning",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:34:25.833"
    },
    {
      "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
      "Contact": "Tony Turgeon",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:33:21.927"
    }
  ]
}	
Request for the first page in the list of all Contact resources sorted by Contact in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Get",
  "Columns": [ "ContactId","Contact","CreationDate","Last Touch Date" ],
  "Sort": {
    "Column": "Contact",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "ContactId": "8b934c59-b333-4b61-aacb-89c06ea4aaba",
        "Contact": "Wheth Shaw",
        "CreationDate": "2017-11-01T07:41:55.61",
        "Last Touch Date": null
      },
      {
        "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
        "Contact": "Tony Turgeon",
        "CreationDate": "2017-11-01T07:33:21.927",
        "Last Touch Date": null
      },
      {
        "ContactId": "241a4a2d-6445-4105-81fb-33705336075f",
        "Contact": "Sandy Hook",
        "CreationDate": "2017-11-01T07:30:26.527",
        "Last Touch Date": null
      },
      {
        "ContactId": "d89ec1dd-32a8-4e3f-b844-6538be95bf9e",
        "Contact": "Mary Rose",
        "CreationDate": "2017-11-01T07:40:37.827",
        "Last Touch Date": null
      },
      {
        "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
        "Contact": "Martin Manning",
        "CreationDate": "2017-11-01T07:34:25.833",
        "Last Touch Date": null
      },
      {
        "ContactId": "1d10a118-234a-45af-99c8-ab6545bebf75",
        "Contact": "Joe Peter",
        "CreationDate": "2017-11-01T07:38:42.03",
        "Last Touch Date": null
      },
      {
        "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
        "Contact": "Jey Trumph",
        "CreationDate": "2017-11-01T07:50:17.09",
        "Last Touch Date": null
      },
      {
        "ContactId": "9f87b6ad-a85f-4622-9bef-64c031a999e6",
        "Contact": "Eliana Jones",
        "CreationDate": "2017-11-01T07:19:48.093",
        "Last Touch Date": null
      },
      {
        "ContactId": "b4e811e9-0233-4b28-924d-2db99c16e8f6",
        "Contact": "Devid Kern",
        "CreationDate": "2017-11-01T07:48:56.14",
        "Last Touch Date": null
      },
      {
        "ContactId": "cb787251-1df2-4988-9534-99def61c2b3e",
        "Contact": "Devid Kern",
        "CreationDate": "2017-11-01T07:37:33.033",
        "Last Touch Date": null
      },
      {
        "ContactId": "a3e5c939-1ed4-464e-8d3a-bf22d42b826d",
        "Contact": "David Jones",
        "CreationDate": "2017-11-01T07:31:37.497",
        "Last Touch Date": null
      },
      {
        "ContactId": "96f4f1ae-fd54-4a95-9db7-c934382b6b10",
        "Contact": "Alicia Kim",
        "CreationDate": "2017-11-01T07:14:25.873",
        "Last Touch Date": null
      }
    ],
    "RecordInfo": {
      "RecordCount": 12,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}						
Request for the first page in the list of all Contact resources present in the City of Memphis or Ohio in the Country US. The list sorted by Contact in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Get",
  "Columns": [ "Contact","City", "Country" ],
  "SQLFilter": "City in ('Bangor','Wales') and Country = 'United Kingdom'",
  "Sort": {
    "Column": "Contact",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
		{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "Contact": "Wheth Shaw",
        "City": "Wales",
        "Country": "United Kingdom"
      },
      {
        "Contact": "Mary Rose",
        "City": "Wales",
        "Country": "United Kingdom"
      },
      {
        "Contact": "Joe Peter",
        "City": "Bangor",
        "Country": "United Kingdom"
      },
      {
        "Contact": "Devid Kern",
        "City": "Bangor",
        "Country": "United Kingdom"
      }
    ],
    "RecordInfo": {
      "RecordCount": 4,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}	

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an contact.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Contact",
Operation = "Get",
Columns = new string[] { "ContactId", "Contact", "City","CreationDate" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"City","Memphis"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "2b7d179d-bcdf-4a79-972d-544d21578880",
      "Contact": "Martin Manning",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:34:25.833"
    },
    {
      "ContactId": "742bb013-6ad3-46b7-9fae-512d0588d4fb",
      "Contact": "Tony Turgeon",
      "City": "Memphis",
      "CreationDate": "2017-11-01T07:33:21.927"
    }
  ]
}								    

Contact/Exists

Exists operation checks if the Contact resource exists or not.
ErrorCode Description
40301 General Error occurred while checking the contact

API Url

http://liveapi.claritysoftcrm.com/api/v1/Contact/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Contact resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Contact resource contract, you need to Pass "Contact" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Contact. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Contact. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ContactId String By using the ContactId parameter you can get a specific Contact resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one contact in the response.
Note : When the ContactId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Contact resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Contact resource filtered by Contact identifier ContactId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Exists",
  "ContactId" : "96f4f1ae-fd54-4a95-9db7-c934382b6b10"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							
Request for a list of all Contact resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Exists",
  "Data": {
    "City": "Memphis"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}             

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Contact",
Operation = "Exists",
ContactId = "96f4f1ae-fd54-4a95-9db7-c934382b6b10"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

Contact/Permission

Permission operation contract allows you to know the access priviledges on the Contact resource.
ErrorCode Description
40401 General Error occurred while checking the contact permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Contact/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Contact resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Contact resource contract, you need to Pass "Contact" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Contact. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Contact. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Contact. Contact resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Contact resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Permission",
  "Type" : "All"
}							
Response :
                {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}             
Request to get the View access priviledges assigned to your API-key on the Contact resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
                {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}             

Example programs

Request to get all the available access priviledges assigned to your API-key on the Contact resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Contact resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Contact",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}     	  		    

Contact/Create

Create operation contract allows you to perform create operation on the Contact resource.
ErrorCode Description
40701 Response error while creating contact
40702 Access Denied! You do not have the permission
40703 Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Contact/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Contact resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Contact resource contract, you need to Pass "Contact" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Contact. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Contact. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Contact resource for that particular Create operation. The Data object is defined as follows:
 "Data" : {
     "Title" : "Manager",
     "FirstName" : "Test",
     "LastName" : "Contact",
     "Email" : "test@test.com"
  }
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Contact resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Create",
   "Data" : {
     "Title" : "Manager",
     "FirstName" : "Test",
     "LastName" : "Contact",
     "Email" : "test@test.com"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "0d9787ff-6809-4f1f-9ad8-9d5933bd151d",
    "Status": "Created"
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Contact",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Title","Manager"},
{"FirstName","Test"},
{"LastName","Contact"},
{"Email","test@test.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
 {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "0d9787ff-6809-4f1f-9ad8-9d5933bd151d",
    "Status": "Created"
  }
}									    

Contact/Edit

Edit operation contract allows you to perform edit operation on the Contact resource.
ErrorCode Description
40801 General Error occurred while checking the contact permission
40802 Contact edit permission denied
40803 ContactId parameter is missing
40804 Error occurred while checking the contact is existing or not.
40805 Contact is not existing
40806 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Contact/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Contact resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Contact resource contract, you need to Pass "Contact" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Contact. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Contact. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ContactId String By using the ContactId parameter you can update a specific Contact resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one contact in the response.
Note : When the ContactId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Contact resource for that particular Edit operation. The Data object is defined as follows:
 "Data" : {
     "Title" : "Manager",
     "FirstName" : "Test",
     "LastName" : "Contact",
     "Email" : "test@test.com"
  }
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Contact resource filtered by Contact identifier ContactId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Edit",
  "ContactId" : "42A068B7-BCC2-4DC5-AA5A-0DDAE6F49E76",
  "Data" : {
     "Title" : "Manager1",
     "FirstName" : "Test1",
     "LastName" : "Contact1",
     "Email" : "test1@test.com"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
    "Status": "Updated"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Contact",
Operation = "Edit",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Title","Manager"},
{"FirstName","Test"},
{"LastName","Contact"},
{"Email","test@test.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
    "Status": "Updated"
  }
}								    

Contact/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Contact resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Contact]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Contact resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Contact resource contract, you need to Pass "Contact" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Contact. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Contact. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ContactId String By using the ContactId parameter you can update a specific Contact resource by its identifier. Also, by not using the ContactId parameter you can create a specific Contact resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one contact in the response.
Note : When the ContactId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Contact resource for that particular Edit operation. The Data object is defined as follows:
     
"Data" : {
    "Title" : "Manager",
    "FirstName" : "Test",
    "LastName" : "Contact",
    "Email" : "test@test.com"
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Contact resource filtered by Contact identifier ContactId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Create Or Edit",
  "ContactId" : "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
  "Data" : {
      "Title" : "Manager",
      "FirstName" : "Test",
      "LastName" : "Contact",
      "Email" : "test@test.com"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
    "Status": "Updated"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Contact",
Operation = "Create Or Edit",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Title","Manager"},
{"FirstName","Test"},
{"LastName","Contact"},
{"Email","test@test.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": 
  {
    "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
    "Status": "Updated"
  }
}								    

Contact/Delete

Delete operation contract allows you to perform delete operation on the Contact resource.
ErrorCode Description
40501 General Error occurred while checking the contact permission
40502 Contat delete permission denied
40503 Only occurs when attempted an contact delete by Id and the contact do not exists
40504 General Error occurred while deleting an contact
40505 Validation error, any of the three should be provided, 1. ContactId, 2. Filter, 3. SQLFilter. Which is missing
40506 Error occurred while checking the contact is existing or not. (Only occurs when attempted an contact delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Contact/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Contact resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Contact resource contract, you need to Pass "Contact" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Contact. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Contact. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ContactId String By using the ContactId parameter you can delete a specific Contact resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one contact in the response.
Note : When the ContactId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Contact resource for the particular Delete operation. The filer object is defined as follows:
{
      "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
  [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Contact resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Contact established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Contact who has a LeadSource.
    ISNULL([LeadSources],'') <> ''
  • Example 3 :
    Deleting the List of all Contact who has a LeadSource or established in the country US.
    (ISNULL([LeadSource],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request for a single Contact resource filtered by Contact identifier ContactId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Delete",
  "ContactId" : "42A068B7-BCC2-4DC5-AA5A-0DDAE6F49E76"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
    "Contact": "Test Contact",
    "Status": "Deleted"
  }
}             
Delete all Contact resources having Contact Name as "Test Contact".

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Delete",
  "Filter": {
    "Contact": "Test Contact"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
      "Contact": "Test Contact",
      "Status": "Deleted"
    }
  ]
}                
Delete all Contact resources, having Contact Name as "Test Contact".

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Contact",
  "Operation": "Delete",
  "SQLFilter": "[Contact] = 'Test Contact'"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
      "Contact": "Test Contact",
      "Status": "Deleted"
    }
  ]
}                

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Contact",
Operation = "Delete",
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"ContactId","42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ContactId": "42a068b7-bcc2-4dc5-aa5a-0ddae6f49e76",
      "Contact": "Test Contact",
      "Status": "Deleted"
    }
  ]
}  								    

Lead

Lead is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Lead

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
LeadID
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier(UUID) to identify an lead uniquely.
Company
GET | SET, ReadOnly, Type:String, Length: 64
Stores the full lead Company along with information.
Contact
SET, Required, Type: String, Length: 64
Stores the full lead Contact.
LeadNumber
GET | SET, Required, Type: String, Length: 32
Stores the Lead Number (Auto genrated sequence)
PrefixName
GET | SET, Optional, Type: String, Length: 32
Stores the PrefixName of that Contact.
FirstName
SET, Required, Type: String, Length: 32
Stores the FirstName of that Contact
MiddleName
GET | SET, Optional, Type: String, Length: 32
Stores the MiddleName of that Contact
LastName
GET | SET, Optional, Type: String, Length: 32
Stores the LastName of that Contact
SuffixName
GET | SET, Optional, Type: String, Length: 12
Stores the SuffixName of that Contact
Salutation
GET | SET, Optional, Type: String, Length: 100
Stores the Salutation of that Contact
Title
GET | SET, Optional, Type: String, Length: 64
Stores the Title of that Contact
Phone
GET | SET, Optional, Type: String, Length: 32
Stores the Phone number of that Contact
PhoneExt
GET | SET, Optional, Type: String, Length: 6
Stores the PhoneExt number of that Contact
Email
GET | SET, Optional, Type: String, Length: 128
Stores the Email of that Contact
Mobile
GET | SET, Optional, Type: String, Length: 32
Stores the Mobile number of that Contact
Fax
GET | SET, Optional, Type: String, Length: 32
Stores the Fax number of that Contact
Address1
GET | SET Optional, Type: String, Length: 64
Stores the billing address segment Addresss1
Address2
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment Addresss2
City
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment City
State
GET | SET, Optional, Type: String, Length: 32
Stores the billing address segment State/Province/County
Zip
SET, Optional, Type: String, Length: 10
Stores the billing address segment Pin or Zip
ZipCode
GET, Optional, Type: String, Length: 10
Stores the billing address segment Pin or Zip Code
Country
GET | SET, Optional, Type: String, Length: 64
Stores the billing address segment Country Name (Fully identified country)
CountryName
GET, ReadOnly, Type: String
Stores the billing address segment Country Code (Short code for country)
Website
GET | SET, Optional, Type: String, Length: 255
Stores Website
Note
GET | SET, Optional, Type: String, Length: 2048
Stores a multiline short description
Owner
GET | SET, Optional, Type: String, Length: 97
Stores the Owner Full Name.
OwnerId
GET | SET, Optional, Type: UUID
Stores the Owner Reference as an UUID
Leadsources
GET | SET, Optional, Type: String, Length: 256
Stores the lead source type
LeadsourceID
GET | SET, Optional, Type: UUID
Stores the lead source reference UUID
UserType
GET, Read Only, Type: String
Gets the UserType associated with the owner
UserRegion
GET, Read Only, Type: String
Gets the UserRegion associated with the owner
CreationDate
GET, Read Only, Type: DateTime
Gets the Creation Date
LastEditDate
GET, Read Only, Type: DateTime
Gets the Date of Last Modification
Last Touch Date
GET, Read Only, Type: DateTime
Gets the LastTouched Date

Operations

Lead/Get

Get operation contract allows you to perform read operation on the Lead resource.
ErrorCode Description
150201 General Error occurred while checking permission
150202 View permission denied
150203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Lead/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Lead resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Lead resource contract, you need to Pass "Lead" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Lead. Please check the allowed operations on this resource Lead. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Lead. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Lead that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
LeadId String By using the LeadId parameter you can get a specific Lead resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one lead in the response.
Note : When the LeadId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Lead resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Lead resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Lead established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Lead who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Lead who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Lead resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Lead records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Lead records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Lead resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Lead record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Lead resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Lead resource filtered by Lead identifier LeadId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Get",
  "LeadId" : "115af771-ad13-4108-b0b3-5176108a2568"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "LeadID": "115af771-ad13-4108-b0b3-5176108a2568",
    "CompanyName": "",
    "Contact": "",
    "LeadNumber": "",
    "PrefixName": null,
    "FirstName": null,
    "MiddleName": null,
    "LastName": null,
    "SuffixName": null,
    "Salutation": null,
    "Title": null,
    "Phone": "",
    "PhoneExt": null,
    "Email": null,
    "Mobile": null,
    "Fax": null,
    "Address1": null,
    "Address2": null,
    "City": null,
    "State": null,
    "Zipcode": null,
    "Country": null,
    "CountryName": null,
    "Website": "www.test.com",
    "Notes": null,
    "PreferredContactMode": 0,
    "LeadSourceID": null,
    "CampaignID": null,
    "AssignedUtc": null,
    "ClosedUtc": null,
    "ownerid": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "LeadStageID": null,
    "LeadQualityID": null,
    "ContactID": null,
    "LeadStatusID": null,
    "LeadViewModeID": 0,
    "Campaign": "",
    "Lead Sources": "",
    "Stage": "",
    "Quality": "",
    "Status": "New",
    "Owner": "Willy Wonka",
    "AccountId": null,
    "ContactActual": "",
    "UserType": "",
    "UserRegion": "",
    "CreatedBy": "Willy Wonka",
    "CreationDate": "2018-03-12T12:44:00",
    "LastEditDate": "2018-03-12T12:44:00",
    "Last Touch Date": null
  }
}				
Request for a list of all Lead resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Get",
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "LeadId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Lead": "Magnetic-USA",
      "LeadNumber": "AC000002",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Type A1": null,
      "Type A2": null,
      "CompanyPhone": "901-761-2220",
      "CompanyFax": "901-761-2220",
      "Website": "http://www.mosdskids.org",
      "CoreName": "Magnetic",
      "Site": "USA",
      "HasShippingAddress": false,
      "Description": "",
      "Address1": "Germantown",
      "Address2": "",
      "City": "Memphis",
      "State": "Tennessee",
      "ZipCode": "37501",
      "Country": "US",
      "countryname": "",
      "ShippingAddress1": "Germantown",
      "ShippingAddress2": "",
      "ShippingCity": "Memphis",
      "ShippingState": "Tennessee",
      "ShippingZipCode": "37501",
      "ShippingCountry": "",
      "ShippingCountryName": "United States",
      "leadsourceid": null,
      "leadsources": null,
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T06:46:48.71",
      "LastEditDate": "2017-11-01T08:10:48.3",
      "LeadCoreName": "Magnetic"
    },
    {
      "RowNumber": 2,
      "LeadId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "Lead": "Stark Industries-USA",
      "LeadNumber": "AC000009",
      "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
      "Owner": "Willy Wonka",
      "Type A1": null,
      "Type A2": null,
      "CompanyPhone": "45123436",
      "CompanyFax": "",
      "Website": "www.starkinc.com",
      "CoreName": "Stark Industries",
      "Site": "USA",
      "HasShippingAddress": false,
      "Description": "",
      "Address1": "12 AB Street",
      "Address2": "",
      "City": "Memphis",
      "State": "Colorado",
      "ZipCode": "102223",
      "Country": "US",
      "countryname": "",
      "ShippingAddress1": "12 AB Street",
      "ShippingAddress2": "",
      "ShippingCity": "Memphis",
      "ShippingState": "Colorado",
      "ShippingZipCode": "102223",
      "ShippingCountry": "US",
      "ShippingCountryName": "USA",
      "leadsourceid": null,
      "leadsources": null,
      "UserType": "",
      "UserRegion": "",
      "Last Touch Date": null,
      "CreationDate": "2017-11-01T07:54:59.9",
      "LastEditDate": "2017-11-01T08:10:48.3",
      "LeadCoreName": "Stark Industries"
    }
  ]
}						
Request for a list of all Lead resources, with just 4 columns, who are present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Get",
  "Columns": [ "LeadId","Lead","LeadNumber","Website" ],
  "Filter": {
    "City": "Memphis"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "LeadId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Lead": "Magnetic-USA",
      "LeadNumber": "AC000002",
      "Website": "http://www.mosdskids.org"
    },
    {
      "LeadId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "Lead": "Stark Industries-USA",
      "LeadNumber": "AC000009",
      "Website": "www.starkinc.com"
    }
  ]
}						
Request for the first page in the list of all Lead resources sorted by Lead in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Get",
  "Columns": [ "LeadId","Lead","LeadNumber","Website" ],
  "Sort": {
    "Column": "Lead",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "LeadId": "d34f671e-8968-4164-bd52-ab63b8a4f989",
        "Lead": "Vlcano-UK",
        "LeadNumber": "AC000003",
        "Website": "https://volcanoes.org"
      },
      {
        "LeadId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
        "Lead": "Stark Industries-USA",
        "LeadNumber": "AC000009",
        "Website": "www.starkinc.com"
      },
      {
        "LeadId": "41300695-693f-4358-ae06-00cd01bedf81",
        "Lead": "Muffin-UK",
        "LeadNumber": "AC000005",
        "Website": "muffingroup.com"
      },
      {
        "LeadId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
        "Lead": "Magnetic-USA",
        "LeadNumber": "AC000002",
        "Website": "http://www.mosdskids.org"
      },
      {
        "LeadId": "dea52671-39ab-4ea1-9039-9d29598d31dd",
        "Lead": "LexCorp-FR",
        "LeadNumber": "AC000008",
        "Website": "www.LexCorp.com"
      },
      {
        "LeadId": "9e737c59-3b2f-4ce7-b7d5-b8f1c67b7f07",
        "Lead": "Kitchen Table International-UK",
        "LeadNumber": "AC000011",
        "Website": "www.ktiusa.com"
      },
      {
        "LeadId": "1b52550a-8310-4fa3-9770-b384ae4e4ba1",
        "Lead": "Kitchen Chairs International-UK",
        "LeadNumber": "AC000012",
        "Website": "www.ktiusa.com"
      },
      {
        "LeadId": "a3ae7565-77f7-4e1a-9409-fa4450f7ceda",
        "Lead": "Dynamo-USA",
        "LeadNumber": "AC000004",
        "Website": "dinamorichmond.com"
      },
      {
        "LeadId": "e4dc7d81-34c6-41b7-a856-5d117fbe1bf0",
        "Lead": "Coco Factory Inc-UK",
        "LeadNumber": "AC000010",
        "Website": "coco.org"
      },
      {
        "LeadId": "d2d85241-f5eb-47fd-9b7a-3339c6b4c212",
        "Lead": "Astro-UK",
        "LeadNumber": "AC000001",
        "Website": "astro.com"
      },
      {
        "LeadId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
        "Lead": "Acme Corporation-USA",
        "LeadNumber": "AC000006",
        "Website": "www.acme.com"
      },
      {
        "LeadId": "9e14107e-60c9-4292-9998-ed5d549a01bb",
        "Lead": "Ace Chemicals-Columbus",
        "LeadNumber": "AC000007",
        "Website": "www.acechems.com"
      }
    ],
    "RecordInfo": {
      "RecordCount": 12,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						
Request for the first page in the list of all Lead resources present in the City of Memphis or Columbus in the Country US. The list sorted by Lead in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Get",
  "Columns": [ "Lead","City", "Country" ],
  "SQLFilter": "City in ('Memphis','Columbus') and Country = 'US'",
  "Sort": {
    "Column": "Lead",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "Lead": "Stark Industries-USA",
        "City": "Memphis",
        "Country": "US"
      },
      {
        "Lead": "Magnetic-USA",
        "City": "Memphis",
        "Country": "US"
      },
      {
        "Lead": "Ace Chemicals-Columbus",
        "City": "Columbus",
        "Country": "US"
      }
    ],
    "RecordInfo": {
      "RecordCount": 3,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an lead.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Lead",
Operation = "Get",
Columns = new string[] { "LeadId", "Lead", "LeadNumber", "Website" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"City","Memphis"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "LeadId": "355dae9f-2d9a-41fe-a92d-f413bb17247c",
      "Lead": "Magnetic-USA",
      "LeadNumber": "AC000002",
      "Website": "http://www.mosdskids.org"
    },
    {
      "LeadId": "68f9649f-9e6b-421d-956d-483aa0ed576b",
      "Lead": "Stark Industries-USA",
      "LeadNumber": "AC000009",
      "Website": "www.starkinc.com"
    }
  ]
}                 

Lead/Exists

Exists operation checks if the Lead resource exists or not.
ErrorCode Description
150301 General Error occurred while checking the lead

API Url

http://liveapi.claritysoftcrm.com/api/v1/Lead/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Lead resource. Resource String http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Lead resource contract, you need to Pass "Lead" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Lead. Please check the allowed operations on this resource Lead. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Lead. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
LeadId String By using the LeadId parameter you can get a specific Lead resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one lead in the response.
Note : When the LeadId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Lead resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Lead resource filtered by Lead identifier LeadId.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Lead",
    "Operation": "Exists",
    "LeadId": "68F9649F-9E6B-421D-956D-483AA0ED576B"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": false
  }
}				
Request for a list of all Lead resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Exists",
  "Data": {
    "City": "Memphis"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Lead",
Operation = "Exists",
LeadId = "68F9649F-9E6B-421D-956D-483AA0ED576B"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

Lead/Permission

Permission operation contract allows you to know the access priviledges on the Lead resource.
ErrorCode Description
150401 General Error occurred while checking the lead permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Lead/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Lead resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Lead resource contract, you need to Pass "Lead" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Lead. Please check the allowed operations on this resource Lead. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Lead. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Lead. Lead resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Lead resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Permission",
  "Type" : "All"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							
Request to get the View access priviledges assigned to your API-key on the Lead resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}							

Example programs

Request to get all the available access priviledges assigned to your API-key on the Lead resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Lead resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Lead",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "View": true,
      "Create": true,
      "Edit": true,
      "Delete": false,
      "EditShared": true,
      "DeleteShared": false
    }
  }							

Lead/Create

Create operation contract allows you to perform create operation on the Lead resource.
ErrorCode Description
150701 Response error while creating lead
150702 Access Denied! You do not have the permission
150703 General Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Lead/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Lead resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Lead resource contract, you need to Pass "Lead" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Lead. Please check the allowed operations on this resource Lead. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Lead. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Lead resource for that particular Create operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test lead 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Lead resource.

Request :
{
   "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
   "Resource": "Lead",
   "Operation": "Create",
   "Data": {
     "Name" : "Test 11",
     "City": "Evergreen",
     "LastName": "Testing",
     "Phone": "3039817801",
     "State": "CO",
     "FirstName": "A Tester",
     "Address1": "123 Main Street",
    "Email": "dasdasdas@sdfsdf.com",
    "CompanyName": "ATesterTesting",           
    "PreferredContactMode": 0
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "LeadId": "db297793-acd9-4f84-8da0-57d669b848fa",
    "Status": "Created"
  }
}				

Example programs

Create an Lead
The sample C#.Net code is a simple RestClient that uses the API to create an Lead.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Lead",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Test Lead 1"},
{"Site" , "US"},
{"WebSite" , "www.test.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "LeadId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Created"
  }
}								    

Lead/Edit

Edit operation contract allows you to perform edit operation on the Lead resource.
ErrorCode Description
150601 General Error occurred while checking the lead permission
150602 Edit permission denied
150603 LeadId parameter is missing
150604 Error occurred while checking the lead is existing or not
150605 Lead is not existing
150606 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Lead/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Lead resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Lead resource contract, you need to Pass "Lead" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Lead. Please check the allowed operations on this resource Lead. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Lead. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
LeadId String By using the LeadId parameter you can update a specific Lead resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one lead in the response.
Note : When the LeadId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Lead resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test lead 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Lead resource by Lead identifier LeadId.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Lead",
    "Operation": "Edit",
    "Data": {
        "Name": "Test Lead 1",
        "Site": "US",
        "WebSite": "www.testlead.com"
    },
"LeadId": "115af771-ad13-4108-b0b3-5176108a2568"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "LeadId": "115af771-ad13-4108-b0b3-5176108a2568",
    "Status": "Updated"
  }
}					

Example programs

Edit an Lead.
The sample C#.Net code is a simple RestClient that uses the API to edit an Lead.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example edit program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Lead",
Operation = "Edit",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Test Lead 123"},
{"Site" , "UK"},
{"WebSite" , "www.testlead.com"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "LeadId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Updated"
  }
}							  

Lead/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Lead resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Lead]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Lead resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Lead resource contract, you need to Pass "Lead" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Lead. Please check the allowed operations on this resource Lead. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Lead. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
LeadId String By using the LeadId parameter you can update a specific Lead resource by its identifier. Also, by not using the LeadId parameter you can update a specific Lead resource by its identifier. This parameter is provided as a UUID.
Note : When the LeadId parameter is defined, then the api will edit else if its not provided it will create a new Lead resource.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Lead resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test lead 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Lead resource by Lead identifier, LeadId.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Lead",
    "Operation": "Create Or Edit",
    "LeadId": "115af771-ad13-4108-b0b3-5176108a2568",
    "Data": {
        "Name": "Stark Industries"
    }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "LeadId": "115af771-ad13-4108-b0b3-5176108a2568",
    "Status": "Updated"
  }
}						

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create Or Update request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Lead",
Operation = "Create Or Edit",
LeadId = "68f9649f-9e6b-421d-956d-483aa0ed576b",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" , "Stark Industries"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "LeadId": "6b981082-15ac-4f40-820b-5a94049f542f",
    "Status": "Updated"
  }
}								    

Lead/Delete

Delete operation contract allows you to perform delete operation on the Lead resource.
ErrorCode Description
150501 General Error occurred while checking the lead permission
150502 Delete permission denied
150503 Only occurs when attempted an lead delete by Id and the lead do not exists
150504 General Error occurred while deleting an lead
150505 Validation error, any of the three should be provided, 1. LeadId, 2. Filter, 3. SQLFilter. Which is missing
150506 Error occurred while checking the lead is existing or not. (Only occurs when attempted an lead delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Lead/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Lead resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Lead resource contract, you need to Pass "Lead" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Lead. Please check the allowed operations on this resource Lead. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Lead. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
LeadId String By using the LeadId parameter you can delete a specific Lead resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one lead in the response.
Note : When the LeadId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Lead resource for the particular Delete operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Lead resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Lead established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Lead who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Deleting the List of all Lead who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request to delete an Lead resource by LeadId.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Lead",
    "Operation": "Delete",
    "LeadId": "7b91d920-b0f2-4a57-8672-4d43095a66cc"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "LeadId": "7b91d920-b0f2-4a57-8672-4d43095a66cc",
    "CompanyName": "Biku Account",
    "Status": "Deleted"
  }
}			
Request to delete one or many Lead resource by filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Delete",
  "Filter" : {
    "LeadName": "Kitchen Chairs International-UK"
  }
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "LeadId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
            "LeadName": "Kitchen Chairs International-UK",
            "Status": "Deleted"
        }
    ]
}							
Request to delete one or many Lead resource by SQL filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Lead",
  "Operation": "Delete",
  "SQLFilter" : "LeadName = 'Kitchen Chairs International-UK'"
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
        {
            "LeadId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
            "LeadName": "Kitchen Chairs International-UK",
            "Status": "Deleted"
        }
    ]
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete program using id.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Lead",
Operation = "Delete",
LeadId = "3d9cfa6f-473b-4503-aa20-30513ad8305"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
        "LeadId": "3d9cfa6f-473b-4503-aa20-30513ad83057",
        "LeadName": "Kitchen Chairs International-UK",
        "Status": "Deleted"
    }
}								    

Opportunity

Opportunity is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
OpportunityId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify an opportunity uniquely.
Account
SET, Required, Type: Strings, Length: 64
Stores the account of opportunity
AccountId
GET | SET, Optional, Type: UUID
Stores the Account Reference as an UUID
AccountName
GET, ReadOnly, Type: Strings
Stores the Account Name
Site
GET | SET, Optional, Type: String, Length: 16
Stores the Branch/Site information only
AccountNumber
GET, ReadOnly, Type: Strings
Stores the Account Number
Contact
SET, Required, Type: Strings, Length: 97
Stores the Contact Name
ContactId
GET | SET, Optional, Type: UUID
Stores the Contact Reference as an UUID
Description
GET | SET, Optional, Type: String, Length: 256
Stores a multiline short description
Status
GET | SET, Optional, Type: String, Length: 64
Stores Status of the opportunity
FirstName
GET, ReadOnly, Type: String
Stores the FirstName of that Contact
MiddleName
GET, ReadOnly, Type: String
Stores the MiddleName of that Contact
LastName
GET, ReadOnly, Type: String
Stores the LastName of that Contact
Address1
GET, ReadOnly, Type: String
Stores the billing address segment Addresss1
Address2
GET, ReadOnly, Type: String
Stores the billing address segment Addresss2
City
GET, ReadOnly, Type: String
Stores the billing address segment City
State
GET, ReadOnly, Type: String
Stores the billing address segment State/Province/County
ZipCode
GET, ReadOnly, Type: String
Stores the billing address segment Pin or Zip Code
Phone
GET | SET, Optional, Type: String, Length: 32
Stores the Phone number of that Contact
Fax
GET | SET, Optional, Type: String, Length: 32
Stores the Fax number of that Contact
Email
GET | SET, Optional, Type: String, Length: 128
Stores the Email of that Contact
Note
GET | SET, Optional, Type: String, Length: Max
Stores the opportunity note
CreationDate
GET, Read Only, Type: Datetime
Gets the Creation Date
LastEditDate
GET, Read Only, Type: Datetime
Gets the Date of Last Modification
ExpDate
GET | SET, Optional, Type: DateTime
Stores expiery date of the opportunity
OwnerId
GET | SET, Optional, Type: UUID
Stores the Owner Reference as an UUID
Owner
GET, ReadOnly, Type: Strings
Stores the Owner Full Name
OwnerParentId
GET, ReadOnly, Type: UUID
Stores the Owner Partner Reference as an UUID
LeadSource
GET | SET, Optional, Type: String, Length: 32
Stores the lead source type
LeadSourceId
GET | SET, Optional, Type: UUID
Stores the lead source reference UUID
LeadId
GET | SET, Optional, Type: UUID
Stores the lead reference UUID
Amount
GET, ReadOnly, Type: Numeric
Stores the total
Cost
GET | SET, Optional, Type: Numeric
Stores the cost
EnteredDate
GET, Read Only, Type: DateTime
Stores the Opportunity Date
CloseDate
GET, Read Only, Type: DateTime
Stores the Opportunity Date
UserType
GET, Read Only, Type: String
Gets the UserType associated with the owner
UserRegion
GET, Read Only, Type: String
Gets the UserRegion associated with the owner

Operations

Opportunity/Get

Get operation contract allows you to perform read operation on the Opportunity resource.
ErrorCode Description
90201 General Error occurred while checking permission
90202 View permission denied
90203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Opportunity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity resource contract, you need to Pass "Opportunity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity. Please check the allowed operations on this resource Opportunity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Opportunity that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
OpportunityId String By using the OpportunityId parameter you can get a specific Opportunity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one opportunity in the response.
Note : When the OpportunityId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Opportunity resource for the particular Get operation. The filer object is defined as follows:
  {
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
  }
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Opportunity resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Opportunity established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Opportunity who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Opportunity who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Opportunity resource for the particular Get operation. The page object is defined as follows:
  {
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
  }
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Opportunity records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Opportunity records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Opportunity resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
  {
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
  }
Where, <column> defines the particular column on which the Opportunity record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Opportunity resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Opportunity resource filtered by Opportunity identifier OpportunityId.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Get",
  "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
  }							
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "opportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "QuoteNumber": "Q00001",
    "QuoteDate": "2017-11-01T00:00:00",
    "Description": "",
    "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "ownerparentid": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "Status": "Active",
    "ExpDate": "2017-11-01T04:00:00",
    "Owner": "Willy Wonka",
    "Account": "Acme Corporation-USA",
    "AccountName": "Acme Corporation",
    "AccountNumber": "AC000006",
    "AccountId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
    "Contact": "Jey Trumph",
    "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
    "FirstName": "Jey",
    "MiddleName": "",
    "LastName": "Trumph",
    "Bill To": "123 6th St.  Melbourne FL 32904",
    "BillCountryCode": "US",
    "BillCountry": "USA",
    "Ship To": "123 6th St.  Melbourne FL 32904",
    "ShipCountryCode": "US",
    "ShipCountry": "USA",
    "Address1": "123 6th St.",
    "Address2": "",
    "City": "Melbourne",
    "State": "FL",
    "ZipCode": "32904",
    "BTZip": "32904",
    "ShipAddress1": "123 6th St.",
    "ShipAddress2": "",
    "ShipCity": "Melbourne",
    "ShipState": "FL",
    "ShipZipCode": "32904",
    "STZip": "32904",
    "Term": "Net 30",
    "TermId": "d3261fa2-06ce-4444-b8ec-6af11f5d4508",
    "HasShippingAddress": false,
    "SH": 223455.0,
    "TaxRate": 12.0,
    "SubTotal": 70850.0,
    "Total": 302807.0,
    "Tax": 8502.0,
    "Cost": 6150.0,
    "LeadSource": "Website",
    "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
    "leadid": "00000000-0000-0000-0000-000000000000",
    "Note": "",
    "Phone": "5656231289",
    "Fax": "5656231289",
    "Email": "jeytrumph@company.com",
    "UserType": "",
    "UserRegion": "",
    "CreationDate": "2017-11-01T08:10:51.497",
    "LastEditDate": "2017-11-01T11:35:41.37",
    "ext_opportunityid": "8520fcf8-3abc-4006-8845-ec9f69c0d518"
  }
  }							
Request for a list of all Opportunity resources present in the City of Memphis.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Get",
  "Filter": {
    "City": "Melbourne"
  }
  }							
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "RowNumber": 1,
        "opportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Description": "",
        "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "ownerparentid": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "Status": "Active",
        "ExpDate": "2017-11-01T04:00:00",
        "Owner": "Willy Wonka",
        "Account": "Acme Corporation-USA",
        "AccountName": "Acme Corporation",
        "AccountNumber": "AC000006",
        "AccountId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
        "Contact": "Jey Trumph",
        "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
        "FirstName": "Jey",
        "MiddleName": "",
        "LastName": "Trumph",
        "Bill To": "123 6th St.  Melbourne FL 32904",
        "BillCountryCode": "US",
        "BillCountry": "USA",
        "Ship To": "123 6th St.  Melbourne FL 32904",
        "ShipCountryCode": "US",
        "ShipCountry": "USA",
        "Address1": "123 6th St.",
        "Address2": "",
        "City": "Melbourne",
        "State": "FL",
        "ZipCode": "32904",
        "BTZip": "32904",
        "ShipAddress1": "123 6th St.",
        "ShipAddress2": "",
        "ShipCity": "Melbourne",
        "ShipState": "FL",
        "ShipZipCode": "32904",
        "STZip": "32904",
        "Term": "Net 30",
        "TermId": "d3261fa2-06ce-4444-b8ec-6af11f5d4508",
        "HasShippingAddress": false,
        "SH": 223455.0,
        "TaxRate": 12.0,
        "SubTotal": 70850.0,
        "Total": 302807.0,
        "Tax": 8502.0,
        "Cost": 6150.0,
        "LeadSource": "Website",
        "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
        "leadid": "00000000-0000-0000-0000-000000000000",
        "Note": "",
        "Phone": "5656231289",
        "Fax": "5656231289",
        "Email": "jeytrumph@company.com",
        "UserType": "",
        "UserRegion": "",
        "CreationDate": "2017-11-01T08:10:51.497",
        "LastEditDate": "2017-11-01T11:35:41.37",
        "ext_opportunityid": "8520fcf8-3abc-4006-8845-ec9f69c0d518"
      }
    ],
    "RecordInfo": {
      "TotalAmount": 78807.0
    }
  }
  }							
Request for a list of all Opportunity resources, with just 4 columns, who are present in the City of Memphis.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Get",
  "Columns": [ "OpportunityId","QuoteNumber","QuoteDate","Email" ],
  "Filter": {
    "City": "Melbourne"
  }
  }							
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "jeytrumph@company.com"
      }
    ],
    "RecordInfo": {
      "TotalAmount": 78807.0
    }
  }
  }							
Request for the first page in the list of all Opportunity resources sorted by Opportunity in desending order. Where, each page consists of 20 records.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Get",
  "Columns": [ "OpportunityId","QuoteNumber","QuoteDate","Email" ],
  "Sort": {
    "Column": "QuoteNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
  }							
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OpportunityId": "07f29daa-3267-4fa2-ad79-802af66f9f35",
        "QuoteNumber": "Q00003",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "sandyhook@company.com"
      },
      {
        "OpportunityId": "5b78f937-bba3-405a-ae37-ec13d89ebe02",
        "QuoteNumber": "Q00002",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "alicia.kim@company.com"
      },
      {
        "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "jeytrumph@company.com"
      }
    ],
    "RecordInfo": {
      "PageInfo": {
        "RecordCount": 3,
        "PageNumber": 1,
        "PageSize": 20,
        "PageCount": 1
      },
      "SummaryInfo": {
        "TotalAmount": 173300.71298217773
      }
    }
  }
  }							
Request for the first page in the list of all Opportunity resources present in the City of Memphis or Ohio in the Country US. The list sorted by Opportunity in desending order. Where, each page consists of 20 records.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Get",
  "Columns": [ "OpportunityId","QuoteNumber","QuoteDate","Email" ],
  "SQLFilter": "QuoteNumber in ('Q00003','Q00002') and QuoteDate = '2017-11-01 00:00:00.000'",
  "Sort": {
    "Column": "QuoteNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
  }							
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OpportunityId": "07f29daa-3267-4fa2-ad79-802af66f9f35",
        "QuoteNumber": "Q00003",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "sandyhook@company.com"
      },
      {
        "OpportunityId": "5b78f937-bba3-405a-ae37-ec13d89ebe02",
        "QuoteNumber": "Q00002",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "alicia.kim@company.com"
      }
    ],
    "RecordInfo": {
      "PageInfo": {
        "RecordCount": 2,
        "PageNumber": 1,
        "PageSize": 20,
        "PageCount": 1
      },
      "SummaryInfo": {
        "TotalAmount": 94493.712982177734
      }
    }
  }
  }							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an opportunity.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity",
Operation = "Get",
Columns = new string[] { "OpportunityId","QuoteNumber","QuoteDate","Email" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"City","Melbourne"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "jeytrumph@company.com"
      }
    ],
    "RecordInfo": {
      "TotalAmount": 78807.0
    }
  }
  }							

Opportunity/Exists

Exists operation checks if the Opportunity resource exists or not.
ErrorCode Description
90301 General Error occurred while checking the Opportunity

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Opportunity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity resource contract, you need to Pass "Opportunity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity. Please check the allowed operations on this resource Opportunity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OpportunityId String By using the OpportunityId parameter you can get a specific Opportunity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one opportunity in the response.
Note : When the OpportunityId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Opportunity resource for the particular Exists operation. The filer object is defined as follows:
  {
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
  }
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Opportunity resource filtered by Opportunity identifier OpportunityId.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Exists",
  "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
  }             
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
  }             
Request for a list of all Opportunity resources present in the City of Melbourne.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Exists",
  "Data": {
    "City": "Melbourne"
  }
  }             
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
  }             

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity",
Operation = "Exists",
OpportunityId = "8520fcf8-3abc-4006-8845-ec9f69c0d518"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
  }                 

Opportunity/Permission

Permission operation contract allows you to know the access priviledges on the Opportunity resource.
ErrorCode Description
90401 General Error occurred while checking the Opportunity permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Opportunity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity resource contract, you need to Pass "Opportunity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity. Please check the allowed operations on this resource Opportunity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Opportunity. Opportunity resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Opportunity resource.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Permission",
  "Type" : "All"
  }             
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
  }             
Request to get the View access priviledges assigned to your API-key on the Opportunity resource.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Permission",
  "Type" : "View"
  }             
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
  }             

Example programs

Request to get all the available access priviledges assigned to your API-key on the Opportunity resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Opportunity resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
  }             

Opportunity/Create

Create operation contract allows you to perform create operation on the Opportunity resource.
ErrorCode Description
90701 Response error while creating Opportunity
90702 Access Denied! You do not have the permission
90703 Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Opportunity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity resource contract, you need to Pass "Opportunity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity. Please check the allowed operations on this resource Opportunity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Opportunity resource for that particular Create operation. The Data object is defined as follows:
  "Data" :
  {
  "Name" : "Test opportunity 123" 
    , "Address1" : "Test address"
    , "City" : "Dublin"
  [ , ...] 
  ]
  }
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Opportunity resource.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Create",
  "Data" : {
    "QuoteNumber": "Q00004",
    "QuoteDate": "2017-11-01",
    "Description": "Test Opportunity 1",
    "Status": "Active",
    "SH": "223455.00",
    "Rate": "12",
    "AccountId": "D2D85241-F5EB-47FD-9B7A-3339C6B4C212",
    "ContactId": "96F4F1AE-FD54-4A95-9DB7-C934382B6B10"
  }
  }
						  
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "744eb0c6-47c3-41f6-8dbf-47376e1a6706",
    "Status": "Created"
  }
  }							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"QuoteNumber","Q00004"},
{"QuoteDate","2017-11-01"},
{"Description","Quote for trial version"},
{"Status","Active"},
{"SH","223455.00"},
{"Rate","12"},
{"AccountId","D2D85241-F5EB-47FD-9B7A-3339C6B4C212"},
{"ContactId","96F4F1AE-FD54-4A95-9DB7-C934382B6B10"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "744eb0c6-47c3-41f6-8dbf-47376e1a6706",
    "Status": "Created"
  }
  }                 

Opportunity/Edit

Edit operation contract allows you to perform edit operation on the Opportunity resource.
ErrorCode Description
90601 General Error occurred while checking the Opportunity permission
90602 Edit permission denied
90603 Opportunity parameter is missing
90604 Error occurred while checking the Opportunity is existing or not.
90605 Opportunity is not existing.
90606 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Opportunity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity resource contract, you need to Pass "Opportunity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity. Please check the allowed operations on this resource Opportunity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OpportunityId String By using the OpportunityId parameter you can update a specific Opportunity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one opportunity in the response.
Note : When the OpportunityId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Opportunity resource for that particular Edit operation. The Data object is defined as follows:
  "Data" :
  {
  "Name" : "Test opportunity 123" 
    , "Address1" : "Test address"
    , "City" : "Dublin"
  [ , ...] 
  ]
  }
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Opportunity resource filtered by Opportunity identifier OpportunityId.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Edit",
  "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data" : {
    "Description": "Opportunity for 10 days",
    "Rate": "12"
  }
  }             
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
  }             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity",
Operation = "Edit",
OpportunityId = "8520fcf8-3abc-4006-8845-ec9f69c0d518",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Description","Opportunity for 10 days"},
{"Rate","12"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
  }             

Opportunity/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Opportunity resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Opportunity]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Opportunity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity resource contract, you need to Pass "Opportunity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity. Please check the allowed operations on this resource Opportunity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OpportunityId String By using the OpportunityId parameter you can update a specific Opportunity resource by its identifier. Also, by not using the OpportunityId parameter you can create a specific Opportunity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one opportunity in the response.
Note : When the OpportunityId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Opportunity resource for that particular Edit operation. The Data object is defined as follows:
  "Data" :
  {
  "Name" : "Test opportunity 123" 
    , "Address1" : "Test address"
    , "City" : "Dublin"
  [ , ...] 
  ]
  }
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Opportunity resource filtered by Opportunity identifier OpportunityId.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Create Or Edit",
  "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data" : {
    "Description": "Opportunity for 10 days",
    "Rate": "12"
  }
  }             
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
  }             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity",
Operation = "Create Or Edit",
OpportunityId = "8520fcf8-3abc-4006-8845-ec9f69c0d518",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Description","Opportunity for 10 days"},
{"Rate","12"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
  }             

Opportunity/Delete

Delete operation contract allows you to perform delete operation on the Opportunity resource.
ErrorCode Description
90501 General Error occurred while checking the Opportunity permission
90502 Delete permission denied
90503 Only occurs when attempted an Opportunity delete by Id and the Opportunity do not exists
90504 General Error occurred while deleting an Opportunity
90505 Validation error, any of the three should be provided, 1. OpportunityId, 2. Filter, 3. SQLFilter. Which is missing
90506 Error occurred while checking the Opportunity is existing or not. (Only occurs when attempted an Opportunity delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Opportunity resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity resource contract, you need to Pass "Opportunity" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity. Please check the allowed operations on this resource Opportunity. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OpportunityId String By using the OpportunityId parameter you can delete a specific Opportunity resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one opportunity in the response.
Note : When the OpportunityId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Opportunity resource for the particular Delete operation. The filer object is defined as follows:
  {
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
  }
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Opportunity resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Opportunity established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Opportunity who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Deleting the List of all Opportunity who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request for a single Opportunity resource filtered by Opportunity identifier OpportunityId.

Request :
  {
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Opportunity",
  "Operation": "Delete",
  "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
  }             
Response :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "QuoteNumber": "Q0004",
    "Status": "Deleted"
  }
  }             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity",
Operation = "Delete",
OpportunityId = "8520fcf8-3abc-4006-8845-ec9f69c0d518"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OpportunityId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "QuoteNumber": "Q0004",
    "Status": "Deleted"
  }
  }             

Opportunity_Line

Opportunity_Line is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line

Available operations

Permission,Get,Exists,Edit

List of standard fields

FieldDescription
DocItemId Stores a Universally Unique Identifier (UUID) to identify an item uniquely
DocId Gets the quotaionid as an UUID
ItemId Stores an UUID referenced from ProductItem
ItemIndex Stores the index of an item
ItemNumber Stores the number of an item
ItemName Stores the item name
UofM Stores the items unit of mass
Description Stores a multiline short description
ListPrice Stores the price of an item
Quantity Stores the quantity of an item
Discount Stores the discount rate of an item
DiscountPrice Stores the discount price
TaxPrice Stores the tax price of an item
Cost Stores the cost of an item
CreationDate Gets the Creation Date
LastEditDate Gets the Date of Last Modification

Operations

Opportunity_Line/Get

Get operation contract allows you to perform read operation on the Opportunity_Line resource.
ErrorCode Description
100201 General Error occurred while checking permission
100202 View permission denied
100203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Opportunity_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity_Line resource contract, you need to Pass "Opportunity_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity_Line. Please check the allowed operations on this resource Opportunity_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Opportunity_Line that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
OpportunityId String By using the OpportunityId parameter you can get a specific Opportunity_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one opportunityline in the response.
Note : When the OpportunityId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Opportunity_Line resource for the particular Get operation. The filer object is defined as follows:
  {
    "<column_name_1>" : "<preffered_value_1>" 
    [ , "<column_name_2>" : "<preffered_value_2>"  
      [ , ...] 
    ]
  }
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Opportunity_Line resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Opportunity_Line established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Opportunity_Line who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Opportunity_Line who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Opportunity_Line resource for the particular Get operation. The page object is defined as follows:
  {
    PageNumber : "<page_number>",
    PageSize : "<page_number>"
  }
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Opportunity_Line records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Opportunity_Line records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Opportunity_Line resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
  {
    Column : "<column>"
    [,Order : "Asc"(Default)|"Desc" ]
  }
Where, <column> defines the particular column on which the Opportunity_Line record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Opportunity_Line resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Opportunity_Line resource filtered by Opportunity_Line identifier OpportunityId.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Get",
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "RowNumber": 1,
        "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemId": null,
        "ItemIndex": 1,
        "ItemNumber": "Rope",
        "ItemName": "12 inch long",
        "UofM": "ea",
        "Description": "long rope",
        "ListPrice": 13.2614,
        "Quantity": 5000.0,
        "Discount": 12.0,
        "DiscountPrice": 11.67,
        "IsTaxExempt": false,
        "TaxPrice": 0.0,
        "CommissionRate": 0.0,
        "Cost": 0.0,
        "RawQty": 0.0,
        "UnitQty": 0.0,
        "UnitQtyModeID": 0,
        "LastEditDate": "2017-11-01T11:35:41.413",
        "CreationDate": "2017-11-01T11:35:41.413"
      },
      {
        "RowNumber": 2,
        "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemId": null,
        "ItemIndex": 2,
        "ItemNumber": "Plastic",
        "ItemName": "Plastic Recycled",
        "UofM": "Tons",
        "Description": "Test Item",
        "ListPrice": 250.0,
        "Quantity": 50.0,
        "Discount": 0.0,
        "DiscountPrice": 250.0,
        "IsTaxExempt": false,
        "TaxPrice": 0.0,
        "CommissionRate": 0.0,
        "Cost": 123.0,
        "RawQty": 0.0,
        "UnitQty": 0.0,
        "UnitQtyModeID": 0,
        "LastEditDate": "2017-11-01T11:35:41.43",
        "CreationDate": "2017-11-01T11:35:41.43"
      }
    ]
  }							
Request for a list of all Opportunity_Line resources present in the ItemNumber of Rope.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Get",
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Filter": {
      "ItemNumber": "Rope"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "RowNumber": 1,
        "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemId": null,
        "ItemIndex": 1,
        "ItemNumber": "Rope",
        "ItemName": "12 inch long",
        "UofM": "ea",
        "Description": "long rope",
        "ListPrice": 13.2614,
        "Quantity": 5000.0,
        "Discount": 12.0,
        "DiscountPrice": 11.67,
        "IsTaxExempt": false,
        "TaxPrice": 0.0,
        "CommissionRate": 0.0,
        "Cost": 0.0,
        "RawQty": 0.0,
        "UnitQty": 0.0,
        "UnitQtyModeID": 0,
        "LastEditDate": "2017-11-01T11:35:41.413",
        "CreationDate": "2017-11-01T11:35:41.413"
      }
    ]
  }						
Request for a list of all Opportunity_Line resources, with just 4 columns, who are present in the ItemNumber of Rope.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Get",
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
    "Filter": {
      "ItemNumber": "Rope"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemNumber": "Rope",
        "ListPrice": 13.2614
      }
    ]
  }						
Request for the first page in the list of all Opportunity_Line resources sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Get",
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
    "Sort": {
      "Column": "ItemNumber",
      "Order": "Desc"
    },
    "Page": {
      "PageNumber": "1",
      "PageSize": "20"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Records": [
        {
          "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
          "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
          "ItemNumber": "Rope",
          "ListPrice": 13.2614
        },
        {
          "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
          "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
          "ItemNumber": "Plastic",
          "ListPrice": 250.0
        }
      ],
      "RecordInfo": {
        "RecordCount": 2,
        "PageNumber": 1,
        "PageSize": 20,
        "PageCount": 0
      }
    }
  }						
Request for the first page in the list of all Opportunity_Line resources present in the ItemNumber of Plastic or Rope in the ItemName Plastic Recycled. The list sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Get",
    "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "SQLFilter": "ItemNumber in ('Plastic','Rope') and ItemName = 'Plastic Recycled'",
    "Sort": {
      "Column": "ItemNumber",
      "Order": "Desc"
    },
    "Page": {
      "PageNumber": "1",
      "PageSize": "20"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Records": [
        {
          "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
          "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
          "ItemNumber": "Plastic",
          "ListPrice": 250.0
        }
      ],
      "RecordInfo": {
        "RecordCount": 1,
        "PageNumber": 1,
        "PageSize": 20,
        "PageCount": 0
      }
    }
  }					

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an opportunityline.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity_Line",
Operation = "Get",
OpportunityId : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"ItemNumber","Rope"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "RowNumber": 1,
        "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemId": null,
        "ItemIndex": 1,
        "ItemNumber": "Rope",
        "ItemName": "12 inch long",
        "UofM": "ea",
        "Description": "long rope",
        "ListPrice": 13.2614,
        "Quantity": 5000.0,
        "Discount": 12.0,
        "DiscountPrice": 11.67,
        "IsTaxExempt": false,
        "TaxPrice": 0.0,
        "CommissionRate": 0.0,
        "Cost": 0.0,
        "RawQty": 0.0,
        "UnitQty": 0.0,
        "UnitQtyModeID": 0,
        "LastEditDate": "2017-11-01T11:35:41.413",
        "CreationDate": "2017-11-01T11:35:41.413"
      }
    ]
  }                 

Opportunity_Line/Exists

Exists operation checks if the Opportunity_Line resource exists or not.
ErrorCode Description
100301 General Error occurred while checking the OpportunityLine

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Opportunity_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity_Line resource contract, you need to Pass "Opportunity_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity_Line. Please check the allowed operations on this resource Opportunity_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OpportunityId String By using the OpportunityId parameter you can get a specific Opportunity_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one opportunityline in the response.
Note : When the OpportunityId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Opportunity_Line resource for the particular Exists operation. The filer object is defined as follows:
  {
    "<column_name_1>" : "<preffered_value_1>" 
    [ , "<column_name_2>" : "<preffered_value_2>"  
      [ , ...] 
    ]
  }
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Opportunity_Line resource filtered by Opportunity_Line identifier OpportunityId.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Exists",
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
  }
							  
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Exists": true
    }
  }							
Request for a list of all Opportunity_Line resources present in the ItemNumber of Rope.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Exists",
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Data": {
      "ItemNumber": "Rope"
    }
  }
							  
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Exists": true
    }
  }							

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity_Line",
Operation = "Exists",
OpportunityId = "8520fcf8-3abc-4006-8845-ec9f69c0d518"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Exists": true
    }
  }								    

Opportunity_Line/Permission

Permission operation contract allows you to know the access priviledges on the Opportunity_Line resource.
ErrorCode Description
100401 General Error occurred while checking the OpportunityLine permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Opportunity_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity_Line resource contract, you need to Pass "Opportunity_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity_Line. Please check the allowed operations on this resource Opportunity_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Opportunity_Line. Opportunity_Line resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Opportunity_Line resource.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Permission",
    "Type" : "All"
  }
							  
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "View": true,
      "Create": true,
      "Edit": true,
      "Delete": false,
      "EditShared": true,
      "DeleteShared": false
    }
  }							
Request to get the View access priviledges assigned to your API-key on the Opportunity_Line resource.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Permission",
    "Type" : "View"
  }
							  
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "View": true
    }
  }							

Example programs

Request to get all the available access priviledges assigned to your API-key on the Opportunity_Line resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Opportunity_Line resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity_Line",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "View": true,
      "Create": true,
      "Edit": true,
      "Delete": false,
      "EditShared": true,
      "DeleteShared": false
    }
  }							

Opportunity_Line/Edit

Edit operation contract allows you to perform edit operation on the Opportunity_Line resource. Here the data should be passed as an object array. The existing data will be truncated and the lines passed in the data will be inserted.If the ItemId is provided in the lines it will refer the ProductItem
ErrorCode Description
100801 General Error occurred while checking the OpportunityLine permission
100802 OpportunityLine edit permission denied
100803 OpportunityLine parameter is missing
100804 Error occurred while checking the OpportunityLine is existing or not.
100805 OpportunityLine is not existing
100806 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Opportunity_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity_Line resource contract, you need to Pass "Opportunity_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity_Line. Please check the allowed operations on this resource Opportunity_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity_Line. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OpportunityId String By using the OpportunityId parameter you can update a specific Opportunity_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one opportunityline in the response.
Note : When the OpportunityId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object Array This parameter is mandatory and allows you to insert the relevant and required information on the Opportunity_Line resource for that particular Edit operation. The Data object is defined as follows:
   "Data" :
  {
    "Name" : "Test opportunityline 123" 
     , "Address1" : "Test address"
     , "City" : "Dublin"
    [ , ...]
  }
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Opportunity_Line resource by Opportunity_Line identifier OpportunityId.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_Line",
    "Operation": "Edit",
    "OpportunityId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Data" : [
      {
        "ItemIndex" : "1",
        "ItemNumber" : "Plastic",
        "ItemName" : "Cup"
      },
      {
        "ItemIndex" : "2",
        "ItemNumber" : "Rope",
        "ItemName" : "12 inch rope"
      }
    ]
  }             
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": null
  }							

Example programs

Edit an Opportunity_Line.
The sample C#.Net code is a simple RestClient that uses the API to edit an Opportunity_Line.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example edit program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity_Line",
Operation = "Edit",
OpportunityId = ""8520fcf8-3abc-4006-8845-ec9f69c0d518,
Data = new System.Collections.Generic.Dictionary<string, object>()
[
{
{"ItemIndex" , "1"},
{"ItemNumber" , "Plastic"},
{"ItemName" , "Cup"}
},
{
{"ItemIndex" , "2"},
{"ItemNumber" , "Rope"},
{"ItemName" , "12 inch rope"}
}
]
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": null
  }							  

Opportunity_SalesStageHistory

Opportunity_SalesStageHistory is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity_SalesStageHistory

Available operations

Get

List of standard fields

FieldDescription
Id Stores a Universally Unique Identifier (UUID) to identify an opportunity stage history uniquely
OpportunityId Gets the opportunityid as an UUID
OpportunityTitle Stores the opportunity title
StartDate Stores the start date of an opportunity stage history
EndDate Stores the end date of an opportunity stage history
SalesStageId Gets the salesstageid as an UUID
Description Gets a multiline short description
Probability Gets the probability
IsLead Gets the islead
IsWon Gets the iswon
IsLost Gets the islost
IsNoDecision Gets the isnodecision
OwnerId Gets the ownerid as an UUID
Owner Gets the owner of an opportunity stage history

Operations

Opportunity_SalesStageHistory/Get

Get operation contract allows you to perform read operation on the Opportunity_SalesStageHistory resource.
ErrorCode Description
100201 General Error occurred while checking permission
100202 View permission denied
100203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Opportunity_SalesStageHistory/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Opportunity_SalesStageHistory resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Opportunity_Line resource contract, you need to Pass "Opportunity_SalesStageHistory" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Opportunity_SalesStageHistory. Please check the allowed operations on this resource Opportunity_SalesStageHistory. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Opportunity_SalesStageHistory. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Opportunity_SalesStageHistory that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
Id String By using the Id parameter you can get a specific Opportunity_SalesStageHistory resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one Opportunity Sales Stage History in the response.
Note : When the Id parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Opportunity_SalesStageHistory resource for the particular Get operation. The filer object is defined as follows:
  {
    "<column_name_1>" : "<preffered_value_1>" 
    [ , "<column_name_2>" : "<preffered_value_2>"  
      [ , ...] 
    ]
  }
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Opportunity_SalesStageHistory resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Opportunity_SalesStageHistory with stagename as Selected or Proposal.
    [StageName] in ('Selected','Proposal')
  • Example 2 :
    Getting the List of all Opportunity_SalesStageHistory who has a OpportunityTitle.
    ISNULL([OpportunityTitle],'') <> ''
  • Example 3 :
    Getting the List of all Opportunity_SalesStageHistory who has a StageName or Owner is 'xyz'.
    (ISNULL([StageName],'') <> '') OR ([Owner] = 'XYZ')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Opportunity_SalesStageHistory resource for the particular Get operation. The page object is defined as follows:
  {
    PageNumber : "<page_number>",
    PageSize : "<page_number>"
  }
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Opportunity_SalesStageHistory records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Opportunity_SalesStageHistory records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Opportunity_SalesStageHistory resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
  {
    Column : "<column>"
    [,Order : "Asc"(Default)|"Desc" ]
  }
Where, <column> defines the particular column on which the Opportunity_SalesStageHistory record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Opportunity_SalesStageHistory resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Opportunity_SalesStageHistory resource filtered by Opportunity_SalesStageHistory identifier Id.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_SalesStageHistory",
    "Operation": "Get",
    "Id" : "7dfcf105-09c4-43dd-8342-b05633186d82"
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "RowNumber": 1,
        "id": "7dfcf105-09c4-43dd-8342-b05633186d82",
        "opportunityid": "fa1fe846-4761-415f-9292-1248108568fc",
        "OpportunityTitle": "O00005",
        "Startdate": "2017-11-02T14:06:21.053",
        "Enddate": null,
        "SalesStageId": "61de8fd1-482a-442c-b072-3a06cacd9606",
        "StageName": "Identified",
        "Description": "",
        "Probability": 20.0,
        "IsLead": false,
        "IsWon": false,
        "IsLost": false,
        "IsNoDecision": false,
        "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "Owner": "Willy Wonka"
      }
    ]
  }							
Request for a list of all Opportunity_SalesStageHistory resources present in the ItemNumber of Rope.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_SalesStageHistory",
    "Operation": "Get",
    "Filter": {
      "StageName": "Identified"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "RowNumber": 1,
        "id": "7dfcf105-09c4-43dd-8342-b05633186d82",
        "opportunityid": "fa1fe846-4761-415f-9292-1248108568fc",
        "OpportunityTitle": "O00005",
        "Startdate": "2017-11-02T14:06:21.053",
        "Enddate": null,
        "SalesStageId": "61de8fd1-482a-442c-b072-3a06cacd9606",
        "StageName": "Identified",
        "Description": "",
        "Probability": 20.0,
        "IsLead": false,
        "IsWon": false,
        "IsLost": false,
        "IsNoDecision": false,
        "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "Owner": "Willy Wonka"
      }
    ]
  }						
Request for a list of all Opportunity_SalesStageHistory resources, with just 4 columns, who are present in the ItemNumber of Rope.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_SalesStageHistory",
    "Operation": "Get",
    "Columns": [ "OpportunityTitle","StageName","Description" ],
    "Filter": {
      "StageName": "Identified"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "OpportunityTitle": "O00005",
        "StageName": "Identified",
        "Description": "",
      }
    ]
  }						
Request for the first page in the list of all Opportunity_SalesStageHistory resources sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_SalesStageHistory",
    "Operation": "Get",
    "Columns": [ "OpportunityTitle","StageName","Description" ],
    "Sort": {
      "Column": "StageName",
      "Order": "Desc"
    },
    "Page": {
      "PageNumber": "1",
      "PageSize": "20"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Records": [
        {
          "OpportunityTitle": "O00005",
          "StageName": "Identified",
          "Description": "",
        },
        {
          "OpportunityTitle": "O00006",
          "StageName": "Identified",
          "Description": "Test",
        }
      ],
      "RecordInfo": {
        "RecordCount": 2,
        "PageNumber": 1,
        "PageSize": 20,
        "PageCount": 0
      }
    }
  }						
Request for the first page in the list of all Opportunity_SalesStageHistory resources present in the ItemNumber of Plastic or Rope in the ItemName Plastic Recycled. The list sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
  {
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Opportunity_SalesStageHistory",
    "Operation": "Get",
    "Columns": [ "OpportunityTitle","StageName","Description" ],
    "SQLFilter": "StageName in ('Identified','Selected') and Owner = 'Willy Wonka'",
    "Sort": {
      "Column": "StageName",
      "Order": "Desc"
    },
    "Page": {
      "PageNumber": "1",
      "PageSize": "20"
    }
  }							
Response :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Records": [
      {
        "OpportunityTitle": "O00010",
        "StageName": "Selected",
        "Description": ""
      },
      {
        "OpportunityTitle": "O00005",
        "StageName": "Identified",
        "Description": ""
      }
    ],
    "RecordInfo": {
      "RecordCount": 2,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
    }
  }					

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an OpportunitySalesStageHistory.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Opportunity_SalesStageHistory",
Operation = "Get",
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"StageName","Identified"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": [
      {
        "RowNumber": 1,
        "id": "7dfcf105-09c4-43dd-8342-b05633186d82",
        "opportunityid": "fa1fe846-4761-415f-9292-1248108568fc",
        "OpportunityTitle": "O00005",
        "Startdate": "2017-11-02T14:06:21.053",
        "Enddate": null,
        "SalesStageId": "61de8fd1-482a-442c-b072-3a06cacd9606",
        "StageName": "Identified",
        "Description": "",
        "Probability": 20.0,
        "IsLead": false,
        "IsWon": false,
        "IsLost": false,
        "IsNoDecision": false,
        "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "Owner": "Willy Wonka"
      }
    ]
  }                 

Product

Product is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
GroupId Stores a Universally Unique Identifier (UUID) to uniquely identify the group of that product.
ItemGroup Stores the name of the group related to that item.
ItemId Stores a Universally Unique Identifier (UUID) to uniquely identify that item.
ItemName Stores the Item Name information.
Number Stores the number of that Item for reference.
Description Stores the details description about the product for reference.
UofM Stores the Unit of Measurement information of that product.
Cost Stores the information related to the cost of the product.
Price Stores the information related to the price of the product.
Weight Stores the information related to the Weight of the product.
NotTax Stores the information whether the product is under taxable or not.
LastEditDate Stores the information about the last editing date of that product.
CreationDate Stores the information about the creation date of that product.
CommissionRate Stores the information about the Commission Rate of the product if any.
UnitQty Stores the quantity information of the product.

Operations

Product/Get

Get operation contract allows you to perform read operation on the Product resource.
ErrorCode Description
50201 General Error occurred while checking permission
50202 View permission denied
50203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Product resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product resource contract, you need to Pass "Product" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Product that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
ItemId String By using the ItemId parameter you can get a specific Product resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one product in the response.
Note : When the ItemId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Product resource for the particular Get operation. The filer object is defined as follows:
{
      "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
  [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Product resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the information of the Product which has the Number equals to 'F0003'.
     "SQLFilter": "[Number] = 'F0003'"
                      
  • Example 2 :
    Getting the List of all Product who has the Cost more than 1.00.
    "SQLFilter": "[Cost] > '1.00'"
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Product resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Product records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Product records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Product resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column name>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Product record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Product resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Product resource filtered by Product identifier ItemId.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Product",
    "Operation": "Get",
    "ItemId": "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146"
} 						
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "ItemId": "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146",
    "groupid": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
    "Number": "F0003",
    "Name": "Beds",
    "UofM": "Ea",
    "Cost": 1228.42,
    "Price": 1930.21,
    "NotTax": false,
    "CommissionRate": 0.0,
    "Weight": 0.0,
    "Description": "complete bed accessoties",
    "UnitQty": 0.0,
    "UnitQtyModeID": 0,
    "ProductType": ""
  }
}         		
Request for a list of all Product resources present with the Name = Beds.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Product",
    "Operation": "Get",
    "Filter": {
        "Name": "Beds"
    }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "ItemId": "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146",
      "groupid": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
      "Number": "F0003",
      "Name": "Beds",
      "UofM": "Ea",
      "Cost": 1228.42,
      "Price": 1930.21,
      "NotTax": false,
      "CommissionRate": 0.0,
      "Weight": 0.0,
      "Description": "complete bed accessoties",
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "ProductType": ""
    }
  ]
}							
Request for a list of all Product resources, with just any 4 selected columns, who's Description is like "A book of Short Stories".

Request :

{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Product",
    "Operation": "Get",
    "Columns": [
        "ItemId",
        "GroupId",
        "Cost",
        "Description"
    ],
    "Filter": {
        "Description": "A book of Short Stories"
    }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ItemId": "ed291abd-7e59-41a1-b8ed-193ae2922acf",
      "GroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
      "Cost": 5.35,
      "Description": "A book of Short Stories"
    }
  ]
}             
Request for the first page in the list of all Product resources sorted by Cost in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Get",
  "Columns": [ "ItemId","GroupId","Cost","Description" ],
  "Sort": {
    "Column": "Cost",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "ItemId": "45bd10b3-aa41-4788-88db-7177dd6e65c1",
        "GroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Cost": 1289.67,
        "Description": "An assembled product from IKEA"
      },
      {
        "ItemId": "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146",
        "GroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Cost": 1228.42,
        "Description": "complete bed accessoties"
      },
      {
        "ItemId": "36d0702c-b843-4654-beac-e031b727c3f5",
        "GroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Cost": 259.99,
        "Description": "4 Chairs and a Table good for tea party"
      },
      {
        "ItemId": "30aca1f1-16bd-4121-9aad-fa30bd26237c",
        "GroupId": "05da23bf-439c-4310-9324-0e938a0c507a",
        "Cost": 15.23,
        "Description": "Mobile phones"
      },
      {
        "ItemId": "377e2820-8905-4057-8f6c-de7075984ca0",
        "GroupId": "05da23bf-439c-4310-9324-0e938a0c507a",
        "Cost": 11.25,
        "Description": "Refrigerator"
      },
      {
        "ItemId": "4a205aec-66bf-44aa-8cf5-55200fe8b730",
        "GroupId": "05da23bf-439c-4310-9324-0e938a0c507a",
        "Cost": 8.46,
        "Description": "Nikon Camera"
      },
      {
        "ItemId": "ed291abd-7e59-41a1-b8ed-193ae2922acf",
        "GroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
        "Cost": 5.35,
        "Description": "A book of Short Stories"
      },
      {
        "ItemId": "c052438b-089c-40a1-bd4b-1fea39ca47d0",
        "GroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
        "Cost": 4.99,
        "Description": "A book of computer programmings"
      },
      {
        "ItemId": "5c010d6e-9632-4575-9bde-e6f216d2955f",
        "GroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
        "Cost": 3.99,
        "Description": "A book of Digital Electronics"
      }
    ],
    "RecordInfo": {
      "RecordCount": 9,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
} 						
Request for the first page in the list of all Product resources who has the Cost more than 5.00. The list sorted by Cost in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Get",
  "Columns": [ "ItemId","GroupId", "Cost","Description" ],
  "SQLFilter": "[Cost] > '5.00'",
  "Sort": {
    "Column": "Cost",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "ItemId": "45bd10b3-aa41-4788-88db-7177dd6e65c1",
        "GroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Cost": 1289.67,
        "Description": "An assembled product from IKEA"
      },
      {
        "ItemId": "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146",
        "GroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Cost": 1228.42,
        "Description": "complete bed accessoties"
      },
      {
        "ItemId": "36d0702c-b843-4654-beac-e031b727c3f5",
        "GroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Cost": 259.99,
        "Description": "4 Chairs and a Table good for tea party"
      },
      {
        "ItemId": "30aca1f1-16bd-4121-9aad-fa30bd26237c",
        "GroupId": "05da23bf-439c-4310-9324-0e938a0c507a",
        "Cost": 15.23,
        "Description": "Mobile phones"
      },
      {
        "ItemId": "377e2820-8905-4057-8f6c-de7075984ca0",
        "GroupId": "05da23bf-439c-4310-9324-0e938a0c507a",
        "Cost": 11.25,
        "Description": "Refrigerator"
      },
      {
        "ItemId": "4a205aec-66bf-44aa-8cf5-55200fe8b730",
        "GroupId": "05da23bf-439c-4310-9324-0e938a0c507a",
        "Cost": 8.46,
        "Description": "Nikon Camera"
      },
      {
        "ItemId": "ed291abd-7e59-41a1-b8ed-193ae2922acf",
        "GroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
        "Cost": 5.35,
        "Description": "A book of Short Stories"
      }
    ],
    "RecordInfo": {
      "RecordCount": 7,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}           	

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an product.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product",
Operation = "Get",
Columns = new string[] { "ItemId", "GroupId", "Cost","Description" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"Cost","1289.67"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ItemId": "45bd10b3-aa41-4788-88db-7177dd6e65c1",
      "GroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
      "Cost": 1289.67,
      "Description": "An assembled product from IKEA"
    }
  ]
}								    

Product/Exists

Exists operation checks if the Product resource exists or not.
ErrorCode Description
50301 General Error occurred while checking the Product

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Product resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product resource contract, you need to Pass "Product" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product. Please check the allowed operations on this resource Product. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemId String By using the ItemId parameter you can get a specific Product resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one product in the response.
Note : When the ItemId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Product resource for the particular Exists operation. The filer object is defined as follows:
{
      "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
  [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Product resource filtered by Product identifier ItemId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Exists",
  "ItemId" : "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							
Request for a list of all Product resources for which UofM is Pc .

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Exists",
  "Data": {
    "UofM": "Pc"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}             

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product",
Operation = "Exists",
ItemId = "ED291ABD-7E59-41A1-B8ED-193AE2922ACF"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

Product/Permission

Permission operation contract allows you to know the access priviledges on the Product resource.
ErrorCode Description
50401 General Error occurred while checking the Product permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Product resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product resource contract, you need to Pass "Product" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Product. Product resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Product resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Permission",
  "Type" : "All"
}							
Response :
                {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": true
  }
}             
Request to get the View access priviledges assigned to your API-key on the Product resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
                {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}             

Example programs

Request to get all the available access priviledges assigned to your API-key on the Product resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Product resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": true
  }
}     	  		    

Product/Create

Create operation contract allows you to perform create operation on the Product resource.
ErrorCode Description
50701 Response error while creating Product
50702 Access Denied! You do not have the permission
50703 Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Product resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product resource contract, you need to Pass "Product" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Product resource for that particular Create operation. The Data object is defined as follows:
  "Data" :
{
 "Name": "wardrobe2",
 "Number" : "F0005",
 "Description" : "this is a type furniture",
 "Cost" : "542.23",
 "Weight": "24.62",
 "GroupId" : "A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Product resource.

Request :
{
    "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
    "Resource": "Product",
    "Operation": "Create",
    "Data" :
{
 "Name": "wardrobe",
 "Number" : "F0004",
 "Description" : "this is a type furniture",
 "Cost" : "542.23",
 "Weight": "24.62",
 "GroupId" : "A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"
}
    
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemId": "baadd7e9-63f1-46db-a104-7d3c0faf383f",
    "Status": "Created"
  }
}							

Example programs

Request with columns.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name","wardrobe"},
{"Number","F0004"},
{"Description","this is a type furniture"},
{"Cost","542.23"},
{"Weight","24.62"},
{"GroupId","A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemId": "baadd7e9-63f1-46db-a104-7d3c0faf383f",
    "Status": "Created"
  }
}									    

Product/Edit

Edit operation contract allows you to perform edit operation on the Product resource.
ErrorCode Description
50801 General Error occurred while checking the Product permission
50802 Product edit permission denied
50803 Product parameter is missing
50804 Error occurred while checking the Product is existing or not.
50805 Product is not existing
50806 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Product resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product resource contract, you need to Pass "Product" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product. Please check the allowed operations on this resource Contact. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemId String By using the ItemId parameter you can update a specific Product resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one product in the response.
Note : When the ItemId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Product resource for that particular Edit operation. The Data object is defined as follows:
  "Data" :
{
 "Name": "wardrobe2",
 "Number" : "F0005",
 "Description" : "this is a type furniture",
 "Cost" : "542.23",
 "Weight": "24.62",
 "GroupId" : "A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Product resource filtered by Product identifier ItemId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Edit",
  "ItemId" : "ED291ABD-7E59-41A1-B8ED-193AE2922ACF",
  "Data" : 
     {
 "Name": "wardrobe",
 "Number" : "F0007",
 "Description" : "this is a type furniture",
 "Cost" : "542.23",
 "Weight": "24.62",
 "GroupId" : "A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"
}
}								
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemId": "ed291abd-7e59-41a1-b8ed-193ae2922acf",
    "Status": "Updated"
  }
}            

Example programs

Request with columns.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Update request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product",
Operation = "Edit",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name","wardrobe"},
{"Number","F0004"},
{"Description","this is a type furniture"},
{"Cost","542.23"},
{"Weight","24.62"},
{"GroupId","A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemId": "ed291abd-7e59-41a1-b8ed-193ae2922acf",
    "Status": "Updated"
  }
}								    

Product/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Product resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Product]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Product resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product resource contract, you need to Pass "Product" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product. Please check the allowed operations on this resource Product. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemId String By using the ItemId parameter you can update a specific Product resource by its identifier. Also, by not using the ItemId parameter you can create a specific Product resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one product in the response.
Note : When the ItemId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Product resource for that particular Create Or Edit operation. The Data object is defined as follows:
 "Data" :
{
 "Name": "wardrobe",
 "Number" : "F0004",
 "Description" : "this is a type furniture",
 "Cost" : "542.23",
 "Weight": "24.62",
 "GroupId" : "A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Product resource filtered by Product identifier ItemId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Create Or Edit",
  "ItemId" : "ED291ABD-7E59-41A1-B8ED-193AE2922ACF",
                 
 "Data" :
{
 "Name": "Sofa & Bed",
 "Number" : "F0009",
 "Description" : "this is a type furniture",
 "Cost" : "542.23",
 "Weight": "24.62",
 "GroupId" : "A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"
}
  
}							
Response :
              {
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemId": "ed291abd-7e59-41a1-b8ed-193ae2922acf",
    "Status": "Updated"
  }
}            

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example CreateOrUpdate request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product",
Operation = "Create Or Edit",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name","wardrobe"},
{"Number","F0004"},
{"Description","this is a type furniture"},
{"Cost","542.23"},
{"Weight","24.62"},
{"GroupId","A013BC79-D5A4-4AB6-BFAF-08B547D86CCB"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemId": "ed291abd-7e59-41a1-b8ed-193ae2922acf",
    "Status": "Updated"
  }
}								    

Product/Delete

Delete operation contract allows you to perform delete operation on the Product resource.
ErrorCode Description
50501 General Error occurred while checking the Product permission
50502 Product delete permission denied
50503 Only occurs when attempted an Product delete by Id and the Product do not exists
50504 General Error occurred while deleting an Product
50505 Validation error, any of the three should be provided, 1. Product, 2. Filter, 3. SQLFilter. Which is missing
50506 Error occurred while checking the Product is existing or not. (Only occurs when attempted an Product delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Product resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product resource contract, you need to Pass "Product" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product. Please check the allowed operations on this resource Product. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemId String By using the ItemId parameter you can delete a specific Product resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one product in the response.
Note : When the ItemId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Product resource for the particular Delete operation. The filer object is defined as follows:
{
      "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
  [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Product resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the information of the Product which has the Number equals to 'F0003'.
    "SQLFilter": "[Number] = 'F0003'"
  • Example 2 :
    Getting the List of all Product who has the Cost more than 1.00.
    "SQLFilter": "[Cost] > '1.00'"
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Delete operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request for a single Product resource filtered by Product identifier ItemId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Delete",
  "ItemId" : "BAADD7E9-63F1-46DB-A104-7D3C0FAF383F"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemId": "baadd7e9-63f1-46db-a104-7d3c0faf383f",
    "Name": "wardrobe",
    "Status": "Deleted"
  }
}             
Request for a list of all Product resources present with the Name = Beds.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Delete",
  "Filter": {
    "Name": "Beds"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ItemId": "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146",
      "Name": "Beds",
      "Status": "Deleted"
    }
  ]
}                
Request for a list of all Product resources, who has the Cost less than 2.00.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product",
  "Operation": "Delete",
  "SQLFilter": "[Cost] < '2.00'"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": []
}                

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product",
Operation = "Delete",
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name","Beds"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ItemId": "ba3c2fdb-bcfd-4ce5-9674-ebcc5933a146",
      "Name": "Beds",
      "Status": "Deleted"
    }
  ]
}								    

Product_Group

Product_Group is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product_Group

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
ItemGroupId Stores a Universally Unique Identifier (UUID) to identify an product group uniquely.
ParentId Stores the parent group reference as an UUID
Group Stores the product group name
CreationDate Gets the Creation Date
LastEditDate Gets the Date of Last Modification

Operations

Product_Group/Get

Get operation contract allows you to perform read operation on the Product_Group resource.
ErrorCode Description
60201 General Error occurred while checking permission
60202 View permission denied
60203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product_Group/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Product_Group resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product_Group resource contract, you need to Pass "Product_Group" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product_Group. Please check the allowed operations on this resource Product_Group. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product_Group. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Product_Group that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
ItemGroupId String By using the ItemGroupId parameter you can get a specific Product_Group resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one productgroup in the response.
Note : When the ItemGroupId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Product_Group resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Product_Group resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Product_Group established in the cities Memphis or Columbus of the country US.
    [Group] in ('Book','Furniture')
  • Example 2 :
    Getting the List of all Product_Group who has a website.
    ISNULL([Gruop],'') <> ''
  • Example 3 :
    Getting the List of all Product_Group who has a website or established in the country US.
    (ISNULL([Group],'') <> '') OR ([CreationDate] = '2017-11-02 09:28:31.417')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Product_Group resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Product_Group records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Product_Group records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Product_Group resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Product_Group record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Product_Group resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Product_Group resource filtered by Product_Group identifier ItemGroupId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Get",
  "ItemGroupId" : "92e378ec-65f8-46a3-87fb-0905476f433d"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "ItemGroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
    "ParentId": "00000000-0000-0000-0000-000000000000",
    "GroupLocator": "[Books]",
    "Group": "Books",
    "LastEditDate": "2017-11-02T09:29:30.933",
    "CreationDate": "2017-11-02T09:29:30.933"
  }
}							
Request for a list of all Product_Group resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Get",
  "Filter": {
    "Group": "Furniture"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "ItemGroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
      "ParentId": "00000000-0000-0000-0000-000000000000",
      "GroupLocator": "[Furniture]",
      "Group": "Furniture",
      "LastEditDate": "2017-11-02T09:28:31.417",
      "CreationDate": "2017-11-02T09:28:31.417"
    }
  ]
}							
Request for a list of all Product_Group resources, with just 4 columns, who are present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Get",
  "Columns": [ "ItemGroupId","Group","CreationDate" ],
  "Filter": {
    "Group": "Furniture"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ItemGroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
      "Group": "Furniture",
      "CreationDate": "2017-11-02T09:28:31.417"
    }
  ]
}							
Request for the first page in the list of all Product_Group resources sorted by ProductGroup in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Get",
  "Columns": [ "ItemGroupId","Group","CreationDate" ],
  "Sort": {
    "Column": "Group",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "ItemGroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Group": "Furniture",
        "CreationDate": "2017-11-02T09:28:31.417"
      },
      {
        "ItemGroupId": "05da23bf-439c-4310-9324-0e938a0c507a",
        "Group": "Electronics",
        "CreationDate": "2017-11-02T09:28:55.4"
      },
      {
        "ItemGroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
        "Group": "Books",
        "CreationDate": "2017-11-02T09:29:30.933"
      }
    ],
    "RecordInfo": {
      "RecordCount": 3,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}							
Request for the first page in the list of all Product_Group resources present in the City of Memphis or Ohio in the Country US. The list sorted by ProductGroup in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Get",
  "Columns": [ "ItemGroupId","Group","CreationDate" ],
  "SQLFilter": "[Group] in ('Books','Furniture')",
  "Sort": {
    "Column": "Group",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "ItemGroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
        "Group": "Furniture",
        "CreationDate": "2017-11-02T09:28:31.417"
      },
      {
        "ItemGroupId": "92e378ec-65f8-46a3-87fb-0905476f433d",
        "Group": "Books",
        "CreationDate": "2017-11-02T09:29:30.933"
      }
    ],
    "RecordInfo": {
      "RecordCount": 2,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an productgroup.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product_Group",
Operation = "Get",
Columns = new string[] { "ItemGroupId","Group","CreationDate" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"Group","Furniture"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "ItemGroupId": "a013bc79-d5a4-4ab6-bfaf-08b547d86ccb",
      "Group": "Furniture",
      "CreationDate": "2017-11-02T09:28:31.417"
    }
  ]
}							

Product_Group/Exists

Exists operation checks if the Product_Group resource exists or not.
ErrorCode Description
60301 General Error occurred while checking the ProductGroup

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product_Group/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Product_Group resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product_Group resource contract, you need to Pass "Product_Group" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product_Group. Please check the allowed operations on this resource Product_Group. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product_Group. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemGroupId String By using the ItemGroupId parameter you can get a specific Product_Group resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one productgroup in the response.
Note : When the ItemGroupId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Product_Group resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Product_Group resource filtered by Product_Group identifier ItemGroupId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Exists",
  "ItemGroupId" : "92e378ec-65f8-46a3-87fb-0905476f433d"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}             
Request for a list of all Product_Group resources present in the City of Melbourne.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Exists",
  "Data": {
    "Group": "Books"
  }
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}             

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product_Group",
Operation = "Exists",
ItemGroupId = "92e378ec-65f8-46a3-87fb-0905476f433d"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}                 

Product_Group/Permission

Permission operation contract allows you to know the access priviledges on the Product_Group resource.
ErrorCode Description
60401 General Error occurred while checking the ProductGroup permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product_Group/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Product_Group resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product_Group resource contract, you need to Pass "Product_Group" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product_Group. Please check the allowed operations on this resource Product_Group. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product_Group. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Product_Group. Product_Group resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Product_Group resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Permission",
  "Type" : "All"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": true
  }
}             
Request to get the View access priviledges assigned to your API-key on the Product_Group resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Permission",
  "Type" : "View"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}             

Example programs

Request to get all the available access priviledges assigned to your API-key on the Product_Group resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Product_Group resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product_Group",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": true
  }
}             

Product_Group/Create

Create operation contract allows you to perform create operation on the Product_Group resource.
ErrorCode Description
60701 Response error while creating ProductGroup
60702 Access Denied! You do not have the permission
60703 Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product_Group/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Product_Group resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product_Group resource contract, you need to Pass "Product_Group" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product_Group. Please check the allowed operations on this resource Product_Group. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product_Group. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Product_Group resource for that particular Create operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test productgroup 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
  ]
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Product_Group resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Create",
  "Data" : {
    "Group": "Grocery"
  }
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "6db112c9-2ca4-4d6c-a327-8d8d57d1c12f",
    "Status": "Created"
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product_Group",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Group","Grocery"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "6db112c9-2ca4-4d6c-a327-8d8d57d1c12f",
    "Status": "Created"
  }
}                 

Product_Group/Edit

Edit operation contract allows you to perform edit operation on the Product_Group resource.
ErrorCode Description
60801 General Error occurred while checking the ProductGroup permission
60802 ProductGroup edit permission denied
60803 ProductGroup parameter is missing
60804 Error occurred while checking the ProductGroup is existing or not.
60805 ProductGroup is not existing
60806 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product_Group/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Product_Group resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product_Group resource contract, you need to Pass "Product_Group" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product_Group. Please check the allowed operations on this resource Product_Group. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product_Group. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemGroupId String By using the ItemGroupId parameter you can update a specific Product_Group resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one productgroup in the response.
Note : When the ItemGroupId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Product_Group resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test productgroup 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
  ]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Product_Group resource filtered by Product_Group identifier ItemGroupId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Edit",
  "ItemGroupId": "6DB112C9-2CA4-4D6C-A327-8D8D57D1C12F",
  "Data" : {
    "Group": "Groceries"
  }
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "6db112c9-2ca4-4d6c-a327-8d8d57d1c12f",
    "Status": "Updated"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product_Group",
Operation = "Edit",
ItemGroupId = "6DB112C9-2CA4-4D6C-A327-8D8D57D1C12F",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Group","Groceries"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "6db112c9-2ca4-4d6c-a327-8d8d57d1c12f",
    "Status": "Updated"
  }
}             

Product_Group/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Product_Group resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Product_Group]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Product_Group resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product_Group resource contract, you need to Pass "Product_Group" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product_Group. Please check the allowed operations on this resource Product_Group. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product_Group. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemGroupId String By using the ItemGroupId parameter you can update a specific Product_Group resource by its identifier. Also, by not using the ItemGroupId parameter you can create a specific Product_Group resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one productgroup in the response.
Note : When the ItemGroupId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Product_Group resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test productgroup 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
  ]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Product_Group resource filtered by Product_Group identifier ItemGroupId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Create Or Edit",
  "ItemGroupId": "6DB112C9-2CA4-4D6C-A327-8D8D57D1C12F",
  "Data" : {
    "Group": "Groceries"
  }
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "6db112c9-2ca4-4d6c-a327-8d8d57d1c12f",
    "Status": "Updated"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product_Group",
Operation = "Create Or Edit",
ItemGroupId = "6DB112C9-2CA4-4D6C-A327-8D8D57D1C12F",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Group","Groceries"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "6db112c9-2ca4-4d6c-a327-8d8d57d1c12f",
    "Status": "Updated"
  }
}             

Product_Group/Delete

Delete operation contract allows you to perform delete operation on the Product_Group resource.
ErrorCode Description
60501 General Error occurred while checking the ProductGroup permission
60502 ProductGroup delete permission denied
60503 Only occurs when attempted an ProductGroup delete by Id and the ProductGroup do not exists
60504 General Error occurred while deleting an ProductGroup
60505 Validation error, any of the three should be provided, 1. ProductGroup, 2. Filter, 3. SQLFilter. Which is missing
60506 Error occurred while checking the ProductGroup is existing or not. (Only occurs when attempted an ProductGroup delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Product_Group/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Product_Group resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Product_Group resource contract, you need to Pass "Product_Group" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Product_Group. Please check the allowed operations on this resource Product_Group. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Product_Group. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
ItemGroupId String By using the ItemGroupId parameter you can delete a specific Product_Group resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one productgroup in the response.
Note : When the ItemGroupId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Product_Group resource for the particular Delete operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Product_Group resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Product_Group established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Product_Group who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Deleting the List of all Product_Group who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request for a single Product_Group resource filtered by Product_Group identifier ItemGroupId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Product_Group",
  "Operation": "Delete",
  "ItemGroupId" : "8dbe2b29-88dd-4e70-a791-8306cc652772"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "8dbe2b29-88dd-4e70-a791-8306cc652772",
    "GroupLocator": "[Grocery]",
    "Group": "Grocery",
    "Status": "Deleted"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Product_Group",
Operation = "Delete",
ItemGroupId = "8dbe2b29-88dd-4e70-a791-8306cc652772"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "ItemGroupId": "8dbe2b29-88dd-4e70-a791-8306cc652772",
    "GroupLocator": "[Grocery]",
    "Group": "Grocery",
    "Status": "Deleted"
  }
}             

Quotation

Quotation is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
QuotationId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify an quotation uniquely.
QuoteNumber
GET | SET, Required, Type: String, Length: 64
Stores the full quotation number along with branch or site information
QuoteDate
GET, Read Only, Type: DateTime
Stores the Quotation Date
Description
GET | SET, Optional, Type: String, Length: 256
Stores a multiline short description
Status
GET | SET, Optional, Type: String, Length: 64
Stores Status of the quotation
Account
SET, Required, Type: Strings, Length: 64
Stores the account of quotation
AccountName
GET, ReadOnly, Type: Strings
Stores the Account Name
AccountNumber
GET, ReadOnly, Type: Strings
Stores the Account Number
AccountId
GET | SET, Optional, Type: UUID
Stores the Account Reference as an UUID
Contact
SET, Required, Type: Strings, Length: 97
Stores the Contact Name
ContactId
GET | SET, Optional, Type: UUID
Stores the Contact Reference as an UUID
FirstName
GET, ReadOnly, Type: String
Stores the FirstName of that Contact
MiddleName
GET, ReadOnly, Type: String
Stores the MiddleName of that Contact
LastName
GET, ReadOnly, Type: String
Stores the LastName of that Contact
Phone
GET | SET, Optional, Type: String, Length: 32
Stores the Phone number of that Contact
Fax
GET | SET, Optional, Type: String, Length: 32
Stores the Fax number of that Contact
Email
GET | SET, Optional, Type: String, Length: 128
Stores the Email of that Contact
Note
GET | SET, Optional, Type: String, Length: Max
Stores the quotation note
CreationDate
GET, Read Only, Type: Datetime
Gets the Creation Date
LastEditDate
GET, Read Only, Type: Datetime
Gets the Date of Last Modification
ExpDate
GET | SET, Optional, Type: DateTime
Stores expiery date of the quotation
OwnerId
GET | SET, Optional, Type: UUID
Stores the Owner Reference as an UUID
Owner
GET, ReadOnly, Type: Strings
Stores the Owner Full Name
OwnerParentId
GET, ReadOnly, Type: UUID
Stores the Owner Partner Reference as an UUID
LeadSource
GET | SET, Optional, Type: String, Length: 32
Stores the lead source type
LeadSourceId
GET | SET, Optional, Type: UUID
Stores the lead source reference UUID
LeadId
GET | SET, Optional, Type: UUID
Stores the lead reference UUID
Bill To
GET, ReadOnly, Type: String
Stores the Billing To address
BillCountryCode
GET, ReadOnly, Type: String
Stores the Billing Country Code
BillCountry
GET, ReadOnly, Type: String
Stores the Billing Country name
Address1
GET, ReadOnly, Type: String
Stores the billing address segment Addresss1
Address2
GET, ReadOnly, Type: String
Stores the billing address segment Addresss2
City
GET, ReadOnly, Type: String
Stores the billing address segment City
State
GET, ReadOnly, Type: String
Stores the billing address segment State/Province/County
ZipCode
GET, ReadOnly, Type: String
Stores the billing address segment Pin or Zip Code
BtAddress1
GET | SET, Optional, Type: String, Length: 64
Stores the Billing Country name
BtAddress2
GET | SET, Optional, Type: String, Length: 64
Stores the Billing Country name
BtCity
GET | SET, Optional, Type: String, Length: 64
Stores the Billing Country name
BtState
GET | SET, Optional, Type: String, Length: 32
Stores the Billing Country name
BtZip
GET | SET, Optional, Type: String, Length: 10
Stores the Billing Country name
BtCountry
GET | SET, Optional, Type: String, Length: 2
Stores the Billing Country name
StAddress1
GET | SET, Optional, Type: String, Length: 64
Stores the Billing Country name
StAddress2
GET | SET, Optional, Type: String, Length: 64
Stores the Billing Country name
StCity
GET | SET, Optional, Type: String, Length: 64
Stores the Billing Country name
StState
GET | SET, Optional, Type: String, Length: 32
Stores the Billing Country name
StZip
GET | SET, Optional, Type: String, Length: 10
Stores the Billing Country name
StCountry
GET | SET, Optional, Type: String, Length: 2
Stores the Billing Country name
Ship To
GET, ReadOnly, Type: String
Stores the Shipping To
ShipCountryCode
GET, ReadOnly, Type: String
Stores the Shipping Country Code
ShipCountry
GET, ReadOnly, Type: String
Stores the Shipping Country name
HasShippingAddress
GET | SET, Optional, Type: Boolean
Stores if quotation have shipping address or not
ShipAddress1
GET, ReadOnly, Type: String
Stores the shipping address segment Addresss1
ShipAddress2
GET, ReadOnly, Type: String
Stores the shipping address segment Addresss2
ShipCity
GET, ReadOnly, Type: String
Stores the shipping address segment City
ShipState
GET, ReadOnly, Type: String
Stores the shipping address segment State/Province/County
ShipZipCode
GET, ReadOnly, Type: String
Stores the shipping address segment Pin or Zip Code
Term
GET, ReadOnly, Type: String
Stores the quotation term
TermId
GET | SET, Optional, Type: UUID
Stores the quotation term reference as an UUID
SH
GET | SET, Optional, Type: Numeric
Stores SH
TaxRate
GET | SET, Optional, Type: Numeric
Stores the tax rate
SubTotal
GET, ReadOnly, Type: Numeric
Stores the sub total
Total
GET, ReadOnly, Type: Numeric
Stores the total
Tax
GET, ReadOnly, Type: Numeric
Stores the tax
Cost
GET | SET, Optional, Type: Numeric
Stores the cost
UserType
GET, Read Only, Type: String
Gets the UserType associated with the owner
UserRegion
GET, Read Only, Type: String
Gets the UserRegion associated with the owner

Operations

Quotation/Get

Get operation contract allows you to perform read operation on the Quotation resource.
ErrorCode Description
70201 General Error occurred while checking permission
70202 View permission denied
70203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Quotation resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation resource contract, you need to Pass "Quotation" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation. Please check the allowed operations on this resource Quotation. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Quotation that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
QuotationId String By using the QuotationId parameter you can get a specific Quotation resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one quotation in the response.
Note : When the QuotationId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Quotation resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Quotation resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Quotation established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Quotation who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Quotation who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Quotation resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Quotation records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Quotation records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Quotation resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Quotation record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Quotation resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Quotation resource filtered by Quotation identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Get",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "quotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "QuoteNumber": "Q00001",
    "QuoteDate": "2017-11-01T00:00:00",
    "Description": "",
    "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "ownerparentid": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "Status": "Active",
    "ExpDate": "2017-11-01T04:00:00",
    "Owner": "Willy Wonka",
    "Account": "Acme Corporation-USA",
    "AccountName": "Acme Corporation",
    "AccountNumber": "AC000006",
    "AccountId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
    "Contact": "Jey Trumph",
    "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
    "FirstName": "Jey",
    "MiddleName": "",
    "LastName": "Trumph",
    "Bill To": "123 6th St.  Melbourne FL 32904",
    "BillCountryCode": "US",
    "BillCountry": "USA",
    "Ship To": "123 6th St.  Melbourne FL 32904",
    "ShipCountryCode": "US",
    "ShipCountry": "USA",
    "Address1": "123 6th St.",
    "Address2": "",
    "City": "Melbourne",
    "State": "FL",
    "ZipCode": "32904",
    "BTZip": "32904",
    "ShipAddress1": "123 6th St.",
    "ShipAddress2": "",
    "ShipCity": "Melbourne",
    "ShipState": "FL",
    "ShipZipCode": "32904",
    "STZip": "32904",
    "Term": "Net 30",
    "TermId": "d3261fa2-06ce-4444-b8ec-6af11f5d4508",
    "HasShippingAddress": false,
    "SH": 223455.0,
    "TaxRate": 12.0,
    "SubTotal": 70850.0,
    "Total": 302807.0,
    "Tax": 8502.0,
    "Cost": 6150.0,
    "LeadSource": "Website",
    "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
    "leadid": "00000000-0000-0000-0000-000000000000",
    "Note": "",
    "Phone": "5656231289",
    "Fax": "5656231289",
    "Email": "jeytrumph@company.com",
    "UserType": "",
    "UserRegion": "",
    "CreationDate": "2017-11-01T08:10:51.497",
    "LastEditDate": "2017-11-01T11:35:41.37",
    "ext_quotationid": "8520fcf8-3abc-4006-8845-ec9f69c0d518"
  }
}							
Request for a list of all Quotation resources present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Get",
  "Filter": {
    "City": "Melbourne"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "RowNumber": 1,
        "quotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Description": "",
        "OwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "ownerparentid": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "Status": "Active",
        "ExpDate": "2017-11-01T04:00:00",
        "Owner": "Willy Wonka",
        "Account": "Acme Corporation-USA",
        "AccountName": "Acme Corporation",
        "AccountNumber": "AC000006",
        "AccountId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
        "Contact": "Jey Trumph",
        "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
        "FirstName": "Jey",
        "MiddleName": "",
        "LastName": "Trumph",
        "Bill To": "123 6th St.  Melbourne FL 32904",
        "BillCountryCode": "US",
        "BillCountry": "USA",
        "Ship To": "123 6th St.  Melbourne FL 32904",
        "ShipCountryCode": "US",
        "ShipCountry": "USA",
        "Address1": "123 6th St.",
        "Address2": "",
        "City": "Melbourne",
        "State": "FL",
        "ZipCode": "32904",
        "BTZip": "32904",
        "ShipAddress1": "123 6th St.",
        "ShipAddress2": "",
        "ShipCity": "Melbourne",
        "ShipState": "FL",
        "ShipZipCode": "32904",
        "STZip": "32904",
        "Term": "Net 30",
        "TermId": "d3261fa2-06ce-4444-b8ec-6af11f5d4508",
        "HasShippingAddress": false,
        "SH": 223455.0,
        "TaxRate": 12.0,
        "SubTotal": 70850.0,
        "Total": 302807.0,
        "Tax": 8502.0,
        "Cost": 6150.0,
        "LeadSource": "Website",
        "LeadSourceId": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
        "leadid": "00000000-0000-0000-0000-000000000000",
        "Note": "",
        "Phone": "5656231289",
        "Fax": "5656231289",
        "Email": "jeytrumph@company.com",
        "UserType": "",
        "UserRegion": "",
        "CreationDate": "2017-11-01T08:10:51.497",
        "LastEditDate": "2017-11-01T11:35:41.37",
        "ext_quotationid": "8520fcf8-3abc-4006-8845-ec9f69c0d518"
      }
    ],
    "RecordInfo": {
      "TotalAmount": 78807.0
    }
  }
}							
Request for a list of all Quotation resources, with just 4 columns, who are present in the City of Memphis.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Get",
  "Columns": [ "QuotationId","QuoteNumber","QuoteDate","Email" ],
  "Filter": {
    "City": "Melbourne"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "jeytrumph@company.com"
      }
    ],
    "RecordInfo": {
      "TotalAmount": 78807.0
    }
  }
}							
Request for the first page in the list of all Quotation resources sorted by Quotation in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Get",
  "Columns": [ "QuotationId","QuoteNumber","QuoteDate","Email" ],
  "Sort": {
    "Column": "QuoteNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "QuotationId": "07f29daa-3267-4fa2-ad79-802af66f9f35",
        "QuoteNumber": "Q00003",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "sandyhook@company.com"
      },
      {
        "QuotationId": "5b78f937-bba3-405a-ae37-ec13d89ebe02",
        "QuoteNumber": "Q00002",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "alicia.kim@company.com"
      },
      {
        "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "jeytrumph@company.com"
      }
    ],
    "RecordInfo": {
      "PageInfo": {
        "RecordCount": 3,
        "PageNumber": 1,
        "PageSize": 20,
        "PageCount": 1
      },
      "SummaryInfo": {
        "TotalAmount": 173300.71298217773
      }
    }
  }
}							
Request for the first page in the list of all Quotation resources present in the City of Memphis or Ohio in the Country US. The list sorted by Quotation in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Get",
  "Columns": [ "QuotationId","QuoteNumber","QuoteDate","Email" ],
  "SQLFilter": "QuoteNumber in ('Q00003','Q00002') and QuoteDate = '2017-11-01 00:00:00.000'",
  "Sort": {
    "Column": "QuoteNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "QuotationId": "07f29daa-3267-4fa2-ad79-802af66f9f35",
        "QuoteNumber": "Q00003",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "sandyhook@company.com"
      },
      {
        "QuotationId": "5b78f937-bba3-405a-ae37-ec13d89ebe02",
        "QuoteNumber": "Q00002",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "alicia.kim@company.com"
      }
    ],
    "RecordInfo": {
      "PageInfo": {
        "RecordCount": 2,
        "PageNumber": 1,
        "PageSize": 20,
        "PageCount": 1
      },
      "SummaryInfo": {
        "TotalAmount": 94493.712982177734
      }
    }
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an quotation.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation",
Operation = "Get",
Columns = new string[] { "QuotationId","QuoteNumber","QuoteDate","Email" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"City","Melbourne"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "QuoteNumber": "Q00001",
        "QuoteDate": "2017-11-01T00:00:00",
        "Email": "jeytrumph@company.com"
      }
    ],
    "RecordInfo": {
      "TotalAmount": 78807.0
    }
  }
}							

Quotation/Exists

Exists operation checks if the Quotation resource exists or not.
ErrorCode Description
70301 General Error occurred while checking the Quotation

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Quotation resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation resource contract, you need to Pass "Quotation" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation. Please check the allowed operations on this resource Quotation. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
QuotationId String By using the QuotationId parameter you can get a specific Quotation resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one quotation in the response.
Note : When the QuotationId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Quotation resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Quotation resource filtered by Quotation identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Exists",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}             
Request for a list of all Quotation resources present in the City of Melbourne.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Exists",
  "Data": {
    "City": "Melbourne"
  }
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}             

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation",
Operation = "Exists",
QuotationId = "8520fcf8-3abc-4006-8845-ec9f69c0d518"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}                 

Quotation/Permission

Permission operation contract allows you to know the access priviledges on the Quotation resource.
ErrorCode Description
70401 General Error occurred while checking the Quotation permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Quotation resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation resource contract, you need to Pass "Quotation" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation. Please check the allowed operations on this resource Quotation. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Quotation. Quotation resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Quotation resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Permission",
  "Type" : "All"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}             
Request to get the View access priviledges assigned to your API-key on the Quotation resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Permission",
  "Type" : "View"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}             

Example programs

Request to get all the available access priviledges assigned to your API-key on the Quotation resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Quotation resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}             

Quotation/Create

Create operation contract allows you to perform create operation on the Quotation resource.
ErrorCode Description
70701 Response error while creating Quotation
70702 Access Denied! You do not have the permission
70703 Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the Quotation resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation resource contract, you need to Pass "Quotation" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation. Please check the allowed operations on this resource Quotation. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Quotation resource for that particular Create operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test quotation 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
  ]
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a Quotation resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Create",
  "Data" : {
    "QuoteNumber": "Q00004",
    "QuoteDate": "2017-11-01",
    "Description": "Test Quotation 1",
    "Status": "Active",
    "SH": "223455.00",
    "Rate": "12",
    "AccountId": "D2D85241-F5EB-47FD-9B7A-3339C6B4C212",
    "ContactId": "96F4F1AE-FD54-4A95-9DB7-C934382B6B10"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "744eb0c6-47c3-41f6-8dbf-47376e1a6706",
    "Status": "Created"
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"QuoteNumber","Q00004"},
{"QuoteDate","2017-11-01"},
{"Description","Quote for trial version"},
{"Status","Active"},
{"SH","223455.00"},
{"Rate","12"},
{"AccountId","D2D85241-F5EB-47FD-9B7A-3339C6B4C212"},
{"ContactId","96F4F1AE-FD54-4A95-9DB7-C934382B6B10"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "744eb0c6-47c3-41f6-8dbf-47376e1a6706",
    "Status": "Created"
  }
}                 

Quotation/Edit

Edit operation contract allows you to perform edit operation on the Quotation resource.
ErrorCode Description
70601 General Error occurred while checking the Quotation permission
70602 Edit permission denied
70603 Quotation parameter is missing
70604 Error occurred while checking the Quotation is existing or not.
70605 Quotation is not existing.
70606 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Quotation resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation resource contract, you need to Pass "Quotation" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation. Please check the allowed operations on this resource Quotation. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
QuotationId String By using the QuotationId parameter you can update a specific Quotation resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one quotation in the response.
Note : When the QuotationId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Quotation resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test quotation 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
  ]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Quotation resource filtered by Quotation identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Edit",
  "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data" : {
    "Description": "Quotation for 10 days",
    "Rate": "12"
  }
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation",
Operation = "Edit",
QuotationId = "8520fcf8-3abc-4006-8845-ec9f69c0d518",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Description","Quotation for 10 days"},
{"Rate","12"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
}             

Quotation/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the Quotation resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/Quotation]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the Quotation resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation resource contract, you need to Pass "Quotation" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation. Please check the allowed operations on this resource Quotation. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
QuotationId String By using the QuotationId parameter you can update a specific Quotation resource by its identifier. Also, by not using the QuotationId parameter you can create a specific Quotation resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one quotation in the response.
Note : When the QuotationId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Quotation resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test quotation 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...] 
  ]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request for a single Quotation resource filtered by Quotation identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Create Or Edit",
  "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data" : {
    "Description": "Quotation for 10 days",
    "Rate": "12"
  }
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation",
Operation = "Create Or Edit",
QuotationId = "8520fcf8-3abc-4006-8845-ec9f69c0d518",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Description","Quotation for 10 days"},
{"Rate","12"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "Status": "Updated"
  }
}             

Quotation/Delete

Delete operation contract allows you to perform delete operation on the Quotation resource.
ErrorCode Description
70501 General Error occurred while checking the Quotation permission
70502 Delete permission denied
70503 Only occurs when attempted an Quotation delete by Id and the Quotation do not exists
70504 General Error occurred while deleting an Quotation
70505 Validation error, any of the three should be provided, 1. QuotationId, 2. Filter, 3. SQLFilter. Which is missing
70506 Error occurred while checking the Quotation is existing or not. (Only occurs when attempted an Quotation delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the Quotation resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation resource contract, you need to Pass "Quotation" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation. Please check the allowed operations on this resource Quotation. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
QuotationId String By using the QuotationId parameter you can delete a specific Quotation resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one quotation in the response.
Note : When the QuotationId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Quotation resource for the particular Delete operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Quotation resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all Quotation established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all Quotation who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Deleting the List of all Quotation who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request for a single Quotation resource filtered by Quotation identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation",
  "Operation": "Delete",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "QuoteNumber": "Q0004",
    "Status": "Deleted"
  }
}             

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation",
Operation = "Delete",
QuotationId = "8520fcf8-3abc-4006-8845-ec9f69c0d518"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "QuotationId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
    "QuoteNumber": "Q0004",
    "Status": "Deleted"
  }
}             

Quotation_Line

Quotation_Line is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line

Available operations

Permission,Get,Exists,Edit

List of standard fields

FieldDescription
DocItemId Stores a Universally Unique Identifier (UUID) to identify an item uniquely
DocId Gets the quotaionid as an UUID
ItemId Stores an UUID referenced from ProductItem
ItemIndex Stores the index of an item
ItemNumber Stores the number of an item
ItemName Stores the item name
UofM Stores the items unit of mass
Description Stores a multiline short description
ListPrice Stores the price of an item
Quantity Stores the quantity of an item
Discount Stores the discount rate of an item
DiscountPrice Stores the discount price
TaxPrice Stores the tax price of an item
Cost Stores the cost of an item
CreationDate Gets the Creation Date
LastEditDate Gets the Date of Last Modification

Operations

Quotation_Line/Get

Get operation contract allows you to perform read operation on the Quotation_Line resource.
ErrorCode Description
80201 General Error occurred while checking permission
80202 View permission denied
80203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Quotation_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation_Line resource contract, you need to Pass "Quotation_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation_Line. Please check the allowed operations on this resource Quotation_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Quotation_Line that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
QuotationId String By using the QuotationId parameter you can get a specific Quotation_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one quotationline in the response.
Note : When the QuotationId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Quotation_Line resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Quotation_Line resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Quotation_Line established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Quotation_Line who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Quotation_Line who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Quotation_Line resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Quotation_Line records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Quotation_Line records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Quotation_Line resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Quotation_Line record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Quotation_Line resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Quotation_Line resource filtered by Quotation_Line identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Get",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 1,
      "ItemNumber": "Rope",
      "ItemName": "12 inch long",
      "UofM": "ea",
      "Description": "long rope",
      "ListPrice": 13.2614,
      "Quantity": 5000.0,
      "Discount": 12.0,
      "DiscountPrice": 11.67,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 0.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.413",
      "CreationDate": "2017-11-01T11:35:41.413"
    },
    {
      "RowNumber": 2,
      "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 2,
      "ItemNumber": "Plastic",
      "ItemName": "Plastic Recycled",
      "UofM": "Tons",
      "Description": "Test Item",
      "ListPrice": 250.0,
      "Quantity": 50.0,
      "Discount": 0.0,
      "DiscountPrice": 250.0,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 123.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.43",
      "CreationDate": "2017-11-01T11:35:41.43"
    }
  ]
}							
Request for a list of all Quotation_Line resources present in the ItemNumber of Rope.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Get",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Filter": {
    "ItemNumber": "Rope"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 1,
      "ItemNumber": "Rope",
      "ItemName": "12 inch long",
      "UofM": "ea",
      "Description": "long rope",
      "ListPrice": 13.2614,
      "Quantity": 5000.0,
      "Discount": 12.0,
      "DiscountPrice": 11.67,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 0.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.413",
      "CreationDate": "2017-11-01T11:35:41.413"
    }
  ]
}						
Request for a list of all Quotation_Line resources, with just 4 columns, who are present in the ItemNumber of Rope.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Get",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
  "Filter": {
    "ItemNumber": "Rope"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemNumber": "Rope",
      "ListPrice": 13.2614
    }
  ]
}						
Request for the first page in the list of all Quotation_Line resources sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Get",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
  "Sort": {
    "Column": "ItemNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemNumber": "Rope",
        "ListPrice": 13.2614
      },
      {
        "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemNumber": "Plastic",
        "ListPrice": 250.0
      }
    ],
    "RecordInfo": {
      "RecordCount": 2,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 0
    }
  }
}						
Request for the first page in the list of all Quotation_Line resources present in the ItemNumber of Plastic or Rope in the ItemName Plastic Recycled. The list sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Get",
  "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "SQLFilter": "ItemNumber in ('Plastic','Rope') and ItemName = 'Plastic Recycled'",
  "Sort": {
    "Column": "ItemNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemNumber": "Plastic",
        "ListPrice": 250.0
      }
    ],
    "RecordInfo": {
      "RecordCount": 1,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 0
    }
  }
}					

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an quotationline.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation_Line",
Operation = "Get",
QuotationId : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"ItemNumber","Rope"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 1,
      "ItemNumber": "Rope",
      "ItemName": "12 inch long",
      "UofM": "ea",
      "Description": "long rope",
      "ListPrice": 13.2614,
      "Quantity": 5000.0,
      "Discount": 12.0,
      "DiscountPrice": 11.67,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 0.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.413",
      "CreationDate": "2017-11-01T11:35:41.413"
    }
  ]
}                 

Quotation_Line/Exists

Exists operation checks if the Quotation_Line resource exists or not.
ErrorCode Description
80301 General Error occurred while checking the QuotationLine

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the Quotation_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation_Line resource contract, you need to Pass "Quotation_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation_Line. Please check the allowed operations on this resource Quotation_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
QuotationId String By using the QuotationId parameter you can get a specific Quotation_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one quotationline in the response.
Note : When the QuotationId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the Quotation_Line resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single Quotation_Line resource filtered by Quotation_Line identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Exists",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							
Request for a list of all Quotation_Line resources present in the ItemNumber of Rope.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Exists",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data": {
    "ItemNumber": "Rope"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation_Line",
Operation = "Exists",
QuotationId = "8520fcf8-3abc-4006-8845-ec9f69c0d518"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

Quotation_Line/Permission

Permission operation contract allows you to know the access priviledges on the Quotation_Line resource.
ErrorCode Description
80401 General Error occurred while checking the QuotationLine permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Quotation_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation_Line resource contract, you need to Pass "Quotation_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation_Line. Please check the allowed operations on this resource Quotation_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource Quotation_Line. Quotation_Line resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Quotation_Line resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Permission",
  "Type" : "All"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							
Request to get the View access priviledges assigned to your API-key on the Quotation_Line resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}							

Example programs

Request to get all the available access priviledges assigned to your API-key on the Quotation_Line resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Quotation_Line resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation_Line",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							

Quotation_Line/Edit

Edit operation contract allows you to perform edit operation on the Quotation_Line resource. Here the data should be passed as an object array. The existing data will be truncated and the lines passed in the data will be inserted.If the ItemId is provided in the lines it will refer the ProductItem
ErrorCode Description
80801 General Error occurred while checking the QuotationLine permission
80802 QuotationLine edit permission denied
80803 QuotationLine parameter is missing
80804 Error occurred while checking the QuotationLine is existing or not.
80805 QuotationLine is not existing
80806 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the Quotation_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Quotation_Line resource contract, you need to Pass "Quotation_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Quotation_Line. Please check the allowed operations on this resource Quotation_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Quotation_Line. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
QuotationId String By using the QuotationId parameter you can update a specific Quotation_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one quotationline in the response.
Note : When the QuotationId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object Array This parameter is mandatory and allows you to insert the relevant and required information on the Quotation_Line resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test quotationline 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single Quotation_Line resource by Quotation_Line identifier QuotationId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Quotation_Line",
  "Operation": "Edit",
  "QuotationId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data" : [
    {
      "ItemIndex" : "1",
      "ItemNumber" : "Plastic",
      "ItemName" : "Cup"
    },
    {
      "ItemIndex" : "2",
      "ItemNumber" : "Rope",
      "ItemName" : "12 inch rope"
    }
  ]
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": null
}							

Example programs

Edit an Quotation_Line.
The sample C#.Net code is a simple RestClient that uses the API to edit an Quotation_Line.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example edit program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Quotation_Line",
Operation = "Edit",
QuotationId = ""8520fcf8-3abc-4006-8845-ec9f69c0d518,
Data = new System.Collections.Generic.Dictionary<string, object>()
[
{
{"ItemIndex" , "1"},
{"ItemNumber" , "Plastic"},
{"ItemName" , "Cup"}
},
{
{"ItemIndex" , "2"},
{"ItemNumber" , "Rope"},
{"ItemName" , "12 inch rope"}
}
]
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": null
}							  

SalesOrder

SalesOrder is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder

Available operations

Permission,Get,Exists,Create,Edit,Create Or Edit,Delete

List of standard fields

FieldDescription
OrderId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify a salesorder uniquely.
OrderNumber
GET | SET, Required, Type: String, Length: 64
Stores the Order Number. (Auto Generated)
OrderDate
GET | SET, Optional, Type: DateTime
Stores the Order Date
Description
GET | SET, Optional, Type: String, Length: 256
Stores a Short Description.
StatusId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of Status.
Status
GET | SET, Optional, Type: String, Length: 256
Stores the Status.
Account
SET, Required, Type: String, Length: 64
Stores the Account of the order.
AccountName
GET, ReadOnly, Type: String
Reffers the name of the order Account
AccountNumber
GET | SET, ReadOnly, Type: String
Reffers the AccountNumber of the order Account
AccountId
SET, Required, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the order Account
Contact
SET, Required, Type: String, Length: 97
Stores the Contact of the order
ContactId
SET, Required, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the order Contact.
FirstName
GET, ReadOnly, Type: String
Stores the FirstName of that Contact
MiddleName
GET, ReadOnly, Type: String
Stores the MiddleName of that Contact
LastName
GET, ReadOnly, Type: String
Stores the LastName of that Contact
Phone
GET, ReadOnly, Type: String
Stores the Phone number of that Contact
Fax
GET, ReadOnly, Type: String
Stores the Fax number of that Contact
Email
GET, ReadOnly, Type: String
Stores the Email of that Contact
Address
GET, Read Only, Type: String
Refers the address of the associated contact
Address1
GET | SET, Optional, Type: String, Length: 64
Stores the information about the Address Line 1
Address2
GET | SET, Optional, Type: String, Length: 64
Stores the information about the Address Line 2
City
GET | SET, Optional, Type: String, Length: 64
Stores the information about the City
State
GET | SET, Optional, Type: String, Length: 32
Stores the information about the State
ZipCode
GET, ReadOnly, Type: String
Gets the information about the Zip Code
Zip
GET | SET, Optional, Type: String, Length: 10
Sets the information about the Zip Code
Country
GET | SET, Optional, Type: String, Length: 2
Stores the information about the Country code
CountryName
GET, ReadOnly, Type: String
Stores the information about the Country name
Note
GET | SET, Optional, Type: String, Length: Max
Stores the information about the Country name
SaleRepId
GET | SET, Optional, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the Sales Representative.
SaleRep
GET, ReadOnly, Type: String
Stores the name of the Sales Representative.
SaleRegionId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the Sales Region
Region
GET, ReadOnly, Type: String
Stores the Sales Region.
LeadSource
GET, ReadOnly, Type: String
Stores the lead source type
LeadSourceId
GET | SET, Optional, Type: UUID
Stores the lead source reference UUID
LeadId
GET, ReadOnly, Type: UUID
Stores the lead reference UUID
CreationDate
GET, Read Only, Type: DataTime
Refers the Creation Date of the order
LastEditDate
GET, Read Only, Type: DataTime
Refers the Last Edit Date of the order
Term
GET, ReadOnly, Type: String
Stores the Payment Terms
TermId
GET | SET, Optional, Type: UUID
Stores a Universally Unique Identifier (UUID) to identify the reference of the Payment Term
DiscountRate
GET | SET, Optional, Type: Numeric
Stores the Discount Rate
TaxRate
GET | SET, Optional, Type: Numeric
Stores the Tax Rate
Tax
GET, ReadOnly, Type: Numeric
Refers the Tax calculated from TaxRate
TotalTaxes
GET | SET, Optional, Type: Numeric
Refers the Tax calculated from TaxRate
ShipmentAndHandling
GET | SET, Optional, Type: Numeric
Refers the Tax calculated from TaxRate
SH
GET, ReadOnly, Type: Numeric
Stores the Shipping and Handling amount
SubTotal
GET, ReadOnly, Type: Numeric
Stores the Sub total amount before tax
Total
GET, ReadOnly, Type: Numeric
Gets the Total amount after tax
TotalAmount
GET | SET, Optional, Type: Numeric
Sets the Total amount after tax
Cost
GET | SET, Optional, Type: Numeric
Stores the information of the cost
Commission
GET, ReadOnly, Type: Numeric
Gets the commission
TotalCommission
GET | SET, Optional, Type: Numeric
Sets the commission
UserType
GET, Read Only, Type: String
Gets the UserType associated with the owner
UserRegion
GET, Read Only, Type: String
Gets the UserRegion associated with the owner

Operations

SalesOrder/Get

Get operation contract allows you to perform read operation on the SalesOrder resource.
ErrorCode Description
110201 General Error occurred while checking permission
110202 View permission denied
110203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the SalesOrder resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder resource contract, you need to Pass "SalesOrder" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder. Please check the allowed operations on this resource SalesOrder. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract SalesOrder that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
OrderId String By using the OrderId parameter you can get a specific SalesOrder resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one salesorder in the response.
Note : When the OrderId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the SalesOrder resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the SalesOrder resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all SalesOrder established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all SalesOrder who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all SalesOrder who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the SalesOrder resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of SalesOrder records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched SalesOrder records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the SalesOrder resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the SalesOrder record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the SalesOrder resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single SalesOrder resource filtered by SalesOrder identifier OrderId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Get",
  "OrderId" : "196d5330-8a27-42c3-b804-052b29b28261"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "orderid": "196d5330-8a27-42c3-b804-052b29b28261",
    "OrderNumber": "S00001",
    "OrderDate": "2017-11-01T11:36:08.92",
    "Description": "",
    "statusid": "00000000-0000-0000-0000-000000000000",
    "Status": "New",
    "SaleRepId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
    "SaleRep": "Willy Wonka",
    "saleregionid": null,
    "Region": "",
    "Account": "Acme Corporation-USA",
    "AccountName": "Acme Corporation",
    "AccountNumber": "AC000006",
    "AccountId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
    "Contact": "Jey Trumph",
    "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
    "FirstName": "Jey",
    "MiddleName": "",
    "LastName": "Trumph",
    "Address": "123 6th St.  Melbourne FL 32904",
    "Address1": "123 6th St.",
    "Address2": "",
    "City": "Melbourne",
    "State": "FL",
    "ZipCode": "32904",
    "Zip": "32904",
    "Country": "US",
    "CountryName": "",
    "Term": "Net 30",
    "TermId": "d3261fa2-06ce-4444-b8ec-6af11f5d4508",
    "DiscountRate": 0.0,
    "TaxRate": 12.0,
    "Tax": 8502.0,
    "SH": 223455.0,
    "SubTotal": 70850.1641,
    "Total": 302807.1641,
    "Cost": 6150.0,
    "Commission": 0.0,
    "LeadSource": "Website",
    "leadsourceid": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
    "leadid": "00000000-0000-0000-0000-000000000000",
    "Note": "",
    "Phone": "5656231289",
    "Fax": "5656231289",
    "Email": "jeytrumph@company.com",
    "UserType": "",
    "UserRegion": "",
    "CreationDate": "2017-11-01T11:36:08.92",
    "LastEditDate": "2017-11-01T11:36:08.92"
  }
}							
Request for a list of all SalesOrder resources having OrderNumber as S00001.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Get",
  "Filter": {
    "OrderNumber": "S00001"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "RowNumber": 1,
        "orderid": "196d5330-8a27-42c3-b804-052b29b28261",
        "OrderNumber": "S00001",
        "OrderDate": "2017-11-01T11:36:08.92",
        "Description": "",
        "statusid": "00000000-0000-0000-0000-000000000000",
        "Status": "New",
        "SaleRepId": "dc3d0523-db19-4c45-8f81-9d535c36e52a",
        "SaleRep": "Willy Wonka",
        "saleregionid": null,
        "Region": "",
        "Account": "Acme Corporation-USA",
        "AccountName": "Acme Corporation",
        "AccountNumber": "AC000006",
        "AccountId": "805020cc-4718-440a-9189-6bea3f8bdbb0",
        "Contact": "Jey Trumph",
        "ContactId": "44e1071c-1597-4b2d-aef3-7ba5149ac067",
        "FirstName": "Jey",
        "MiddleName": "",
        "LastName": "Trumph",
        "Address": "123 6th St.  Melbourne FL 32904",
        "Address1": "123 6th St.",
        "Address2": "",
        "City": "Melbourne",
        "State": "FL",
        "ZipCode": "32904",
        "Zip": "32904",
        "Country": "US",
        "CountryName": "",
        "Term": "Net 30",
        "TermId": "d3261fa2-06ce-4444-b8ec-6af11f5d4508",
        "DiscountRate": 0.0,
        "TaxRate": 12.0,
        "Tax": 8502.0,
        "SH": 223455.0,
        "SubTotal": 70850.1641,
        "Total": 302807.1641,
        "Cost": 6150.0,
        "Commission": 0.0,
        "LeadSource": "Website",
        "leadsourceid": "62f4f09e-dbca-4ffb-a9a8-8fe8354c57b0",
        "leadid": "00000000-0000-0000-0000-000000000000",
        "Note": "",
        "Phone": "5656231289",
        "Fax": "5656231289",
        "Email": "jeytrumph@company.com",
        "UserType": "",
        "UserRegion": "",
        "CreationDate": "2017-11-01T11:36:08.92",
        "LastEditDate": "2017-11-01T11:36:08.92"
      }
    ]
  }
}						
Request for a list of all SalesOrder resources, with just 4 columns, who has the OrderNumber as S00001.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Get",
  "Columns": [ "OrderId","OrderNumber","Account","Contact" ],
  "Filter": {
    "OrderNumber": "S00001"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OrderId": "196d5330-8a27-42c3-b804-052b29b28261",
        "OrderNumber": "S00001",
        "Account": "Acme Corporation-USA",
        "Contact": "Jey Trumph"
      }
    ]
  }
}						
Request for the first page in the list of all SalesOrder resources sorted by OrderNumber in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Get",
  "Columns": [ "OrderId","OrderNumber","Account","Contact" ],
  "Sort": {
    "Column": "OrderNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OrderId": "9c9f2413-0d68-4d24-919b-a73fe913826e",
        "OrderNumber": "S00003",
        "Account": "Dynamo-USA",
        "Contact": "Sandy Hook"
      },
      {
        "OrderId": "32075ba1-edf3-49cd-8fad-fae9cc370be9",
        "OrderNumber": "S00002",
        "Account": "Astro-UK",
        "Contact": "Alicia Kim"
      },
      {
        "OrderId": "196d5330-8a27-42c3-b804-052b29b28261",
        "OrderNumber": "S00001",
        "Account": "Acme Corporation-USA",
        "Contact": "Jey Trumph"
      }
    ],
    "RecordInfo": {
      "RecordCount": 3,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}						
Request for the first page in the list of all SalesOrder resources having OrderNumber as S00002. The list sorted by OrderNumber in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Get",
  "Columns": [ "OrderId","OrderNumber","Account","Contact","Description" ],
  "SQLFilter": "OrderNumber = 'S00002'",
  "Sort": {
    "Column": "OrderNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OrderId": "32075ba1-edf3-49cd-8fad-fae9cc370be9",
        "OrderNumber": "S00002",
        "Account": "Astro-UK",
        "Contact": "Alicia Kim",
        "Description": "Quotation Valid for 30 days."
      }
    ],
    "RecordInfo": {
      "RecordCount": 1,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1
    }
  }
}						

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch a salesorder.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder",
Operation = "Get",
Columns = new string[] { "OrderId", "OrderNumber", "Account", "Contact", "Description" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"OrderNumber","S00002"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "OrderId": "32075ba1-edf3-49cd-8fad-fae9cc370be9",
        "OrderNumber": "S00002",
        "Account": "Astro-UK",
        "Contact": "Alicia Kim",
        "Description": "Quotation Valid for 30 days."
      }
    ]
  }
}                 

SalesOrder/Exists

Exists operation checks if the SalesOrder resource exists or not.
ErrorCode Description
110301 General Error occurred while checking the SalesOrder

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the SalesOrder resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder resource contract, you need to Pass "SalesOrder" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder. Please check the allowed operations on this resource SalesOrder. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OrderId String By using the OrderId parameter you can get a specific SalesOrder resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one salesorder in the response.
Note : When the OrderId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the SalesOrder resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single SalesOrder resource filtered by SalesOrder identifier OrderId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Exists",
  "OrderId" : "196d5330-8a27-42c3-b804-052b29b28261"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							
Request for a list of all SalesOrder resources having OrderNumber as S00001.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Exists",
  "Data": {
    "OrderNumber": "S00001"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder",
Operation = "Exists",
OrderId = "196d5330-8a27-42c3-b804-052b29b28261"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

SalesOrder/Permission

Permission operation contract allows you to know the access priviledges on the SalesOrder resource.
ErrorCode Description
110401 General Error occurred while checking the salesorder permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the SalesOrder resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder resource contract, you need to Pass "SalesOrder" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder. Please check the allowed operations on this resource SalesOrder. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource SalesOrder. SalesOrder resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the SalesOrder resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Permission",
  "Type" : "All"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							
Request to get the View access priviledges assigned to your API-key on the SalesOrder resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}							

Example programs

Request to get all the available access priviledges assigned to your API-key on the SalesOrder resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the SalesOrder resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "View": true,
      "Create": true,
      "Edit": true,
      "Delete": false,
      "EditShared": true,
      "DeleteShared": false
    }
  }							

SalesOrder/Create

Create operation contract allows you to perform create operation on the SalesOrder resource.
ErrorCode Description
110701 Response error while creating salesorder
110702 Access Denied! You do not have the permission
110703 General Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder/Create

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create operation on the SalesOrder resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder resource contract, you need to Pass "SalesOrder" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder. Please check the allowed operations on this resource SalesOrder. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder. In this case, for the Create contract, you need to pass "Create" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the SalesOrder resource for that particular Create operation. The Data object is defined as follows:
 "Data" :
{
  "<column_1>" : "<value_1>" 
   , "<column_2>" : "<value_2>" 
   , "<column_3>" : "<value_3>" 
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to create a SalesOrder resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Create",
  "Data" : {
     "OrderNumber" : "S00004",
     "Description" : "Test new sales order",
     "Account": "Acme Corporation-USA",
     "Contact": "Jey Trumph",
     "OrderDate" : "2017-11-2",
     "TotalAmount" : "0.00",
     "TaxRate" : "0.00",
     "TotalTaxes" : "0.00"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "Status": "Created"
  }
}							

Example programs

Create an SalesOrder
The sample C#.Net code is a simple RestClient that uses the API to create an SalesOrder.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder",
Operation = "Create",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"OrderNumber" , "S00004"},
{"Description" , "Test new sales order"},
{"Account" , "Acme Corporation-USA"},
{"Contact" , "Jey Trumph"},
{"OrderDate" , "2017-11-2"},
{"TotalAmount" , "0.00"},
{"TaxRate" , "0.00"},
{"TotalTaxes" , "0.00"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "Status": "Created"
  }
}								    

SalesOrder/Edit

Edit operation contract allows you to perform edit operation on the SalesOrder resource.
ErrorCode Description
110601 General Error occurred while checking the salesorder permission
110602 Edit permission denied
110603 SalesOrder parameter is missing
110604 Error occurred while checking the SalesOrder is existing or not.
110605 SalesOrder is not existing
110606 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the SalesOrder resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder resource contract, you need to Pass "SalesOrder" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder. Please check the allowed operations on this resource SalesOrder. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OrderId String By using the OrderId parameter you can update a specific SalesOrder resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one salesorder in the response.
Note : When the OrderId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the SalesOrder resource for that particular Edit operation. The Data object is defined as follows:
  "Data" :
{
  "<column_1>" : "<value_1>" 
   , "<column_2>" : "<value_2>" 
   , "<column_3>" : "<value_3>" 
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single SalesOrder resource by SalesOrder identifier OrderId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Edit",
  "Data" : {
     "Description" : "Test new sales order edited"
  },
  "OrderId" : "039ec8b5-80b9-4296-b040-ad3a28b7ecd9"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "Status": "Updated"
  }
}							

Example programs

Edit an SalesOrder.
The sample C#.Net code is a simple RestClient that uses the API to edit an SalesOrder.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example edit program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder",
Operation = "Edit",
"OrderId" = "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Description" , "Test new sales order edited"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "Status": "Updated"
  }
}	 						  

SalesOrder/Create Or Edit

Create Or Edit operation contract allows you to perform Create Or Update operation on the SalesOrder resource.

API Url

Dedicated URL Not Applicable, use [http://liveapi.claritysoftcrm.com/api/v1] or [http://liveapi.claritysoftcrm.com/api/v1/SalesOrder]

Allowed by request methods

Post,Put

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Create Or Edit operation on the SalesOrder resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder resource contract, you need to Pass "SalesOrder" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder. Please check the allowed operations on this resource SalesOrder. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder. In this case, for the Create Or Edit contract, you need to pass "Create Or Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OrderId String By using the OrderId parameter you can update a specific SalesOrder resource by its identifier. Also, by not using the OrderId parameter you can update a specific SalesOrder resource by its identifier. This parameter is provided as a UUID.
Note : When the OrderId parameter is defined, then the api will edit else if its not provided it will create a new SalesOrder resource.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the SalesOrder resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "<column_1>" : "<value_1>" 
   , "<column_2>" : "<value_2>" 
   , "<column_3>" : "<value_3>" 
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single SalesOrder resource by SalesOrder identifier, OrderId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Create Or Edit",
  "Data" : {
     "Description" : "Test new sales order edited"
  },
  "OrderId" : "039ec8b5-80b9-4296-b040-ad3a28b7ecd9"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "Status": "Updated"
  }
}								

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to Create Or Edit a SalesOrder.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create Or Update request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder",
Operation = "Create Or Edit",
"OrderId" = "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Description" , "Test new sales order edited"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "Status": "Updated"
  }
} 							    

SalesOrder/Delete

Delete operation contract allows you to perform delete operation on the SalesOrder resource.
ErrorCode Description
110501 General Error occurred while checking the SalesOrder permission
110502 Delete permission denied
110503 Only occurs when attempted an SalesOrder delete by Id and the SalesOrder do not exists
110504 General Error occurred while deleting an SalesOrder
110505 Validation error, any of the three should be provided, 1.SalesOrderId, 2. Filter, 3. SQLFilter. Which is missing
110506 Error occurred while checking the SalesOrder is existing or not. (Only occurs when attempted an SalesOrder delete by Id)

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder/Delete

Allowed by request methods

Delete,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Delete operation on the SalesOrder resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder resource contract, you need to Pass "SalesOrder" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder. Please check the allowed operations on this resource SalesOrder. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder. In this case, for the Delete contract, you need to pass "Delete" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OrderId String By using the OrderId parameter you can delete a specific SalesOrder resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one salesorder in the response.
Note : When the OrderId parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the SalesOrder resource for the particular Delete operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records deleted must have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records deleted must meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the SalesOrder resource for the particular Delete operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Deleting the List of all SalesOrder established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Deleting the List of all SalesOrder who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Deleting the List of all SalesOrder who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.

Example of requests

Request to delete an SalesOrder resource by @{Column.SalesOrder.Id}.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Delete",
  "OrderId" : "039ec8b5-80b9-4296-b040-ad3a28b7ecd9"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "OrderNumber": "S00004",
    "Status": "Deleted"
  }
}							
Request to delete one or many SalesOrder resource by filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Delete",
  "Filter" : {
    "OrderNumber": "S00004"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
      "OrderNumber": "S00004",
      "Status": "Deleted"
    }
  ]
}						
Request to delete one or many SalesOrder resource by SQL filter.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder",
  "Operation": "Delete",
  "SQLFilter" : "OrderNumber = 'S00004'"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
      "OrderNumber": "S00004",
      "Status": "Deleted"
    }
  ]
}								

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete program using id.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder",
Operation = "Delete",
OrderId = "039ec8b5-80b9-4296-b040-ad3a28b7ecd9"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "OrderId": "039ec8b5-80b9-4296-b040-ad3a28b7ecd9",
    "OrderNumber": "S00004",
    "Status": "Deleted"
  }
}								    

SalesOrder_Line

SalesOrder_Line is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line

Available operations

Permission,Get,Exists,Edit

List of standard fields

FieldDescription
DocItemId Stores a Universally Unique Identifier (UUID) to identify an item uniquely
DocId Gets the quotaionid as an UUID
ItemId Stores an UUID referenced from ProductItem
ItemIndex Stores the index of an item
ItemNumber Stores the number of an item
ItemName Stores the item name
UofM Stores the items unit of mass
Description Stores a multiline short description
ListPrice Stores the price of an item
Quantity Stores the quantity of an item
Discount Stores the discount rate of an item
DiscountPrice Stores the discount price
TaxPrice Stores the tax price of an item
Cost Stores the cost of an item
CreationDate Gets the Creation Date
LastEditDate Gets the Date of Last Modification

Operations

SalesOrder_Line/Get

Get operation contract allows you to perform read operation on the SalesOrder_Line resource.
ErrorCode Description
120201 General Error occurred while checking permission
120202 View permission denied
120203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the SalesOrder_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder_Line resource contract, you need to Pass "SalesOrder_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder_Line. Please check the allowed operations on this resource SalesOrder_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract SalesOrder_Line that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
OrderId String By using the OrderId parameter you can get a specific SalesOrder_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one salesorderline in the response.
Note : When the OrderId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the SalesOrder_Line resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the SalesOrder_Line resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all SalesOrder_Line established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all SalesOrder_Line who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all SalesOrder_Line who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the SalesOrder_Line resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of SalesOrder_Line records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched SalesOrder_Line records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the SalesOrder_Line resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the SalesOrder_Line record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the SalesOrder_Line resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single SalesOrder_Line resource filtered by SalesOrder_Line identifier OrderId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Get",
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 1,
      "ItemNumber": "Rope",
      "ItemName": "12 inch long",
      "UofM": "ea",
      "Description": "long rope",
      "ListPrice": 13.2614,
      "Quantity": 5000.0,
      "Discount": 12.0,
      "DiscountPrice": 11.67,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 0.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.413",
      "CreationDate": "2017-11-01T11:35:41.413"
    },
    {
      "RowNumber": 2,
      "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 2,
      "ItemNumber": "Plastic",
      "ItemName": "Plastic Recycled",
      "UofM": "Tons",
      "Description": "Test Item",
      "ListPrice": 250.0,
      "Quantity": 50.0,
      "Discount": 0.0,
      "DiscountPrice": 250.0,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 123.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.43",
      "CreationDate": "2017-11-01T11:35:41.43"
    }
  ]
}							
Request for a list of all SalesOrder_Line resources present in the ItemNumber of Rope.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Get",
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Filter": {
    "ItemNumber": "Rope"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 1,
      "ItemNumber": "Rope",
      "ItemName": "12 inch long",
      "UofM": "ea",
      "Description": "long rope",
      "ListPrice": 13.2614,
      "Quantity": 5000.0,
      "Discount": 12.0,
      "DiscountPrice": 11.67,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 0.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.413",
      "CreationDate": "2017-11-01T11:35:41.413"
    }
  ]
}						
Request for a list of all SalesOrder_Line resources, with just 4 columns, who are present in the ItemNumber of Rope.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Get",
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
  "Filter": {
    "ItemNumber": "Rope"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemNumber": "Rope",
      "ListPrice": 13.2614
    }
  ]
}						
Request for the first page in the list of all SalesOrder_Line resources sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Get",
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
  "Sort": {
    "Column": "ItemNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemNumber": "Rope",
        "ListPrice": 13.2614
      },
      {
        "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemNumber": "Plastic",
        "ListPrice": 250.0
      }
    ],
    "RecordInfo": {
      "RecordCount": 2,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 0
    }
  }
}						
Request for the first page in the list of all SalesOrder_Line resources present in the ItemNumber of Plastic or Rope in the ItemName Plastic Recycled. The list sorted by ItemNumber in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Get",
  "Columns": [ "DocItemId","DocId","ItemNumber","ListPrice" ],
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "SQLFilter": "ItemNumber in ('Plastic','Rope') and ItemName = 'Plastic Recycled'",
  "Sort": {
    "Column": "ItemNumber",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "DocItemId": "2d810d57-72d4-4a80-ac2c-2f50731907e8",
        "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
        "ItemNumber": "Plastic",
        "ListPrice": 250.0
      }
    ],
    "RecordInfo": {
      "RecordCount": 1,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 0
    }
  }
}					

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an salesorderline.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder_Line",
Operation = "Get",
OrderId : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"ItemNumber","Rope"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "DocItemId": "1991a360-4324-4cbc-acff-76693cbfc5ec",
      "DocId": "8520fcf8-3abc-4006-8845-ec9f69c0d518",
      "ItemId": null,
      "ItemIndex": 1,
      "ItemNumber": "Rope",
      "ItemName": "12 inch long",
      "UofM": "ea",
      "Description": "long rope",
      "ListPrice": 13.2614,
      "Quantity": 5000.0,
      "Discount": 12.0,
      "DiscountPrice": 11.67,
      "IsTaxExempt": false,
      "TaxPrice": 0.0,
      "CommissionRate": 0.0,
      "Cost": 0.0,
      "RawQty": 0.0,
      "UnitQty": 0.0,
      "UnitQtyModeID": 0,
      "LastEditDate": "2017-11-01T11:35:41.413",
      "CreationDate": "2017-11-01T11:35:41.413"
    }
  ]
}                 

SalesOrder_Line/Exists

ErrorCode Description
120301 General Error occurred while checking the SalesOrderLine permission
Exists operation checks if the SalesOrder_Line resource exists or not.

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line/Exists

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Exists operation on the SalesOrder_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder_Line resource contract, you need to Pass "SalesOrder_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder_Line. Please check the allowed operations on this resource SalesOrder_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line. In this case, for the Exists contract, you need to pass "Exists" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OrderId String By using the OrderId parameter you can get a specific SalesOrder_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one salesorderline in the response.
Note : When the OrderId parameter is defined, the Data, parameter will be strictly ignored.
Data Structured Object This parameter optionally allows you to apply a simple filter on the SalesOrder_Line resource for the particular Exists operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.

Example of requests

Request for a single SalesOrder_Line resource filtered by SalesOrder_Line identifier OrderId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Exists",
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							
Request for a list of all SalesOrder_Line resources present in the ItemNumber of Rope.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Exists",
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data": {
    "ItemNumber": "Rope"
  }
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}							

Example programs

Request with id
The sample C#.Net code is a simple RestClient that uses the API to check if the resource exists.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Exists request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder_Line",
Operation = "Exists",
OrderId = "8520fcf8-3abc-4006-8845-ec9f69c0d518"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Exists": true
  }
}								    

SalesOrder_Line/Permission

Permission operation contract allows you to know the access priviledges on the SalesOrder_Line resource.
ErrorCode Description
120401 General Error occurred while checking the SalesOrderLine permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the SalesOrder_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder_Line resource contract, you need to Pass "SalesOrder_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder_Line. Please check the allowed operations on this resource SalesOrder_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Type String This parameter defines the type of access profiles that is to be performed on the resource SalesOrder_Line. SalesOrder_Line resource access priviledge for the particular Permission operation. The Type categories are defined as follows: All, View, Create, Edit, Delete, EditShared, DeleteShared.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the SalesOrder_Line resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Permission",
  "Type" : "All"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							
Request to get the View access priviledges assigned to your API-key on the SalesOrder_Line resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Permission",
  "Type" : "View"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true
  }
}							

Example programs

Request to get all the available access priviledges assigned to your API-key on the SalesOrder_Line resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the SalesOrder_Line resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder_Line",
Operation = "Permission",
Type = "All"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "View": true,
    "Create": true,
    "Edit": true,
    "Delete": false,
    "EditShared": true,
    "DeleteShared": false
  }
}							

SalesOrder_Line/Edit

Edit operation contract allows you to perform edit operation on the SalesOrder_Line resource. Here the data should be passed as an object array. The existing data will be truncated and the lines passed in the data will be inserted.If the ItemId is provided in the lines it will refer the ProductItem
ErrorCode Description
120801 General Error occurred while checking the SalesOrderLine permission
120802 SalesOrderLine edit permission denied
120803 SalesOrderLine parameter is missing
120804 Error occurred while checking the SalesOrderLine is existing or not.
120805 SalesOrderLine is not existing
120806 General Error occurred while editing the record

API Url

http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line/Edit

Allowed by request methods

Post,Patch

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Edit operation on the SalesOrder_Line resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the SalesOrder_Line resource contract, you need to Pass "SalesOrder_Line" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource SalesOrder_Line. Please check the allowed operations on this resource SalesOrder_Line. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/SalesOrder_Line. In this case, for the Edit contract, you need to pass "Edit" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
OrderId String By using the OrderId parameter you can update a specific SalesOrder_Line resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can update or edit at most one salesorderline in the response.
Note : When the OrderId parameter is defined, the Data parameter will follow the required changes accordingly.
Data Structured Object Array This parameter is mandatory and allows you to insert the relevant and required information on the SalesOrder_Line resource for that particular Edit operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test salesorderline 123" 
   , "Address1" : "Test address"
   , "City" : "Dublin"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that particular record to update accordingly fulfilling all criteria.

Example of requests

Request to edit a single SalesOrder_Line resource by SalesOrder_Line identifier OrderId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "SalesOrder_Line",
  "Operation": "Edit",
  "OrderId" : "8520fcf8-3abc-4006-8845-ec9f69c0d518",
  "Data" : [
    {
      "ItemIndex" : "1",
      "ItemNumber" : "Plastic",
      "ItemName" : "Cup"
    },
    {
      "ItemIndex" : "2",
      "ItemNumber" : "Rope",
      "ItemName" : "12 inch rope"
    }
  ]
}             
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": null
}							

Example programs

Edit an SalesOrder_Line.
The sample C#.Net code is a simple RestClient that uses the API to edit an SalesOrder_Line.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example edit program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "SalesOrder_Line",
Operation = "Edit",
OrderId = ""8520fcf8-3abc-4006-8845-ec9f69c0d518,
Data = new System.Collections.Generic.Dictionary<string, object>()
[
{
{"ItemIndex" , "1"},
{"ItemNumber" , "Plastic"},
{"ItemName" , "Cup"}
},
{
{"ItemIndex" , "2"},
{"ItemNumber" , "Rope"},
{"ItemName" , "12 inch rope"}
}
]
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": null
}							  

Settings_User

Settings_User is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_User

Available operations

Get

List of standard fields

FieldDescription
UserId
GET, ReadOnly, Type: UUID
Stores a Universally Unique Identifier(UUID) to identify an user uniquely.
UserName
GET, Required, Type: String, Length: 64
Stores the User Name
FirstName
GET, Optional, Type: String, Length: 32
Stores the First Name of the User
LastName
GET, Optional, Type: String, Length: 64
Stores the Last Name of the User
Email
GET, Optional, Type: String, Length: 128
Stores the Email of the User
ReportToId
GET, Optional, Type: UUID
Stores the Report To reference UUID.
ReportTo
GET, Optional, Type: String, Length: 256
Stores the Report To Full Name
IsInactive
GET, Required, Type: Boolean
Checks if the user marked as active or inactive.
IsAdmin
GET, Optional, Type: Boolean
Checks if the user marked as admin or not.
UserType
GET, ReadOnly, Type: String
Gets the UserType associated with the user.
Region
GET, Read Only, Type: String
Gets the User Region associated with the user.

Operations

Settings_User/Get

Get operation contract allows you to perform read operation on the Settings_User resource.
ErrorCode Description
30203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_User/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Settings_User resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Settings_User resource contract, you need to Pass "Settings_User" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Settings_User. Please check the allowed operations on this resource Settings_User. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Settings_User. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Columns String Array This parameter defines the array of columns provided in the resource contract Settings_User that you want to return from the Get operation. You can use standard fields as well as custom fields here. If the parameter is not specified all columns will be returned.
UserId String By using the UserId parameter you can get a specific Settings_User resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you get at most one user in the response.
Note : When the UserId parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Settings_User resource for the particular Get operation. The filer object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Settings_User resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Settings_User established in the cities Memphis or Columbus of the country US.
    [City] in ('Memphis','Columbus') and [Country] = 'US'
  • Example 2 :
    Getting the List of all Settings_User who has a website.
    ISNULL([Website],'') <> ''
  • Example 3 :
    Getting the List of all Settings_User who has a website or established in the country US.
    (ISNULL([Website],'') <> '') OR ([Country] = 'US')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Settings_User resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Settings_User records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Settings_User records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Settings_User resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Settings_User record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Settings_User resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Settings_User resource filtered by Settings_User identifier UserId.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_User",
  "Operation": "Get",
  "UserId" : "00000000-0000-0000-0000-0000000000ad"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "UserId": "00000000-0000-0000-0000-0000000000ad",
    "UserName": "admin",
    "FirstName": "Administrator",
    "LastName": " ",
    "Email": null,
    "ReportToId": null,
    "ReportTo": null,
    "IsInactive": false,
    "IsAdmin": true,
    "UserType": null,
    "Region": null
  }
}							
Request for a list of all Settings_User resources present with the UserName as admin.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_User",
  "Operation": "Get",
  "Filter": {
  "UserName": "admin"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    "Data": [
    {
      "RowNumber": 1,
      "UserId": "00000000-0000-0000-0000-0000000000ad",
      "UserName": "admin",
      "FirstName": "Administrator",
      "LastName": " ",
      "Email": null,
      "ReportToId": null,
      "ReportTo": null,
      "IsInactive": false,
      "IsAdmin": true,
      "UserType": null,
      "Region": null
    }
  ]
}						
Request for a list of all Settings_User resources, with just 4 columns, with UserName as admin.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Account",
  "Operation": "Get",
  "Columns": [ "UserName","FirstName","IsInactive","IsAdmin" ],
  "Filter": {
    "UserName": "admin"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "UserName": "admin",
      "FirstName": "Administrator",
      "IsInactive": false,
      "IsAdmin": true
    }
  ]
}						
Request for the first page in the list of all Settings_User resources sorted by SetupUsers in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_User",
  "Operation": "Get",
  "Columns": [ "UserName","FirstName","IsInactive","IsAdmin" ],
  "Sort": {
    "Column": "UserName",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "UserName": "willy",
        "FirstName": "Willy",
        "IsInactive": false,
        "IsAdmin": false
      },
      {
        "UserName": "admin",
        "FirstName": "Administrator",
        "IsInactive": false,
        "IsAdmin": true
      }
    ],
    "RecordInfo": {
      "RecordCount": 2,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						
Request for the first page in the list of all Settings_User resources with UserName as Admin or IsInactive as false. The list sorted by Account in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_User",
  "Operation": "Get",
  "SQLFilter": "UserName in ('admin','willy') and IsAdmin = 'true'",
  "Sort": {
    "Column": "UserName",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "UserName": "admin",
        "IsInactive": false,
        "IsAdmin": true
      }
    ],
    "RecordInfo": {
      "RecordCount": 1,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 1.0
    }
  }
}						

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an SetupUsers.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Settings_User",
Operation = "Get",
Columns = new string[] { "UserId", "UserName", "FirstName", "LastName" },
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"UserName","Admin"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "UserId": "00000000-0000-0000-0000-0000000000ad",
      "UserName": "admin",
      "FirstName": "Administrator",
      "LastName": " "
    }
  ]
}                 

Settings_FieldInfo

Settings_FieldInfo is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_FieldInfo

Available operations

Get

List of standard fields

FieldDescription
FieldName
GET, Type: String
Stores the field name of a particular module.
FieldType
GET, Type: String
Stores the field type of the field name.
DatabaseProperties
GET, Type: Structured Object
Stores the database properties of a field name.
DatabaseProperties.DataType
GET, Type: String
Stores the datatype.
DatabaseProperties.MaxSize
GET, Type: String
Stores the length of the database property.
DatabaseProperties.IsReadOnly
GET, Type: Boolean
Stores if the database property is readonly or not.
DatabaseProperties.IsViewable
GET, Type: Boolean
Stores if the database property is viewable or not.
CustomFieldProperties
GET, Optional, Type: Structured Object
Stores the custom field properties.
CustomFieldProperties.FieldId
GET, Type: UUID
Stores the field reference as an UUID.
CustomFieldProperties.DataType
GET, Type: String
Stores the custom field datatype.
CustomFieldProperties.DataFormat
GET, Type: String
Stores the custom field dataformat.

Operations

Settings_FieldInfo/Get

Get operation contract allows you to perform read operation on the Settings_FieldInfo resource.
ErrorCode Description
190902 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_FieldInfo/Get

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Get operation on the Settings_FieldInfo resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Settings_FieldInfo resource contract, you need to Pass "Settings_FieldInfo" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Settings_FieldInfo. Please check the allowed operations on this resource Settings_FieldInfo. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Settings_FieldInfo. In this case, for the Get contract, you need to pass "Get" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
FieldName String By using the FieldName parameter you can get a specific Settings_FieldInfo resource by its identifier. This parameter is provided as a String. Defining this parameter ensures that you get at most one field info in the response.
Note : When the FieldName parameter is defined, the Filter,Page and SQLFilter parameters will be strictly ignored.
Filter Structured Object This parameter optionally allows you to apply a simple filter on the Settings_FieldInfo resource for the particular Get operation. The filter object is defined as follows:
{
  "<column_name_1>" : "<preffered_value_1>" 
  [ , "<column_name_2>" : "<preffered_value_2>"  
    [ , ...] 
  ]
}
Where, <column_name_1> can be defined from any standard fields or custom fields. And, <preffered_value_1> is the value of the corrosponding column that will be appled to the filter. All the specified filter criteria are evaluated such that the records returned will have an exact match. Moreover, if multiple filter criteria is specified it will be evaluated such that the records returned will meet all criteria.
Note : To use, partial match or meet any criteria, you are requested to use SQLFilter parameter instead of the Filter parameter.
This parameter can be used in combination with SQLFilter parameter to build up complicated filter clauses.
SQLFilter String This parameter optionally allows you to apply a SQL filter on the Settings_FieldInfo resource for the particular Get operation. Both, standard fields and custom fields can be used in the where clause. The clause should be expressed following Microsoft SQL Server standard Where clauses expressions. A few simple examples are provided below :

  • Example 1 :
    Getting the List of all Settings_FieldInfo established with FieldName Account or AccountCoreName.
    [FieldName] in ('Account','AccountCoreName').
  • Example 2 :
    Getting the List of all Settings_FieldInfo who has a FieldName as Account.
    ISNULL([Account],'') <> ''
  • Example 3 :
    Getting the List of all Settings_FieldInfo who has a FieldType or DatabaseProperties_DataType as nvarchar.
    (ISNULL([FieldType],'') <> '') OR ([DatabaseProperties_DataType] = 'nvarchar')
Standard SQL functions like ISNULL , DATEPART , etc can be used in SQL filter. Moreover, a list of Claritysoft Standard Database Functions are provided to support the SQL filter while Get operation for the ease of development. To know more about these functions click on the link.
Page Structured Object This parameter optionally allows you to apply a page segment on the Settings_FieldInfo resource for the particular Get operation. The page object is defined as follows:
{
  PageNumber : "<page_number>",
  PageSize : "<page_number>"
}
Where, <page_number> defines the particular page which we want to see when segmented by <page_size> records per page. And, <page_size> defines the number of Settings_FieldInfo records to be listed per page.

Appling this parameter will provide two attributes Records and RecordInfo in the response data Response.Data. Where, Records consists of the fetched Settings_FieldInfo records. And, RecordInfo contains page segmentation details like, RecordCount, PageCount etc.
Sort Structured Object This parameter optionally allows you to sort the records of the Settings_FieldInfo resource for the particular Get operation on the specified column in a specific order. The sort object is defined as follows:
{
  Column : "<column>"
  [,Order : "Asc"(Default)|"Desc" ]
}
Where, <column> defines the particular column on which the Settings_FieldInfo record list is to be sorted. The column can be defined from the list of standard fields or custom fields. And, Order attribute can be optionally defined to specify the sort order on the defined column. It accepts only two values, Asc for ascending order and Desc for descending order. If the order not provided it takes the default value as Asc.
Note : When Sort parameter is used in combination with Filter, SQL Filter and Page. At first, Filter and SQL Filter is evaluated on the Settings_FieldInfo resource list, then the list is sorted and finally the list is segmented in pages.

Example of requests

Request for a single Settings_FieldInfo resource filtered by Settings_FieldInfo identifier FieldName.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_FieldInfo",
  "Operation": "Get",
  "Module": "Account",
  "FieldName" : "Account"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "RowNumber": 1,
    "FieldName": "Account",
    "FieldType": "Standard",
    "DatabaseProperties": {
      "DataType": "nvarchar",
      "MaxSize": "64",
      "IsReadOnly": true,
      "IsViewable": true
    }
  }
}							
Request for a list of all Settings_FieldInfo resources present in the DatabaseProperties.DataType of datetime.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_FieldInfo",
  "Operation": "Get",
  "Module": "Account",
  "Filter" : {
      "DatabaseProperties.DataType" : "datetime"
   }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    {
      "RowNumber": 1,
      "FieldName": "CreationDate",
      "FieldType": "Standard",
      "DatabaseProperties": {
        "DataType": "datetime",
        "IsReadOnly": true,
        "IsViewable": true
      }
    },
    {
      "RowNumber": 2,
      "FieldName": "Last Touch Date",
      "FieldType": "Standard",
      "DatabaseProperties": {
        "DataType": "datetime",
        "IsReadOnly": true,
        "IsViewable": true
      }
    },
    {
      "RowNumber": 3,
      "FieldName": "LastEditDate",
      "FieldType": "Standard",
      "DatabaseProperties": {
        "DataType": "datetime",
        "IsReadOnly": true,
        "IsViewable": true
      }
    }
  ]
}						
Request for the first page in the list of all Settings_FieldInfo resources sorted in desending order. Where, each page consists of 20 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_FieldInfo",
  "Operation": "Get",
  "Module": "Account",
   "Sort": {
    "Column": "FieldName",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "20"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "RowNumber": 1,
        "FieldName": "ZipCode",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "10",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 2,
        "FieldName": "Website",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "255",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 3,
        "FieldName": "UserType",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "256",
          "IsReadOnly": true,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 4,
        "FieldName": "UserRegion",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "256",
          "IsReadOnly": true,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 5,
        "FieldName": "Type A2",
        "FieldType": "Custom",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "4000",
          "IsReadOnly": false,
          "IsViewable": true
        },
        "CustomFieldProperties": {
          "DataType": "Type2"
        }
      },
      {
        "RowNumber": 6,
        "FieldName": "Type A1",
        "FieldType": "Custom",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "4000",
          "IsReadOnly": false,
          "IsViewable": true
        },
        "CustomFieldProperties": {
          "DataType": "Type1"
        }
      },
      {
        "RowNumber": 7,
        "FieldName": "State",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "32",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 8,
        "FieldName": "Site",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "16",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 9,
        "FieldName": "ShippingZipCode",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "10",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 10,
        "FieldName": "ShippingState",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "32",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 11,
        "FieldName": "ShippingCountryName",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "64",
          "IsReadOnly": true,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 12,
        "FieldName": "ShippingCountry",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "2",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 13,
        "FieldName": "ShippingCity",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "64",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 14,
        "FieldName": "ShippingAddress2",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "64",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 15,
        "FieldName": "ShippingAddress1",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "64",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 16,
        "FieldName": "OwnerId",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "uniqueidentifier",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 17,
        "FieldName": "Owner",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "97",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 18,
        "FieldName": "Name",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "64",
          "IsReadOnly": false,
          "IsViewable": false
        }
      },
      {
        "RowNumber": 19,
        "FieldName": "leadsources",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "256",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 20,
        "FieldName": "leadsourceid",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "uniqueidentifier",
          "IsReadOnly": false,
          "IsViewable": true
        }
      }
    ],
    "RecordInfo": {
      "RecordCount": 37,
      "PageNumber": 1,
      "PageSize": 20,
      "PageCount": 2.0
    }
  }
}						
Request for the first page in the list of all Settings_FieldInfo resources present in the DatabaseProperties.DataType of nvarchar or datetime and FieldType Standard. The list sorted by FieldName in desending order. Where, each page consists of 10 records.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_FieldInfo",
  "Operation": "Get",
  "SQLFilter": "[DatabaseProperties.DataType] in ('nvarchar','datetime') and FieldType = 'Standard'",
  "Module": "Account",
   "Sort": {
    "Column": "FieldName",
    "Order": "Desc"
  },
  "Page": {
    "PageNumber": "1",
    "PageSize": "10"
  }
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Records": [
      {
        "RowNumber": 1,
        "FieldName": "ZipCode",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "10",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 2,
        "FieldName": "Website",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "255",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 3,
        "FieldName": "UserType",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "256",
          "IsReadOnly": true,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 4,
        "FieldName": "UserRegion",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "256",
          "IsReadOnly": true,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 5,
        "FieldName": "State",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "32",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 6,
        "FieldName": "Site",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "16",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 7,
        "FieldName": "ShippingZipCode",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "10",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 8,
        "FieldName": "ShippingState",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "32",
          "IsReadOnly": false,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 9,
        "FieldName": "ShippingCountryName",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "64",
          "IsReadOnly": true,
          "IsViewable": true
        }
      },
      {
        "RowNumber": 10,
        "FieldName": "ShippingCountry",
        "FieldType": "Standard",
        "DatabaseProperties": {
          "DataType": "nvarchar",
          "MaxSize": "2",
          "IsReadOnly": false,
          "IsViewable": true
        }
      }
    ],
    "RecordInfo": {
      "RecordCount": 29,
      "PageNumber": 1,
      "PageSize": 10,
      "PageCount": 3.0
    }
  }
}						

Example programs

Request with filter.
The sample C#.Net code is a simple RestClient that uses the API to fetch an field info.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Settings_FieldInfo",
Operation = "Get",
Module: "Account",
Filter = new System.Collections.Generic.Dictionary<string, object>()
{
{"FieldName","Account"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": [
    "RowNumber": 1,
    "FieldName": "Account",
    "FieldType": "Standard",
    "DatabaseProperties": {
      "DataType": "nvarchar",
      "MaxSize": "64",
      "IsReadOnly": true,
      "IsViewable": true
    }
  ]
}                 

Settings_WebHook

Settings_WebHook is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_WebHook

Available operations

Permission,Subscribe,UnSubscribe

List of standard fields

FieldDescription
Name
SET, Required, Type: String, Length: 32
Stores the Name of the webhook.
TriggerWhenCreated
SET, Required, Type: Boolean
Checks if the webhook will trigger when created or not.
TriggerWhenDeleted
SET, Required, Type: Boolean
Checks if the webhook will trigger when deleted or not.
IsPrivate
SET, Optional, Type: Boolean
Checks if the webhook marked as private or not.
Name
SET, Required, Type: String, Length: 32
Stores the Name of the webhook.
Url
SET, Required, Type: String, Length: 128
Stores the Url of the webhook.

Operations

Settings_WebHook/Permission

Permission operation contract allows you to know the access priviledges on the Settings_WebHook resource.
ErrorCode Description
200101 General Error occurred while checking the webhook permission

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_WebHook/Permission

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Permission operation on the Settings_WebHook resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Settings_WebHook resource contract, you need to Pass "Settings_WebHook" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Settings_WebHook. Please check the allowed operations on this resource Settings_WebHook. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Settings_WebHook. In this case, for the Permission contract, you need to pass "Permission" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.

Example of requests

Request to get all the available access priviledges assigned to your API-key on the Settings_WebHook resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_WebHook",
  "Operation": "Permission"
}
							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "Eligible": false
  }
}							

Example programs

Request to get all the available access priviledges assigned to your API-key on the Settings_WebHook resource.
The sample C#.Net code is a simple RestClient that uses the API to see the access priviledges.
Source :
/************************************************************
* (1) Description :-
* ===================
* Request to get all the available access priviledges assigned to your API-key on the Settings_WebHook resource.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Settings_WebHook",
Operation = "Permission"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
  {
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "Eligible": false
    }
  }							

Settings_WebHook/Subscribe

Subscribe operation contract allows you to perform create operation on the Settings_WebHook resource.
ErrorCode Description
10101 Response error while creating webhook
10102 Access Denied! You do not have the permission
10103 General Response error

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_WebHook/Subscribe

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Subscribe operation on the Settings_WebHook resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Settings_WebHook resource contract, you need to Pass "Settings_WebHook" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Module String This parameter defines the type of module that is to be performed on the resource Settings_WebHook.
Operation String This parameter defines the type of operation that is to be performed on the resource Settings_WebHook. Please check the allowed operations on this resource Settings_WebHook. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Settings_WebHook. In this case, for the Subscribe contract, you need to pass "Subscribe" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Data Structured Object This parameter is mandatory and allows you to insert the relevant and required information on the Settings_WebHook resource for that particular Subscribe operation. The Data object is defined as follows:
 "Data" :
{
  "Name" : "Test webhook" 
   , "TriggerWhenCreated" : "true"
   , "TriggerWhenDeleted" : "true"
  [ , ...]
}
Moreover, if multiple informations are provided it will be inserted into that new record fulfilling all criteria.

Example of requests

Request to Subscribe a Settings_WebHook resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_WebHook",
  "Operation": "Subscribe",
  "Module": "Account",
  "Data" : {
		"Name" : "Test",
		"TriggerWhenCreated" : "true",
		"TriggerWhenDeleted" : "true",
		"Url" : "http://www.example.com/catchHook",
		"SubscriptionOwner" : "TestApplication"
	}
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
        "WebHookId": "926a3ac0-1971-4201-9dc1-2a8c4ace7487",
        "Status": "Subscribed"
    }
}							

Example programs

Subscribe an Settings_WebHook
The sample C#.Net code is a simple RestClient that uses the API to create an Settings_WebHook.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Create program.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Settings_WebHook",
Operation = "Subscribe",
Module = "Account"
Data = new System.Collections.Generic.Dictionary<string, object>()
{
{"Name" : "Test"},
{"TriggerWhenCreated" : "true"},
{"TriggerWhenDeleted" : "true"},
{"Url" : "http://www.example.com/catchHook"},
{"SubscriptionOwner" : "TestApplication"}
}
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "",
  "Data": {
    "WebHookId": "926a3ac0-1971-4201-9dc1-2a8c4ace7487",
    "Status": "Subscribed"
  }
}								    

Settings_WebHook/UnSubscribe

UnSubscribe operation contract allows you to perform delete operation on the Settings_WebHook resource.
ErrorCode Description
200503 Only occurs when attempted an webhook UnSubscribe by Id and the webhook do not exists

API Url

http://liveapi.claritysoftcrm.com/api/v1/Settings_WebHook/UnSubscribe

Allowed by request methods

UnSubscribe,Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the UnSubscribe operation on the Settings_WebHook resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the Settings_WebHook resource contract, you need to Pass "Settings_WebHook" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource Settings_WebHook. Please check the allowed operations on this resource Settings_WebHook. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/Settings_WebHook. In this case, for the Delete contract, you need to pass "UnSubscribe" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.
Module String This parameter defines the type of module that is to be performed on the resource Settings_WebHook.
Id String By using the Id parameter you can delete a specific Settings_WebHook resource by its identifier. This parameter is provided as a UUID. Defining this parameter ensures that you can delete at most one account in the response.
Note : When the Id parameter is defined, the Filter and SQLFilter parameters will be strictly ignored.

Example of requests

Request to UnSubscribe an Settings_WebHook resource by Id.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "Settings_WebHook",
  "Operation": "UnSubscribe",
  "Module": "Account",
  "Id" : "e7cc5abe-5cc5-4cbd-ab0b-79a0848ca762"
}
							
Response :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
      "WebhookId": "e7cc5abe-5cc5-4cbd-ab0b-79a0848ca762",
      "Status": "Deleted"
  }
}							

Example programs

Request with columns and filter.
The sample C#.Net code is a simple RestClient that uses the API to .
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Delete program using id.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "Settings_WebHook",
Operation = "UnSubscribe",
Module = "Account",
Id = "e7cc5abe-5cc5-4cbd-ab0b-79a0848ca762"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
    "Status": "Success",
    "ErrorCode": 0,
    "Message": "",
    "Data": {
        "WebhookId": "e7cc5abe-5cc5-4cbd-ab0b-79a0848ca762",
        "Status": "Deleted"
    }
}								    

General_Process

General_Process is a resource contract that allows you to perform various operations on the resource.

API Url

http://liveapi.claritysoftcrm.com/api/v1/General_Process

Available operations

Authenticate,CacheData

List of standard fields

FieldDescription
NA
NA

Operations

General_Process/Authenticate

Authenticate operation contract allows you to perform read operation on the General_Process resource.
ErrorCode Description
30201 General Error occurred while checking permission
30202 View permission denied
30203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/General_Process/Authenticate

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the Authenticate operation on the General_Process resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the General_Process resource contract, you need to Pass "General_Process" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource General_Process. Please check the allowed operations on this resource General_Process. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/General_Process. In this case, for the Authenticate contract, you need to pass "Authenticate" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.

Example of requests

Request for a single General_Process resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "General_Process",
  "Operation": "Authenticate"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "Authenticated Successfully.",
  "Data": {
    "KeyOwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a"
  }
}							

Example programs

Request for Authentication.
The sample C#.Net code is a simple RestClient that uses the API to authenticate.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "General_Process",
Operation = "Authenticate"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "Authenticated Successfully.",
  "Data": {
    "KeyOwnerId": "dc3d0523-db19-4c45-8f81-9d535c36e52a"
  }
}                 

General_Process/CacheData

CacheData operation contract allows you to perform read operation on the General_Process resource.
ErrorCode Description
30201 General Error occurred while checking permission
30202 View permission denied
30203 General Error occurred while fetching records

API Url

http://liveapi.claritysoftcrm.com/api/v1/General_Process/CacheData

Allowed by request methods

Post

List of parameters

ParameterDatatypeDescription
APIKey String This parameter is the client shared API-Key. This is the authentication parameter which if invalid or not send along with the request will unable to authenticate the CacheData operation on the General_Process resource.
Resource String This parameter defines the resource type. It is only required if you are using the resource independent base url like http://liveapi.claritysoftcrm.com/api/v1. In this case, for the General_Process resource contract, you need to Pass "General_Process" here.
Note : The Parameter is always overriden (or, technically ignored) by the resource of the url if you are using the resource dependent base url.
Operation String This parameter defines the type of operation that is to be performed on the resource General_Process. Please check the allowed operations on this resource General_Process. It is only required if you are using the operation independent base url like http://liveapi.claritysoftcrm.com/api/v1 or http://liveapi.claritysoftcrm.com/api/v1/General_Process. In this case, for the CacheData contract, you need to pass "CacheData" here.
Note : The parameter is always overriden (or, technically ignored) by the operation of the url if you are using the operation dependent base url.

Example of requests

Request for a single General_Process resource.

Request :
{
  "APIKey": "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
  "Resource": "General_Process",
  "Operation": "CacheData"
}							
Response :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "Cache Created Successfully!",
  "Data": null
}							

Example programs

Request for CacheData.
The sample C#.Net code is a simple RestClient that uses the API to CacheData.
Source :
/************************************************************
* (1) Description :-
* ===================
* Example Get request using filter.
*
* (2) Pre Requisites :-
* =====================
*
* (2.1) Json.NET 10.0.3
* Install-Package Newtonsoft.Json
* -- For More info on Json.NET 10.0.3 visit: https://www.nuget.org/packages/Newtonsoft.Json/
*
* (2.2) RestSharp
* Install-Package RestSharp -Version 105.2.3
* -- For More info on RestSharp visit: https://www.nuget.org/packages/RestSharp
*
* (3) Author : PK <projjwalkmaiti@gmail.com>
* (4) Last Modified Date : 04-JUL-2017
*************************************************************/
using System;
namespace TestClarityAPI
{
class Program
{
static void Main(string[] args)
{
RestSharp.RestClient client = new RestSharp.RestClient();
client.BaseUrl = new System.Uri("http://liveapi.claritysoftcrm.com/api/v1");
var request = new RestSharp.RestRequest();
request.Method = RestSharp.Method.POST;
var jsonParameter = new
{
APIKey = "claritysandbox-key-99b2ccf84d2d485d9e3f2a9bb09c7ff5",
Resource = "General_Process",
Operation = "CacheData"
};
request.RequestFormat = RestSharp.DataFormat.Json;
request.AddBody(Newtonsoft.Json.JsonConvert.SerializeObject(jsonParameter));
var response = client.Execute(request);
string json_payload = string.Empty;
if (response.ResponseStatus == RestSharp.ResponseStatus.Completed
&& response.StatusCode == System.Net.HttpStatusCode.OK)
{
json_payload = response.Content;
// formating payload
json_payload = Newtonsoft.Json.JsonConvert.SerializeObject(
Newtonsoft.Json.JsonConvert.DeserializeObject(json_payload),
Newtonsoft.Json.Formatting.Indented
);
}
else
{
json_payload = response.ErrorMessage;
}
System.Console.WriteLine(json_payload);
return;
}
}
}
Output :
{
  "Status": "Success",
  "ErrorCode": 0,
  "Message": "Cache Created Successfully!",
  "Data": null
}