Back to index

FOREST CRM - XML Activity API

This API provides the following services:


List activities

Request

The request format is:

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

Request parameters:

companyId (optional):
id of the company whose activities are queried

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

Example

https://app.forestcrm.hu/api/xml/demo/activities?companyId=5206

Response

Response conforms the attached XSD.

Notes:

Example

<activities>
  <activity id="5018">
    <updated>2011-03-20T00:00:00+01:00</updated>
    <company id="8093">Second Partner</company>
    <description>In the cold call I reminded her of the brilliant colors in our logo that made them interested in the effectiveness of our creative ideas. Would meet Bunny, meeting scheduled.</description>
    <type>phone</type>
    <status>completed</status>
    <priority>1</priority>
    <responsible>Charmy Kitty</responsible>
    <start_at>2011-03-15T08:30:00+01:00</start_at>
    <duration>15</duration>
    <completed_at>2011-03-15</completed_at>
  </activity>
  <activity id="5021">
    <updated>2011-03-20T00:00:00+01:00</updated>
    <company id="8093">Second Partner</company>
    <description>Called us to ask for a shadow for an exhibition.  On my suggestion they ordered 3 plastic palm trees.  Tiny take it over, please.  Meeting the deadline is very important.</description>
    <type>background</type>
    <status>open</status>
    <priority>1</priority>
    <responsible>Tiny Mite</responsible>
    <start_at>2011-03-23T11:30:00+01:00</start_at>
    <duration>60</duration>
    <opportunity id="1281">Shadow for Exhibition</opportunity>
    <contact id="14560">John Smith</contact>
  </activity>
</activities>

Create new activity

Request

The request format is:

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

Request HTTP method: POST

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

activity["description"]:
Activity description text.
activity["salesrep_id"]:
The ID of the user (salesrep) who is assigned to the activity. Can be retrieved via the User API.
activity["company_id"]:
The ID of the company associated with the activity. Can be retrieved via the Company API.
activity["activity_type_id"]:
1 = phone call, 2 = meeting, 3 = background work, 5 = to do. Please note that the value of "4" is not to be used.
activity["activity_status_id"]:
1 = open, 2 = cancelled, 3 = completed. Optional, defaults to 1.
activity["priority"]:
0 = low, 1 = normal, 2 = high. Optional, defaults to 1.
activity["scheduled_start"]:
Date and time when the activity should start. 'To do' type activities disregard time and therefore time should be set to 0:00 or omitted.
activity["duration"]:
(Scheduled) duration for the activity in minutes. 'To do' type activities do not have durations.
activity["location"]:
Location description text. Optional.
activity["opportunity_id"]:
The ID of the opportunity associated with the activity. Can be retrieved via the Opportunity API. The opportunity must be associated with the same company as the activity. Optional.
activity["completed_at"]:
Date (without time!) when the activity has been completed. Optional.
activity["completion_comment"]:
Comment for the completion. Optional.
activity["contact_id"]:
The ID of the contact associated with the activity. Can be retrieved via the Contact API. Please note, that the contact has to be associated with the company. Optional.
activity["external_ref"]:
External reference to the entity. Optional.

Example

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

Header:

Content-Type: application/json

Body:

{
  "activity": {
    "description": "Registered via webform - First Call",
    "salesrep_id": 2400,
    "company_id": 14566,
    "activity_type_id": 3,
    "scheduled_start": '2012-09-18 13:30',
    "duration": 60
  }
}

Response

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

  <activity>
    <id type="integer">87665</id>
  </activity>

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


Update (modify) an existing activity

Request

The request format is:

https://app.forestcrm.hu/api/xml/<API KEY>/activities/<activity ID>
or
https://app.forestcrm.hu/api/xml/<API KEY>/activities/<activity 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/activities/87665

Header:

Content-Type: application/json

Body:

{
  "activity": {
    "duration": 90
  }
}

Response

If the activity 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