This API provides the following services:
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/opportunities
Request parameters:
If no parameters are supplied, all opportunities for the tenant are returned.
https://app.forestcrm.hu/api/xml/demo/opportunities?companyId="5206"
Response conforms the attached XSD.
Notes:
<opportunities> <opportunity id="2462"> <updated>2011-03-20T00:00:00+01:00</updated> <company id="8092">First Partner</company> <name>Sell goldfish in bars to hedge against inflation</name> <responsible>Mouse, The Grey</responsible> <comment/> <product>Brilliant Ideas</product> <rejected>false</rejected> <status>Lead</status> <probability/> <opportunity_date>2011-01-10</opportunity_date> <opportunity_total> <value>200000</value> <currency>USD</currency> </opportunity_total> <categories/> <external_ref>8A99B-D4</external_ref> </opportunity> <opportunity id="2463"> <updated>2011-03-20T00:00:00+01:00</updated> <company id="8097">Sixth Partner</company> <name>Let's come up with an inflatable spaceship</name> <responsible>Bunny, The Brain</responsible> <comment/> <product>Successful(?) Projects</product> <rejected>false</rejected> <status>Contract expired</status> <probability>0.75</probability> <opportunity_date>2011-01-10</opportunity_date> <opportunity_total> <value>500000</value> <currency>USD</currency> </opportunity_total> <offer_date>2011-02-21</offer_date> <offer_total> <value>200000</value> <currency>USD</currency> </offer_total> <contract_date>2011-03-14</contract_date> <contract_expiration_date>2011-04-21</contract_expiration_date> <contract_total> <value>200000</value> <currency>USD</currency> </contract_total> <categories> <category>Manufacturing</category> <category>Service</category> </categories> </opportunity> </opportunities>
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/opportunities
Request HTTP method: POST
Request parameters (optional params default to empty unless noted otherwise):
false
.offer_total
has a value.contract_total
has a value.false
. Note that calculation result overrides manually set value.false
.POST https://app.forestcrm.hu/api/xml/demo/opportunities
Header:
Content-Type: application/json
Body:
{ "opportunity": { "name": "Selling Brillinace with Grace", "salesrep_id": 2400, "company_id": 14566, "product_id": 357, "offer_date": '2012-09-18', "offer_total": 60000 } }
If the opportunity could be created the response is of status code 200 and the body contains the the ID of the opportunity created in XML format:
<opportunity> <id type="integer">19373</id> </opportunity>
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>/opportunities/<opportunity ID>or
https://app.forestcrm.hu/api/xml/<API KEY>/opportunities/<opportunity 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/opportunities/19373
Header:
Content-Type: application/json
Body:
{ "opportunity": { "contract_date": '2012-09-20', "contract_total": 50000 } }
If the opportunity 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.