Making the First Call

Acquire an Authentication Token

Before calling any web API method, you have to acquire an authentication token. Use the following POST method which returns an authentication token that can subsequently be used by all other Web API method to access the system.

Request
{{server}}/crmapi/rest/v2/authentication/token
Body
{
	"username": "mpadministrator",
    "password": "1234",
    "organisation": "CRMDEMO",
    "unit": "EE63A82C4FEBE02FF34E90DD1EBA5ABE"
}
 
Note that the unit parameter is optional. If not specified then the default unit of the user that is represented by the specified Web API key will be used
Response
{
    "status": {
        "code": "OK",
        "message": null,
        "description": null
    },
    "data": {
        "token": "FA32A9008D7348F5984DEA452FA65B5A"
    }
}

For more information you can refer to our API Authentication guide and our authentication Web API reference

 

The following section lists a few code examples that can be utilized in order to implement the acquisition of an Authentication Token

 

Call a Web API method

After the Authentication Token has been acquired, it can be used for calling any GET or POST method. Below you can find some respective examples for both the methods. 

Call a GET Method

Retrieve a specific Contact Information using the show method

Request
{{server}}/crmapi/rest/v2/contact_information/show?token={{token}}&contact_information_identifier=id=61B2B492DC334C5189024AC426C0CA5A&fields_set=id,type,name
Response
{
   "status":
   {
       "message": null,
       "description": null,
       "code": "OK"
   },
   "data":
   {
		"id": "61B2B492DC334C5189024AC426C0CA5A",
		"type": "PERSON",
		"name": "Brian Krause"
	}
}

 

The following section lists a few code examples that can be utilized in order to implement the retrieval of a specific Contact Information

 

Call a POST Method

Create a new Contact Information using the create method

Request
{{server}}/crmapi/rest/v2/contact_information/create
Body
{
	"token":"{{token}}",
	"type":"PERSON",
	"title":"Miss",
	"first_name":"Maria",
	"middle_name":"Emilia",
	"last_name":"Roberts",
	"fields_set":"id, type"
}
Response
{
	"status": {
		"message": "",
        "description": "",
        "code": "OK"
	},
	"data": {
		"id": "5T8AB492DC334C7099024AC426C0RT5",
		"type":"PERSON"
	}
}

 

The following section lists a few code examples that can be utilized in order to implement the creation of a specific Contact Information

 

Next Steps

Now that you are familiar with our Web API basic principles, you can start using our Web API to access CRM.COM. You can find our full Web API documentation under the Web API Reference page

Related pages