Table Table of Contents:
Table of Contents minLevel 2
Note: Notice that in each API call you must provide the List ID that you are working on, otherwise the default List ID will be used. You can review the possible ways to provide List ID in this link.
Methods Summary
This API controller is for issuing and retrieving asynchronous contact activity reports.
In order to use this asynchronous flow, these methods should be used in the following order:
Create a new contact activity report: using POST api/contact_activity.
Check the report status: Check the contact search status using "GET api/contact_activity/{Contact activity report ID}" When contact activity is created, its always created in status "Pending" (1), in order to know when the contact activity is ready, use this method and verify that the status is "Completed" (2).
Retrieve the report in one of the following options:
The Export Combined Detailed Report CSV: GET /api/contact_activity/<Contact Activity search ID>/export_detailed
- CSV of Aggregated Contact Activity Report: GET /api/contact_activity/<Contact Activity search ID>/export.JSON Array of the report: using
GET /api/contact_activity/<Contact Activity search ID>
...
GET /api/contact_activity/<Contact Activity search ID>
Description
...
Description
This method fetches a contact activity search (without results). This method can be used for checking the contact activity status.
...
Key | Description |
---|---|
status | Contact activity status, 1 = Pending, 2 = Completed |
status_desc | Contact activity report status description (Pending / Completed) |
GET /api/contact_activity/<Contact Activity search ID>/result
Description
This method fetches the contact activity results. This is the same report you see in the UI under Analytics -> Contact Activity Report, when you click on the "View Report" icon. This API command provides the same results as the export below, only in this case, it returns the entire result as a JSON response instead of CSV file.
Request
sort
Optional string - Sort by column name
order
Optional string - "ASC" or "DESC"
offset
Optional int
limit
Optional int
Response
GET URL: https://api.ongage.net/<list_id>/api/contact_activity/<contact_activity_search_id>/result
The response includes Array of contacts similar to example shared below.
Code Block |
---|
{
"metadata": {
"error": false,
"fields": {},
"total": 3
},
"payload": [
{
"email": "email1@gmail.com",
"last_name": "some-name",
"opens": 4,
"clicks": 2,
"unsubscribe":0,
"complains":0
},
{
"email": "email2@gmail.com",
"last_name": "some-name2",
"opens": 3,
"clicks": 1,
"unsubscribe":0,
"complains":1
},
{
"email": "email3@gmail.com",
"last_name": "some-name3",
"opens": 1,
"clicks": 0,
"unsubscribe":1,
"complains":1
}
]
} |
Error Codes
...
) |
GET /api/contact_activity/<Contact Activity search ID>/export
Description
This method retrieves the CSV of the aggregated contact activity report, just like the export CSV in the UI does:
GET /api/contact_activity/<Contact Activity search ID>/export_detailed
Description
This method retrieves the CSV of the Export Combined Detailed Report.
Just like this button in the UI does:
GET /api/contact_activity
Description
This method fetches a collection of contact activity (without the results).
Request
list_id
Optional string - List ID (see "Indicating List ID in Ongage API Calls" in APIDocs homepage for more info)
...
Optional int
limit
Optional int
POST /api/contact_activity
Description
This method creates a new contact activity report.
Request
title
Required string - Title for this contact activity
...
Key | Description |
---|---|
id | Newly created contact activity report ID |
status | Contact activity report status, will always be 1 (Pending) in this response |
DELETE /api/contact_activity/<Contact Activity report ID>
Description
This method deletes a aggregate activity report.
Additional Examples
Request Example - Getting Contact Activity for a Segment for 1 month
...