Retrieve activity feed for a given contact

Overview

The get Ortto endpoint of the activities entity is used to retrieve data from one or more activities for a given contact in Ortto’s customer data platform (CDP).

This page provides descriptions of this endpoint’s:


HTTP method and request resource

POST https://api.ap3api.com/v1/person/get/activities

NOTE: Ortto customers who have their instance region set to Australia or Europe will need to use specific service endpoints relative to the region:

For example: https://api.eu.ap3api.com/v1/<entity/endpoint>

All other Ortto users will use the default service endpoint (https://api.ap3api.com/).


Path and query parameters

This endpoint takes no additional path and/or query parameters.


Headers

This endpoint requires a custom API key and content type (application/json for the request body) in the header of the request:

  • X-Api-Key: CUSTOM-PRIVATE-API-KEY
  • Content-Type: application/json

Request body

The request body consists of a JSON object whose valid elements are listed in the table below.

Example get activities request body from Ortto’s CDP

json

{ "person_id": "0066accc0f626f3d5b8d9000", "activities": ["act::o", "act::c"], "limit": 100, "offset": 0 }

Example get activities request body with timeframe from Ortto’s CDP

json

{ "person_id": "0066accc0f626f3d5b8d9000", "activities": ["act::o", "act::c"], "timeframe": { "type": "today" } }

Learn more about the timeframe.

NOTE: The rate limit for this endpoint is 1 request per second.


Valid request body elements

The following table lists all valid, optional request body elements (arrays, objects, or fields), which are available to this endpoint.

Element

Type

Description

person_id

string

A string identifying the person by their unique ID number.

activities

array

The activities array can contain multiple activity IDs, separated by commas, enabling you to specify which activities to return. Learn how to find the activity IDs.

limit

integer

The limit value determines the number of activities to be returned by Ortto from the request. Both the default and maximum values are 40.

This value also represents the "page" length of activities (for pagination purposes). This element can be used in conjunction with offset to retrieve subsequent pages of activity records. If this limit element is not specified in the request, or an integer value beyond the permitted maximum is specified, then this value is assumed to be 50.

offset

integer

The offset element represents the count of activities in your Ortto account’s CDP for pagination purposes, and is the point from which the next page of activities (defined by the limit member value) is retrieved. The offset value determines how many of the first activities will be skipped in the response


Timeframe

The timeframe values listed in the table are for optionally use when creating a request to retrieve an activity feed.

Timeframe value

Description

last-24-hours

Returns data for the previous 24 hours

For example: 1 January 2024, 14:00:00 – 2 January 2024, 14:00:00

last-48-hours

Returns data for the previous 48 hours

For example: 1 January 2024, 14:00:00 – 3 January 2024, 14:00:00

last-7-days

Returns data for the previous 7 days

For example: 1 January 2024, 14:00:00 – 7 January 2024, 14:00:00

last-14-days

Returns data for the previous 14 days

For example: 1 January 2024, 14:00:00 – 14 January 2024, 14:00:00

last-30-days

Returns data for the previous 30 days

For example: 1 January 2024, 14:00:00 – 30 January 2024, 14:00:00

last-90-days

Returns data for the previous 90 days

For example: 3 October 2023, 14:00:00 – 1 January 2024, 14:00:00

today

Returns data for the current day, beginning at 00:00:00 until the time the report is generated.

For example: 1 January 2024, 00:00:00 – 1 January 2024, 14:00:00

yesterday

Returns data for the previous day, from 00:00:00 – 23:59:59

For example: for a report generated on 1 January 2024, the report will return data for 31 December 2023.

this-week

Returns data for the current week, beginning 00:00:00 Monday and ending 23:59:59 Sunday.

last-week

Returns data for the previous week, beginning 00:00:00 Monday and ending 23:59:59 Sunday.

this-month

Returns data for the current calendar month, beginning 00:00:00 on the first day of the month and ending 23:59:59 on the last day of the month.

For example: 1 January 2024, 00:00:00 – 31 January 2024, 23:59:59

last-month

Returns data for the previous calendar month, beginning 00:00:00 on the first day of the month and ending 23:59:59 on the last day of the month.

For example: for a report generated on 1 January 2024, the report will return data for 1 December 2023 – 31 December 2023

this-quarter

Returns data for the current calendar quarter, beginning 00:00:00 on the first day of the quarter and ending 23:59:59 on the last day of the quarter.

That is: start of January to end of March (Q1), start of April to end of June (Q2), start of July to end of September (Q3), and start of October to end of December (Q4).

last-quarter

Returns data for the previous calendar quarter, beginning 00:00:00 on the first day of the quarter and ending 23:59:59 on the last day of the quarter.

That is: start of January to end of March (Q1), start of April to end of June (Q2), start of July to end of September (Q3), and start of October to end of December (Q4).

this-year

Returns data for the current calendar year, beginning 00:00:00 on January 1 until the time the report is generated.

last-year

Returns data for the previous calendar year, beginning 00:00:00 on January 1 until 23:59:59 on December 31

For example: for a report generated on 1 January 2024, the report will return data for 1 January 2023 – 31 December 2023

all

Returns data for the whole lifetime of the campaign


Response payload

The following JSON object is an example of two activities that Ortto retrieves from your Ortto account’s CDP after a request to this endpoint.

NOTE: The response will vary depending on the activity you request, as we return attributes and data specific to each activity.

Example retrieve activities response payload from Ortto’s CDP

json

{ "activities": [ { "id": "00670cf62284ab8e856b0a09", "attr": { "idt::c": "670cf5ea2184750fe6832650", "idt::ei": "670cf5ea43a4cce7d66eb19a", "idt::mi": "10670cf6115e51fca84cfffe", "obj::i": "129e1081", "str::asn": "Introducing new collection", "str::b": "Chrome", "str::burl": "https://www.ortto.com", "str::bv": "Chrome 1", "str::c": "https://www.ortto.com?utm_campaign=introducing-new-collection&utm_content=introducing-new-collection&utm_medium=email&utm_source=ortto", "str::cn": "Introducing new collection", "str::ct": "email", "str::d": "Desktop", "str::p": "Mac", "str::pv": "Mac 10.15", "str::rc": "https://www.ortto.com", "str::s": "Hi John, check out our new collection!", "str::t": "Europe/Lisbon", "str::uc": "introducing-new-collection", "str::um": "email", "str::un": "introducing-new-collection", "str::us": "ortto" }, "created_at": "2024-10-14T10:44:50Z", "field_id": "act::c" }, { "id": "00670cf6205e51fca84cfffe", "attr": { "idt::c": "670cf5ea2184750fe6832650", "idt::ei": "670cf5ea43a4cce7d66eb19a", "idt::mi": "10670cf6115e51fca84cfffe", "str::asn": "Introducing new collection", "str::cn": "Introducing new collection", "str::ct": "email", "str::s": "Hi John, check out our new collection!" }, "created_at": "2024-10-14T10:44:48Z", "field_id": "act::o" } ], "meta": { "total_activities": 2, "field_ids": [ "act::o", "act::c" ], "has_more": false, "retention": { "type": "time", "max_value": 90 } }, "offset": 0, "next_offset": 2 }

How to find activity IDs

To find the activity ID(s) for the activities array, follow these steps:

  1. Navigate to CDP > Activities.
  2. Click on the activity you want to retrieve the ID for.
  3. Copy the activity ID from the URL.
Finding the activity ID in the URL.