Introduction
This API allows the creation, listing and reading of lead activity (notes, calls, tasks, etc.). The request is made by making an HTTP POST of an XML message containing an access key, request type and other elements.
Note: this API currently creates activity records that show against the lead, but no action is taken to actually send the email, text message, etc.
The Request
To use this API, an access key is required. Provide the key in a key element within the request. Access keys can be created in ‘Settings > Access Keys’.
For each request, a request element must also be given specifying the request type — create lead tasks complete delete. Details of how to make each request type are given below.
If the main service is accessed at the address domain.example.com, then a POST request should be made to the corresponding API URL:
https://domain.example.com/api/APIActivity.php
An XML message should be sent as the POST data:
<?xml version="1.0" encoding="ISO-8859-1"?> <data> <key>Yrg32FoiRdSriLYEbLrzSvFmurBGsPiz</key> <request>create</request> ... </data>
The Response
The server will respond with XML data. The response will always contain Code (error code) and Message (response message) elements. If there are several messages, there may be multiple Message elements. If successful, other response elements will also be returned.
A successful response may look like this:
<?xml version="1.0" encoding="ISO-8859-1"?> <result> <code>0</code> <message>OK</message> ... </result>
Create
<request>create</request>
Parameters
| Parameter | Required | Description |
|---|---|---|
| leadid | Required | The ID of the lead to associate the activity with. |
| datetime | Required | Date and time of the activity. e.g. 2013-11-25 12:00:00. |
| type | Required | The activity type — one of Task Event Note Telephone Call Text Message Reply Text Msg Email Reply Email Letter. |
| field1 | Required | Main description of the activity. |
| field2 | Optional | Second description for the activity (for the email activity, the email body). |
| Optional | The email address associated with either email or reply email activity. | |
| actionedtask / event only | Optional | Whether the task/event has been actioned or not — Yes No. |
| duedatetimetask / event only | Optional | The date and time due. e.g. 2013-11-25 12:00:00. |
| enddatetimeevent only | Optional | The date and time the event ends. e.g. 2013-11-25 13:00:00. |
| prioritytask / event only | Optional | Prioritise the task or event — Yes No. |
| usertask / event only | Optional | Full name of the user the task or event should be assigned to (must be an exact match). |
Response
| Field | Description |
|---|---|
| id | The ID of the new activity. |
Error Codes
| Code | Description |
|---|---|
| 0 | No errors |
| 1 | Validation or authentication error |
| 2 | XML format error or no XML provided |
Lead
List activities associated with a lead.
<request>lead</request>
Parameters
| Parameter | Required | Description |
|---|---|---|
| leadid | Required | The ID of the lead. |
Response
A collection of activities associated with the lead. Each activity returned includes the following data:
| Field | Description |
|---|---|
| id | The ID of the activity. |
| type | The activity type. |
| field1 | Main description of the activity. |
| field2 | Second description for the activity (for the email activity, the email body). |
| leadfullname | Full name of the associated lead. |
| leadcompany | Company name of the associated lead. |
| user | The name of the user assigned to this activity. |
| cuser | The name of the user who created the activity. |
| For email activities, the to/from email address. | |
| bcc | For email activities, the bcc email address(es). |
| cc | For email activities, the cc email address(es). |
| phone | For text message activities, the to/from phone number. |
| actioned | Whether the activity has been actioned — Yes No. |
| datetime | Date and time of the activity. e.g. 2013-11-25 12:00:00. |
| duedatetime | For tasks/events, date/time due. e.g. 2013-11-25 12:00:00. |
| enddatetime | For tasks/events, date/time ended. e.g. 2013-11-25 12:00:00. |
| priority | For tasks/events, whether prioritised — Yes No. |
Error Codes
| Code | Description |
|---|---|
| 0 | No errors |
| 1 | Validation or authentication error |
| 2 | XML format error or no XML provided |
Tasks
List tasks/events for the specified time period.
<request>tasks</request>
Parameters
| Parameter | Required | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| period | Optional | The time period to search.
|
Response
A collection of activity items. Each activity returned includes the following data:
| Field | Description |
|---|---|
| id | The ID of the activity item. |
| leadid | The associated lead ID. |
| type | The activity type. |
| field1 | Main description of the activity. |
| field2 | Second description for the activity. |
| leadfullname | Full name of the associated lead. |
| leadcompany | Company name of the associated lead. |
| user | The name of the user assigned to this activity. |
| cuser | The name of the user who created the activity. |
| duedatetime | Date and time due. e.g. 2013-11-25 12:00:00. |
| enddatetime | Date and time ended. e.g. 2013-11-25 12:00:00. |
| priority | Whether prioritised — Yes No. |
Error Codes
| Code | Description |
|---|---|
| 0 | No errors |
| 1 | Validation or authentication error |
| 2 | XML format error or no XML provided |
Complete
Mark an activity as complete.
<request>complete</request>
Parameters
| Parameter | Required | Description |
|---|---|---|
| id | Required | The ID of the activity to complete. |
Response
If the complete succeeds, the code will be 0 with the message OK.
Error Codes
| Code | Description |
|---|---|
| 0 | No errors |
| 1 | Validation or authentication error |
| 2 | XML format error or no XML provided |
Delete
<request>delete</request>
Parameters
| Parameter | Required | Description |
|---|---|---|
| id | Required | The ID of the activity to delete. |
Response
If the delete succeeds, the code will be 0 with the message OK.
Error Codes
| Code | Description |
|---|---|
| 0 | No errors |
| 1 | Validation or authentication error |
| 2 | XML format error or no XML provided |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article