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