Insider One's Web Push API allows you to get the campaign analytics of your Web Push notifications from your back-end without using the Insider One's InOne panel. This API returns overall metric analytics with campaign information in the API request payload at the given time interval. It corresponds to the data displayed below, as seen on the Web Push Analytics page:
Endpoint and Headers
POST https://web-push.api.useinsider.com/v1/statistics/overall-metrics
Visit our Postman collection to test this request.
Headers
| Header | Sample Value | Description |
|---|---|---|
| Authorization | Bearer 1a2b3c4d5e6f | This key is required to authorize your request. Refer to API Authentication Tokens to generate your token. |
| Content-Type | application/json | This header specifies the media type of the resource. |
Body Parameters
| Parameter | Description | Data Type | Required |
|---|---|---|---|
| partner_id | This is your partner identification number, available from Inone Settings > Account Settings. | String | Yes |
| start_date | This specifies the date on which you will start requesting campaign analytics. The date format should be YYYY-MM-DD. The Start Date cannot be earlier than the Campaign Create Date. | String | Yes |
| end_date | This specifies the date on which you will stop requesting campaign analytics. The date format should be YYYY-MM-DD. | String | Yes |
| page | Specifies the number of campaigns to be listed per page. The default value is 1. | String | No |
| per_page | Specifies the number of campaign pages. The default value is 10. | String | No |
Sample Request
The sample below displays a request to fetch overall metrics statistics for Web Push campaigns within a specific date range.
Before sending the request, make sure:
- To replace the authorization value with your API key.
- To replace the sample values in partner_id, start_date, and end_date with your values in the required data type.
curl --location --POST 'https://web-push.api.useinsider.com/v1/statistics/overall-metrics' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1a2b3c4d5e6f' \
--data '{
"partner_id": "YOURPARTNERID",
"start_date": "2023-12-02",
"end_date": "2023-12-19"
"page": 1,
"per_page": 10
}'Sample Responses
200 OK
{
"page": 1,
"per_page": 10,
"total": 65,
"data": [
{
"id": 16311,
"tags": [],
"groupLevels": [],
"type": "Back In Stock",
"campName": "In Stock",
"status": 1,
"workingStatus": 3,
"sendType": 0,
"statusName": "completed",
"builderId": 8893,
"sendDate": "-",
"startDate": "2023-09-15 18:23:00",
"endDate": "2023-09-15 18:26:00",
"daysActive": 1,
"messageLink": "",
"firstButtonLink": "{}",
"secondButtonLink": "N/A",
"targeted": 0,
"sent": 0,
"dropped": 0,
"deliveryRate": 0,
"delivered": 0,
"undelivered": 0,
"ctr": 0,
"clicks": 0,
"conversions": 0,
"conversionRate": 0,
"revenue": 0
},
{
"id": 16304,
"tags": [
"Bulk"
],
"groupLevels": [],
"type": "Single",
"campName": "the new campaign",
"status": 1,
"workingStatus": 3,
"sendType": 0,
"statusName": "completed",
"builderId": 8889,
"sendDate": "2023-09-15 18:08:27",
"startDate": "2023-09-15 18:08:00",
"endDate": "2023-09-15 18:08:00",
"daysActive": 1,
"messageLink": "https://mywebsite.com/?the-new-campaign",
"firstButtonLink": "N/A",
"secondButtonLink": "N/A",
"targeted": 778514,
"sent": 0,
"dropped": 778514,
"deliveryRate": 0,
"delivered": 0,
"undelivered": 0,
"ctr": 0,
"clicks": 0,
"conversionRate": 0,
"conversions": 0,
"revenue": 0
},
{
"id": 16279,
"tags": [
"Bulk"
],
"groupLevels": [],
"type": "Single",
"campName": "the campaign",
"status": 1,
"workingStatus": 3,
"sendType": 2,
"statusName": "completed",
"builderId": 8877,
"sendDate": "2023-09-15 17:32:00",
"startDate": "2023-09-15 17:32:00",
"endDate": "2023-10-01 17:32:00",
"daysActive": 17,
"messageLink": "https://mywebsite.inone.useinsider.com/web-push/bulk/8877/design",
"firstButtonLink": "N/A",
"secondButtonLink": "N/A",
"targeted": 0,
"sent": 0,
"dropped": 0,
"deliveryRate": 0,
"delivered": 0,
"undelivered": 0,
"ctr": 0,
"clicks": 0,
"conversions": 0,
"conversionRate": 0,
"revenue": 0
}
]
}401 Unauthorized
{
"message": "Unauthorized"
}424 Failed Dependency
{
"message": "SERVICE:-"
}Error Codes
- 400 Bad request
- 401 Unauthorized request
- 424 Failed Dependency
- 429 Request limit exceeded
Limitations
- All functions must be executed with an HTTPS POST request.
- The API Keyshould be provided as the authorization key in the request header. If the key is incorrect, the operation will not be executed, and an authorization error will return in the response.
- You can make 30 requests per minute in aggregate.
- The maximum limit for the per_page parameter is 20.
The default limit shown here is a standard baseline. If your use case requires higher capacity, feel free to reach out to the Insider One team — we can adjust it to fit your needs.