Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents:

Table of Contents
minLevel2


(info) 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. 

Methods Summary


Info

 This API controller is for creating and retrieving the Custom Aggregate Report

...

  1. Create New Custom Aggregate Report - using "POST api/aggregate_activity" You need to set a title for this new search, and the filters used for contacts segmentation.

  2. Check the report status - Check the contact search status using "GET api/aggregate_activity/{Aggregate activity report ID}" When Aggregate activity is created, its always created in status "Pending" (1), in order to know when the aggregate activity is ready, use this method and verify that the status is "Completed" (2).

  3. Retrieve the report - When status is Complete, use this method "GET /api/aggregate_activity/<Aggregate Activity search ID>/export" to export the report.

GET /api/aggregate_activity/<Aggregate Activity search ID>

Description 

This method fetches a custom aggregate search (without results). This method is used for checking the custom aggregate search status.

Response (Major fields)

KeyDescription
statusContact search status, 1 = Pending, 2 = Completed
status_descContact search status description (Pending / Completed)

GET /api/aggregate_activity/<Aggregate Activity search ID>/export

Description 

This method exports a custom aggregate activity report in CSV format, just like in the UI of the platform.

GET /api/aggregate_activity

Description 

This method fetches a collection of custom aggregate activity reports (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/aggregate_activity

Description 

This method creates a new custom aggregate activity report.

Request

title

Required string - Title for this aggregate activity

...

*condition : String - Condition for whole criteria (and/or)

Operator options 

For strings/emails

* = : Equals

...

* empty : Is empty

* notempty : Is not empty

Request Example - Getting all aggregate activity for Gmail contacts

POST URL: https://api.ongage.net/<list_id>/api/aggregate_activity

Code Block
{
 "title": "Active gmail contacts",
 "selected_fields": [ "sent", "opens", "clicks", "unsubscribes", "complaints" ],
 "group_fields": [ "email" ],
 "filters": {
   "criteria": [
      {
        "type": "email",
        "field_name": "email",
        "operator": "_LIKE",
        "operand": [
          "gmail.com"
        ],
        "case_sensitive": 0,
        "condition": "and"
      }
   ],
   "user_type":"active"
 }
}

Request Example - Getting all contacts created before 01/01/2014 GMT+2

POST URL: https://api.ongage.net/<list_id>/api/aggregate_activity/api/aggregate_activity

Code Block
{
 "title": "Contacts created before 2014",
 "selected_fields": [ "sent", "opens" ],
 "group_fields": [ "product_id" ],
 "filters": {
   "criteria": [
      {
        "type": "date_absolute",
        "field_id": "ocx_created_date",
        "operator": "<",
        "operand": [ 1388527200 ],
        "case_sensitive": 0,
        "condition": "and"
      }
   ],
   "user_type":"active"
 }
}

Response (Major fields)

KeyDescription
idNewly created aggregate activity report ID
statusAggregate activity report status, will always be 1 (Pending) in this response

DELETE /api/aggregate_activity/<Aggregate Activity report ID>

Description 

This method deletes a aggregate activity report.

...