Skip to end of banner
Go to start of banner

Introduction

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The CRM.COM API allows you to interact with our system from your own application/system. Using the API you can interact with almost all CRM.COM Application's Resources. The API's architecture is built around REST using JSON. You can interact with the system using the available API methods using HTTP verbs such as GET and POSTJSON is returned by all API responses, including errors.

GET method

The HTTP GET method is used to read / retrieve a representation of a resource. GET method is not used to create, update or change of data. GET is idempotent, which means that making multiple identical requests ends up having the same result as a single request.

Example of GET method - GET contact_information/show

This method returns information related with a contact information. Single contact information is returned by each call.

Request
{{server}}/crmapi/rest/v2/contact_information/show?token={{token}}&contact_information_identifier=number=CI000111

POST method

The HTTP POST method is used to create or update the data and it is not idempotent. 

Example of POST method - POST contact_information/create

This method creates a contact information. Single contact information can be created by each call.

Request
{{server}}/crmapi/rest/v2/contact_information/create
Body
{
  "token":"{{token}}",
  "type":"PERSON",
  "title":"Mr",
  "first_name":"Customer",
  "middle_name":"Customer",
  "last_name":"Customer",
  "category_identifier":{"name":"Contact Category"},
  "owned_by_group_identifier":{"name":"Main Group"},
  "privacy_level_identifier":{"number":"8"},
  "notes": "Family",
   "demographics":
   {
     "gender":"FEMALE",
     "id_number":"ABC123456",
     "passport_number":"ABC123456",
     "social_security_number":"ABC123456",
     "country_of_residence_identifier":{"name":"CYPRUS"},
     "id_issued_by_country_identifier":{"name":"CYPRUS"},
     "passport_issued_by_country_identifier":{"name":"GREECE"},
     "industry_identifier":{"name":"Industry"},
     "industry_sector_identifier":{"name":"FOREX"},
     "date_of_birth":{
                       "day":01,
                       "month":01,
                       "year":1980                   
                  },    
 
    "address_set": [
                     {
                       "type": "HOME",
                       "postal_code": "0001",
                       "street_name": "Address",
                       "street_number" : "01",
                       "floor":01,
                       "apartment_number":"001",
                       "area": "Area",
                       "town_city":"City",
                       "district":"District",
                       "municipality":"Municipality",
                       "country_identifier":{ "two_character_code": "CY" },
                       "po_box":"00011",
                       "po_box_postal_code":"ABC111"               
                        
             }
          ],
   "phone_set": [
                 {
                    "type": "LANDLINE",
                    "number":"123456"
                 }
               ],
  "email_set": [
                 {
                    "type": "PERSONAL",
                    "email_address": "123456@crm.com"
                  }
                ],
  "fields_set":"first_name,last_name,demographics,email_set"
}

Fields Set

CRM.COM API offers the possibility to select the fields to be retrieved from each API method by specifying the fields_set input parameter. This parameter provides the possibility to filter the results and retrieve only the fields that are provided on the method (separated by a comma) or retrieve all the fields if not specified. 

Example of using fields_set - GET contact_information/show

Use the fields_set so as to retrieve only the name, preferred language, addresses, emails and phones of the contact to be retrieved.

Request
{{server}}/crmapi/rest/v2/contact_information/show?token={{token}}&contact_information_identifier=number=CI000111&fields_set=name,preferred_language,addresses_set,phones_set,emails_set

Pagination

There are API methods which retrieve a large number of entities such as list API methods. Some of these CRM.COM API methods provide the option to apply pagination on the results retrieved. 

In such cases construct the API call using the following input parameters:

  • number_of_results: The number of results that can be retrieved through each call. The maximum number of results can be 50. The oldest provisioning requests are retrieved fist
  • offset: It defines the number of entities that should be skipped from the results. During the first call it should be set to 0 and then it should be increased based on the number of results that were retrieved

Example of using pagination - GET provisioning/generic_provisioning_requests/get_pending

Use the number of results field in order to specify the number of entities that will be retrieved per each call and the offset field in order to specify the number of entities that should be skipped by each call.

Request
{{server}}/crmapi/rest/v2/provisioning/generic_provisioning_requests/get_pending?token={{token}}&provisioning_provider_identifier=alternative_code=GP1&number_of_results=5&offset=2
  • No labels