List Activities
The following macros are not currently supported in the header:
  • style

List Activities

Returns an array of activity objects.

GET /activities

Returns an array of activity objects order by date created.

GET /activities/recent

Parameters

Table of allowed parameters.

_page

unsigned int

The page of the list to display. For example, 5 will display the fifth page. Each page contains 10 resources.

_limit

unsigned int

The maximum number of resources to return. Default is 10 and maximum is 50.

_offset

unsigned int

The position in the list of resources to return from. For example, if you had 20 resources and requested an offset of 10. Resources 10 to 19 would be returned. Offset cannot be used in conjunction with _page.

_fields

partial string

Allows you to specify optional fields and linked objects to include in the response.

_filters

partial_string



Filtering Activities

You can filter the returned list using the _filters parameter.

Name

Example

Description

Name

Example

Description

owner_type





type





invitation





read

read(no) or read(0) or read(n)



parent_id





thread_id





staff_id





priority_id





class_id





task_id





message_id





owner_id





visibility





medium





against_type

against_type(company,job)

Only return activities against the given type

against_id

against_id(12,12)

Only return activities against object with given ids.

order_by_asc

order_by_asc(date_ended)

date_started, date_created, date_ended, date_logged, date_modified and id

new billable, nonbillable

order_by_desc



Same as order_by_asc but opposite direction

date_created_before





date_created_after





date_started_before





date_started_after





date_logged_before





date_logged_after





date_ended_before





date_ended_after





date_modified_after





date_modified_before





max_id





min_id





NEW

<field_name>_greater_than(<value>),

<field_name>_less_than(<value>),

<field_name>_greater_than_or_equal(<value>),

<field_name>_less_than_or_equal(<value>)



_filters=id_greater_than(5)

Available fields:

id
thread
against_id
owner
staff
priority
class
task

Using the _not suffix (e.g, id_not) on standard in filters will returns results not in.



Handling the response

Below is a table of available response fields and objects that are returned within the response object of the returned object. The optional fields and objects can be requested in the _fields parameter; see included examples. Underlined values are default.

id

unsigned

Activity's unique identifier. This can be used to request other endpoints.

subject

string



parent

string

Parent activity endpoints. For example, /activities/13

parent_id

unsigned

Parent activity identifier. For example, 13.

thread

string

Thread activity endpoint. For example, /activities/13.

thread_id

unsigned

Thread activity identifier. For example, 13

against

string

The object endpoint the activity is against. For example, /company/14

against_type

string

The object the activity is against. For example, company or staff.

against_id

unsigned

Unique identifier for the object the activity is against.

owner

string

An endpoint representing the owner. For example, /staff/15 or /affiliation/14

owner_type

string

The type of owner. For example, staff or affiliation.

owner_id

unsigned

The owner's id. For example, 15 or 14.

medium

string

meeting, note, email, etc

body

string

The main content of the activity.

visibility

string

private, all, confidential

details

string



message_id

string

The custom message id

date_created

unix ts



date_started

unix ts



date_ended

unix ts



date_due

unix ts



date_modified

unix ts



staff

unsigned or object



priority

unsigned or object



rate

unsigned or object



rate_charged

unsigned float

The rate charged for the activity. If the rate has been changed for a particular activity, this will show the changed rate.

class

unsigned or object

Activity's class.

task

unsigned or object

The task the activity is against if any.

interacts

N/A

Adds an "interacts" array to each activity response. Please see Handling Interacts below for more information.



Fields that can be object indicate the field can be requested as a resource. For example.

GET /activities.json?_fields=staff

would return the activity's staff id. Where as,

GET /activities.json?_fields=staff(email)

would return the staff object, including any optional fields or objects within the parenthesis. In the above examples case, it would return the staff objects default values and optional email value.

Sample Response

GET /activities.json?_fields=staff(email)&_limit=3
{ "response" : [ { "subject" : "Give a heads up for the fax that I was about to se", "staff" : { "email" : "geoff.mcqueen@sample.com", "firstname" : "Geoff", "id" : "1000", "surname" : "McQueen" }, "id" : "11" }, { "subject" : "Give a heads up for the fax that I was about to se", "staff" : { "email" : "geoff.mcqueen@sample.com", "firstname" : "Geoff", "id" : "1000", "surname" : "McQueen" }, "id" : "12" }, { "subject" : "Wrote a letter outlining the use of this e-busines", "staff" : { "email" : "geoff.mcqueen@sample.com", "firstname" : "Geoff", "id" : "1000", "surname" : "McQueen" }, "id" : "45" } ], "meta" : { "status" : "ok", "message" : "Everything executed as expected." } }

