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
Field | Description |
---|---|
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
Parameter | Datatype | Description |
---|---|---|
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. |
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. |
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. |
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. 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 :
|
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. |
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 payloadjson_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
Parameter | Datatype | Description |
---|---|---|
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.
|
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. |
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. |
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 payloadjson_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
Parameter | Datatype | Description |
---|---|---|
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. |
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. |
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 payloadjson_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
Parameter | Datatype | Description |
---|---|---|
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. |
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. |
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 payloadjson_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
Parameter | Datatype | Description |
---|---|---|
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. |
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. |
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. |
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 payloadjson_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
Parameter | Datatype | Description |
---|---|---|
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. |
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. |
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. |
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 payloadjson_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
Parameter | Datatype | Description |
---|---|---|
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. |
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. |
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. |
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. 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 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 payloadjson_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" } }