Overview
This API gives partners the power to access 24-hour detailed insights into their accounts in a way that’s easy to use and understand. Here’s how it helps:
- Retrieve performance reports: Access performance reports that include key metrics such as revenue, impressions, clicks, and click-through rate (CTR) for a specified date.
- Customize data segmentation: Choose between daily or hourly segmentation options to analyze activity based on specific time intervals.
- Apply filters: Use optional parameters to filter data based on properties passed in the payload when a MomentScience experience was served. This enables publishers to focus on specific segments of their activity data.
Quickstart
- Obtain your API Key.
- Make a Fetch Reporting API call to MomentScience to retrieve statistics related to your account.
- Parse the response and display statistics in the desired fashion.
Try It Out
Send a live request and see the response. Paste an API key with the Reports permission into api_key in the console below and click Try it. The result shows in the Responses panel on the right.
Fetch Activity Report
GET https://api.adspostx.com/native/activity.json
Returns clicks, revenue, impressions (Views in the dashboard), RPM and CTR for your account. Paste an API key with the Reports permission into api_key, set from and aggregated_by if you like, then click Try it.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key |
string |
Yes | Your API Key. Required Permission: Reports |
from |
string |
No | Specify the date (YYYY-MM-DD format) for which you want to retrieve reports. It will retrieve data for only 24 hours starting from the specified date’s beginning.Default: Yesterday’s Date (beginning of the day) |
aggregated_by |
string |
No | Choose between ‘day’ or ‘hour’ to segment activity on a daily or hourly basis. Default: ‘day’. |
Header Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Content-Type |
string |
Yes | Should be application/json |
Request Examples
curl --request GET \
--url 'https://api.adspostx.com/native/activity.json?api_key=YOUR_API_KEY&from=2024-03-20&aggregated_by=hour' \
--header 'Content-Type: application/json'Sample Responses
{
"data": {
"activity": [
{
"clicks": 1,
"revenue": 0.02,
"date": "2024-03-20T00:00:00+05:30",
"impressions": 56,
"rpm": 0.36,
"ctr": 1.79
}
]
},
"status": "success"
}Fetching Performance Reports
HTTP Method: GET Base URL: https://api.adspostx.com/native/activity.json
Header Parameters
| Parameter | Description | Type | Example |
|---|---|---|---|
| Content-Type required |
Should be application/json |
string | application/json |
Query Parameters
| Parameter | Description | Type | Example |
|---|---|---|---|
| api_key required |
Your API Key. Obtain your API Key. **Required Permission: **Reports |
String | 4bbdefc2-b130-424d-8170-54bdcb98e64e |
| from Optional |
Specify the date (YYYY-MM-DD format) for which you want to retrieve reports. - It will retrieve data for only 24 hours starting from the specified date’s beginning. **Default: **Yesterday’s Date (beginning of the day) |
String | 2024-03-20 |
| aggregated_by Optional |
Choose between ‘day’ or ‘hour’ to segment activity on a daily or hourly basis. Default: ‘day’. |
String | hour |
| <string> Optional |
Filters data based on specific properties passed in the payload during a MomentScience experience. For example, filtering by “companyId” with a value of “123” and “state” with a value of “approved” retrieves activities for sessions with companyId equal to “123” and state equal to “approved”. | String | state=approved |
Request Example
curl --request GET \
--url 'https://api.adspostx.com/native/activity.json?api_key=YOUR_API_KEY&from=2024-03-20&aggregated_by=hour' \
--header 'Content-Type: application/json'Response Body
Response Parameters
Upon making an API call, the following attributes are returned.
***data **object of *activity data
Contains the activity array and response status
**clicks **integer
This simply counts how many times customers interact with an Offer. This could be by clicking on a button, image, or even directly accessing an Offer link in their browser.
**revenue **double
The revenue generated through customer engagement with MomentScience Offers.
**impressions **integer
Counts the number of times the MomentScience Offer Unit was loaded. This corresponds to Views in the Partner Dashboard.
**rpm **double
Revenue earned per 1,000 unit loads. Formula: (revenue / impressions) x 1000, where impressions is the field above that matches Views in the Partner Dashboard.
ctr double
Click-through rate as a percentage: clicks divided by offer level impressions (shown as Impressions in the Partner Dashboard), times 100. It is not based on the impressions field above.
**date **date
This field indicates the date and time when the Offer session started, presented in the format: “YYYY-MM-DDTHH:MM:SS+HH:MM”.
- For daily granularity: the date would represent the start of a day, such as “2024-03-20T00:00:00+05:30”. In this case, it shows the date with no specific time, indicating the entire day’s offer session.
- For hourly granularity: the date would include the specific hour and minute when the offer session began, such as “2024-03-20T15:30:00+05:30”. Here, the date includes both the date and the exact time when the offer session started.
Sample Response
{
"data": {
"activity": [
{
"clicks": 1,
"revenue": 0.02,
"date": "2024-03-20T00:00:00+05:30",
"impressions": 56,
"rpm": 0.36,
"ctr": 1.79
}
]
},
"status": "success"
}{
"data": {
"activity": [
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T00:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T01:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T02:00:00+05:30",
"impressions": 2,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T03:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T04:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T05:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T06:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T07:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T08:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T09:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T10:00:00+05:30",
"impressions": 5,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T11:00:00+05:30",
"impressions": 23,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T12:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T13:00:00+05:30",
"impressions": 1,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T14:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T15:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T16:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T17:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T18:00:00+05:30",
"impressions": 4,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T19:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T20:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T21:00:00+05:30",
"impressions": 0,
"rpm": 0,
"ctr": 0
},
{
"clicks": 1,
"revenue": 0.02,
"date": "2024-03-20T22:00:00+05:30",
"impressions": 19,
"rpm": 1.05,
"ctr": 5.26
},
{
"clicks": 0,
"revenue": 0,
"date": "2024-03-20T23:00:00+05:30",
"impressions": 2,
"rpm": 0,
"ctr": 0
}
]
},
"status": "success"
}📢 If you’re running into any issues while going through the integration process, feel free to contact us at help@momentscience.com