This API provides the following services:
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/companies
Request HTTP method: GET
Request parameters:
If no parameters are supplied, all companies for the tenant are returned.
GET https://app.forestcrm.hu/api/xml/demo/companies?query=part&withOpportunityor
GET https://app.forestcrm.hu/api/xml/demo/companies?id=A1231&external_ref
Response conforms the attached XSD.
Notes:
address_country_code
elements contain ISO 3166 two-letter coutry codes<companies> <company id="5206"> <updated>2010-12-29T15:44:12+01:00</updated> <name>Some partner</name> <address_city>My city</address_city> <address_zip>12345</address_zip> <address_street>2001 Main Street</address_street> <address_country_code>US</address_country_code> <salesrep>Alan Shephard</salesrep> <homepage>http://www.some-partner.net</homepage> <tax_number>123-456-A-3</tax_number> <description></description> <archive>false</archive> <categories> <category>Size: 10-50</category> </categories> <external_ref>CPY-1766</external_ref> </company> <company id="5207"> <updated>2010-12-29T08:37:38+01:00</updated> <name>Another partner</name> <address_city>My town</address_city> <address_zip>24680</address_zip> <address_street>44 Downtown Drive</address_street> <address_country_code>GB</address_country_code> <salesrep>Mike Johnson</salesrep> <description>Used to be a good client</description> <archive>true</archive> <categories> <category>Size: 10-50</category> <category>VIP</category> </categories> </company> </companies>
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/companies
Request HTTP method: POST
Request parameters (optional params default to empty unless noted otherwise):
POST https://app.forestcrm.hu/api/xml/demo/companies
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] } }
If the company could be created the response is of status code 200 and the body contains the the ID of the company created in XML format:
<company> <id type="integer">14914</id> </company>
Errors are reported with a status code (422) and the response body contains the errors in XML format.
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/companies/<company ID>or
https://app.forestcrm.hu/api/xml/<API KEY>/companies/<company ID>?external_ref
Request HTTP method: PUT
Request parameters: same as in create
Note that the requested attributes get updated (overwritten), missing attributes don't change.
PUT https://app.forestcrm.hu/api/xml/demo/companies/14914
Header:
Content-Type: application/json
Body:
{ "company": { "homepage": "http://greatcompany.example.com" } }
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.