Activity API Documentation

Modified on Fri, 21 Aug at 12:42 PM

Activity API Guide  •  Version 1.40  •  Prepared by Karen Barker  •  1 November 2022

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

ParameterRequiredDescription
leadidRequiredThe ID of the lead to associate the activity with.
datetimeRequiredDate and time of the activity. e.g. 2013-11-25 12:00:00.
typeRequiredThe activity type — one of Task Event Note Telephone Call Text Message Reply Text Msg Email Reply Email Letter.
field1RequiredMain description of the activity.
field2OptionalSecond description for the activity (for the email activity, the email body).
emailOptionalThe email address associated with either email or reply email activity.
actionedtask / event onlyOptionalWhether the task/event has been actioned or not — Yes No.
duedatetimetask / event onlyOptionalThe date and time due. e.g. 2013-11-25 12:00:00.
enddatetimeevent onlyOptionalThe date and time the event ends. e.g. 2013-11-25 13:00:00.
prioritytask / event onlyOptionalPrioritise the task or event — Yes No.
usertask / event onlyOptionalFull name of the user the task or event should be assigned to (must be an exact match).

Response

FieldDescription
idThe ID of the new activity.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML format error or no XML provided

Lead

List activities associated with a lead.

<request>lead</request>

Parameters

ParameterRequiredDescription
leadidRequiredThe ID of the lead.

Response

A collection of activities associated with the lead. Each activity returned includes the following data:

FieldDescription
idThe ID of the activity.
typeThe activity type.
field1Main description of the activity.
field2Second description for the activity (for the email activity, the email body).
leadfullnameFull name of the associated lead.
leadcompanyCompany name of the associated lead.
userThe name of the user assigned to this activity.
cuserThe name of the user who created the activity.
emailFor email activities, the to/from email address.
bccFor email activities, the bcc email address(es).
ccFor email activities, the cc email address(es).
phoneFor text message activities, the to/from phone number.
actionedWhether the activity has been actioned — Yes No.
datetimeDate and time of the activity. e.g. 2013-11-25 12:00:00.
duedatetimeFor tasks/events, date/time due. e.g. 2013-11-25 12:00:00.
enddatetimeFor tasks/events, date/time ended. e.g. 2013-11-25 12:00:00.
priorityFor tasks/events, whether prioritised — Yes No.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML format error or no XML provided

Tasks

List tasks/events for the specified time period.

<request>tasks</request>

Parameters

ParameterRequiredDescription
periodOptionalThe time period to search.
Time PeriodValue
Today & Due Nowtodayduenow
Todaytoday
Tomorrowtomorrow
This Weekweek
Next Weeknextweek
Next 7 Daysnext7days
Next 30 Daysnext30days
This Monthmonth
Next Monthnextmonth
Next 3 Monthsnext3months
Next 6 Monthsnext6months
This Yearyear
Next Yearnextyear
All Timeall

Response

A collection of activity items. Each activity returned includes the following data:

FieldDescription
idThe ID of the activity item.
leadidThe associated lead ID.
typeThe activity type.
field1Main description of the activity.
field2Second description for the activity.
leadfullnameFull name of the associated lead.
leadcompanyCompany name of the associated lead.
userThe name of the user assigned to this activity.
cuserThe name of the user who created the activity.
duedatetimeDate and time due. e.g. 2013-11-25 12:00:00.
enddatetimeDate and time ended. e.g. 2013-11-25 12:00:00.
priorityWhether prioritised — Yes No.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML format error or no XML provided

Complete

Mark an activity as complete.

<request>complete</request>

Parameters

ParameterRequiredDescription
idRequiredThe ID of the activity to complete.

Response

If the complete succeeds, the code will be 0 with the message OK.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML format error or no XML provided

Delete

<request>delete</request>

Parameters

ParameterRequiredDescription
idRequiredThe ID of the activity to delete.

Response

If the delete succeeds, the code will be 0 with the message OK.

Error Codes

CodeDescription
0No errors
1Validation or authentication error
2XML 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

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article