Back to index

FOREST CRM - QuickAdd API

This API provides a simple way to create a company with an otional contact and/or an optional opportunity and/or an optional activity — all in one step.

Please, note that it is for create only; queries and updates must be passed through the standard APIs.

Important! Please note, that — for security reasons — the QuickAdd API uses a different API key than the rest of the APIs!


Request

The request format is:

https://app.forestcrm.hu/api/<format>/<QUICKADD API KEY>/quickadd

Request HTTP method: POST

format can be either xml or json and only effects the format of the response.

Request parameters are:

'company'
An 'object' that holds the same attributes as defined in the Company API, and in addition the following options are available: Required.
'contact'
An 'object' that holds the same attributes as defined in the Contact API, except In addition the following options are available: Optional. At most one contact can be created with one call.
'opportunity'
An 'object' that holds the same attributes as defined in the Opportunity API, except Optional. At most one opportunity can be created with one call.
'activity'
An 'object' that holds the same attributes as defined in the Activity API, except Optional. At most one activity can be created. If both an opportunity and an activity is created the activity will be associated with the opportunity.

Please note that entries are supposed to be new (unique) of their kind unless update is explicitly called for. Non-unique entities will result in 422 response codes.

Example

POST https://app.forestcrm.hu/api/json/demo-qa/quickadd

Header:

Content-Type: application/json

Body:

{
  "company": {
    "name": "Great Company",
    "salesrep_id": 2400,
    "address_street": "1 My Way",
    "address_city": "Smallville",
    "address_country": "AD",
    "tax_number": "A23445/2011",
    "category_ids": [2145, 2210]
  },
  "contact": {
    "name": "John Little",
    "position": "Chairman",
    "phone": "(123) 123-4567",
    "note": "an old friend",
    "category_ids": [2190]
  },
  "opportunity": {
    "name": "Selling Brilliance",
    "salesrep_id": 2400,
    "product_id": 34
  },
  "activity": {
    "description": "Registered via webform - First Call",
    "salesrep_id": 2400,
    "activity_type_id": 5,
    "scheduled_start": '2012-09-18'
  }
}

Response

If all entities could be created the response is of status code 200 and the body contains the the IDs of the entities created in the format passed in the URL (json or xml):

{
  "company_id": 14930,
  "activity_id": 87555,
  "opportunity_id": 412,
  "contact_id": 17635
}

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

Back to index