Handling Interacts

An interact ("interaction") is a sender or recipient of an activity, which can be a staff or contact object (means you can pass in staff and contact optional fields in the _fields parameter). For a single activity, please see the List Activity Interacts Endpoint. Getting the interacts on an activity has never been easier. To include the interactions of all activities, please include the "interact" _fields option. For example,

GET /activities.json?_fields=interacts

This will attach an interact object to each activity in your response. Each interact has an owner_id and owner_type ("staff" or "contact"). The response will now also contain "staff" and "contacts". You can use the owner id and type to access the interact's owner details.

Using _fields=interacts

Using the "interacts" fields option alters the structure of the API response. Instead of an Array, it will return a Hash containing the original response under "activities", an array of staff under "staff" and contacts under "contacts". 

The interacts fields option also introduces a new filter for interact types. 

_filters=interacts(type(to,from,creator,cc,bcc,attendee,attended,did_not_attend))

Sample:

GET activities.json?_skip_auth=1&_fields=firstname,surname,email,interacts&_filters=interact(type(from,creator))
{ "meta":{ "more_info":"https://affinitylive.jira.com/wiki/display/APIS/Status+Codes#ok", "status":"ok", "message":"Everything executed as expected." }, "response":{ "contacts":[ { "firstname":"Kurt", "id":"22611", "surname":"Wagner", "email":"serge@sample.com", "mobile":"" } ], "staff":[ { "surname":"Higgins", "email":"christine.higgins@sample.com", "firstname":"Christine", "id":"110" }, { "firstname":"Hugh", "id":"122", "surname":"Cowling", "email":"hugh.cowling@sample.com" }, { "email":"geoff.mcqueen@sample.com", "surname":"McQueen", "id":"1000", "firstname":"Geoff" }, { "id":"1017", "firstname":"Alison", "email":"alison.russell@sample.com", "surname":"Russell" } ], "activities":[ { "id":"498038", "subject":"Duplicated jobs", "interacts":[ { "owner_id":"110", "id":"1", "date_actioned":"1340044186", "owner_type":"staff", "type":"from" } ] }, { "interacts":[ { "owner_type":"staff", "date_actioned":"1340043702", "id":"2", "owner_id":"110", "type":"from" } ], "subject":"Can't delete project - General", "id":"498035" }, { "subject":"Larry Jones, will you share why?", "id":"498034", "interacts":[ { "type":"from", "owner_id":"107", "id":"3", "date_actioned":"1340042682", "owner_type":"staff" } ] }, { "subject":"New Issue Created - Basecamp import problem", "id":"498032", "interacts":[ { "type":"from", "date_actioned":"1340042539", "owner_type":"staff", "owner_id":"107", "id":"4" } ] }, { "subject":"Welcome on board!", "id":"498031", "interacts":[ { "type":"from", "owner_id":"1017", "id":"5", "date_actioned":"1340042499", "owner_type":"staff" } ] }, { "subject":"Hiccup/bug on Staging", "id":"498030", "interacts":[ { "type":"from", "id":"6", "owner_id":"1000", "owner_type":"staff", "date_actioned":"1340042471" } ] }, { "id":"498029", "subject":"Hiccup/bug on Staging", "interacts":[ { "type":"from", "date_actioned":"1340040845", "owner_type":"contact", "owner_id":"22611", "id":"7" } ] }, { "interacts":[ { "date_actioned":"1340041227", "owner_type":"staff", "owner_id":"1000", "id":"8", "type":"from" } ], "subject":"Your Online Pay Stub Is Available", "id":"498028" }, { "subject":"AffinityLive Quick Tip #3 - Predict the future with Tasks &amp; Scheduling", "id":"498027", "interacts":[ { "date_actioned":"1340042403", "owner_type":"staff", "owner_id":"122", "id":"9", "type":"from" } ] }, { "id":"498026", "subject":"AffinityLive Quick Tip #1 ", "interacts":[ { "owner_id":"122", "id":"10", "date_actioned":"1340042402", "owner_type":"staff", "type":"from" } ] } ] } }