Contacts

The API exposes a convenience end-point to fetch all the contacts of all projects. Below is an example how to utilize this end-point.

Fetching all the contacts of all projects

To fetch all the contacts of all projects use the root level end-point:

/contacts

Example request:

curl
JavaScript
curl -X GET -H "Congrid-API-Token: YOUR-API-TOKEN" -H "Content-Type: application/json" \
  "https://api.congrid.com/v1/contacts"
var request = require("request");

var options = { method: 'GET',
  url: "https://api.congrid.com/v1/contacts",
  headers: 
   { 'content-type': 'application/json',
     'congrid-api-token': 'YOUR-API-TOKEN' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response:

{
  "count": 2,
  "pageSize": 100,
  "results": [
    {
      "companyId": "xVoLSgoF1Xy6CymR0wOWf379WZqDD0UZ",
      "email": "george@congrid.fi",
      "name": "George",
      "phone": "+35812121212",
      "taxNumber": "X-999",
      "id": "wOqUMsheEBtNQCh3hw0UoOsevzSSL6fe",
      "projectId": "PilvPWN3hZoNq4UOXVg6FFklXBJRTVzQ",
      "modifiedAt: "2017-01-15T10:20:15.000Z"
    },
    {
      "companyId": "YyRUdNwYXW6istOf5BGPfcYZIYd8p2zv",
      "email": "mike@congrid.fi",
      "name": "Mike",
      "phone": "+35800000000",
      "taxNumber": "111-222",
      "id": "FOcqLf2MXKLMcVDpEplpx84TXwWYedh8",
      "projectId": "PilvPWN3hZoNq4UOXVg6FFklXBJRTVzQ",
      "modifiedAt: "2017-01-15T10:05:15.000Z"
    }
  ]
}

Note that the response contains both the contacts we added previously for our example project. Since we only have one project in the system only the contacts of those are returned but in real-life scenario the contacts of every project are returned.

Fetching contacts that have changed

To fetch contacts that have changed during a certain time period use the modifiedAtGt, modifiedAtGte, modifiedAtLt, modifiedAtLte query parameters.

For example to fetch contacts that have changed from two subsequent days use the following:

For the first day:

/contacts?modifiedAtGte=2017-01-01T00:00:00&?modifiedAtLt=2017-01-02T00:00:00

For the second day:

/contacts?modifiedAtGte=2017-01-02T00:00:00&?modifiedAtLt=2017-01-03T00:00:00

results matching ""

    No results matching ""