Get Activity Data via the REST API

January 20, 2015 | by

Let’s say you want to get all leads that were added to a list this month. Using the Get Lead Activities REST API, you can get this data.

Before calling the Get Lead Activities API, it is necessary to get an access token from the Authentication API and also get a starting date token from the Get Paging Token API.

Below is example code in Ruby that walks through the individual API endpoints you would have to call to return all leads added to a list this month.

Step One: Get Access Token

Step Two: Get Paging Token

Step Three: Get Activity Data

To determine the Activity Type Id needed for this call, query the Get Activity Types API. The Get Activity Types API will return a schema with all activity types and associated ids. For example, it will return id 12 for new leads created and id 1 for webpage visit.

Step Four: The Get Lead Activites API will return a paging token with each response that you can use to paginate through the results set.

For more information, please see the REST API documentation.