Back to index

FOREST CRM - XML Contact API

This API provides the following services:


List contacts

Request

The request format is:

https://app.forestcrm.hu/api/xml/<API KEY>/contacts

Request HTTP method: GET

Request parameters:

query (optional):
string to query in contact data (name, position, phone, email). Partial matches are also returned. Search is case insensitive. query string may be but does not have to be surrounded by either single or double quotation marks.
companyId (optional):
id of the company whose contacts are queried. Can be supplied with query.

If no parameters are supplied, all contacts for the tenant are returned.

Example

https://app.forestcrm.hu/api/xml/demo/contacts?query="Alan";companyId="5206"

Response

Response conforms the attached XSD.

Notes:

Example

<contacts>
  <contact id="4145">
    <updated>2010-12-29T00:00:00+01:00</updated>
    <name>Alan Shephard</name>
    <company id="5206">Some partner</company>
    <position/>
    <phone>+999 412 111-2222</phone>
    <email>[email protected]</email>
    <skype/>
    <phone2/>
    <fax/>
    <note/>
    <external_ref>32b11281-d721-4f2b-ae2f-6c6c600d8f67</external_ref>
  <contact id="4147">
    <updated>2010-12-29T00:00:00+01:00</updated>
    <name>Mike Johnson</name>
    <company id="5213">Another partner</company>
    <position>manager</position>
    <phone>+999 412 987-6543</phone>
    <email>[email protected]</email>
    <skype/>
    <phone2/>
    <fax/>
    <note/>
  </contact>
</contacts>

Create new contact

Request

The request format is:

https://app.forestcrm.hu/api/xml/<API KEY>/contacts

Request HTTP method: POST

Request parameters (optional params default to empty unless noted otherwise):

contact["company_id"]:
The ID of the associated company. Can be retrieved via the Company API.
contact["name"]:
Name of the contact.
contact["position"]:
The contact's position ('title'). Optional.
contact["phone"]:
Primary phone number of the contact (string). Optional.
contact["phone2"]:
Secondary phone number of the contact (string). Optional.
contact["email"]:
The contact's email. Optional.
contact["skype"]:
The contact's Skype ID (string). Optional.
contact["fax"]:
Fax number for the contact (string). Optional.
contact["note"]:
Free text note for the contact. Optional.
contact["category_ids"]:
Array of contact category IDs to associate with the contact. Can be retrieved via the Category API. Invalid values omitted. Optional.
contact["external_ref"]:
External reference to the entity. Optional.

Example

POST https://app.forestcrm.hu/api/xml/demo/categories

Header:

Content-Type: application/json

Body:

{
  "contact": {
    "company_id": 19424,
    "name": "John Little",
    "position": "Chairman",
    "phone": "(123) 123-4567",
    "note": "an old friend",
    "category_ids": [2190]
  }
}

Response

If the contact could be created the response is of status code 200 and the body contains the the ID of the contact created in XML format:

  <contact>
    <id type="integer">38756</id>
  </contact>

Errors are reported with a status code (422) and the response body contains the errors in XML format.


Update (modify) an existing contact

Request

The request format is:

https://app.forestcrm.hu/api/xml/<API KEY>/contacts/<contact ID>
or
https://app.forestcrm.hu/api/xml/<API KEY>/contacts/<contact ID>?external_ref
external_ref
If present (with any value or without value), `id` is interpreted as an external reference ("external id").

Request HTTP method: PUT

Request parameters: same as in create

Note that the requested attributes get updated (overwritten), missing attributes don't change.

Example

PUT https://app.forestcrm.hu/api/xml/demo/contacts/38756

Header:

Content-Type: application/json

Body:

{
  "contact": {
    "email": "[email protected]"
  }
}

Response

If the company could be updated the response is of status code 200.

Errors are reported with a status code (422) and the response body contains the errors in XML format.

Back to index