Insider One's Web Push API allows you to get the campaign analytics of your Web Push notifications from your back-end. This API returns analytics specific to a single campaign in the given time interval in the API request payload.
Endpoint and Headers
POST https://web-push.api.useinsider.com/v1/statistics/campaign-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 |
| campaign_id | This is your campaign ID. It returns in the response and is needed to send push notifications. | String | Yes |
Sample Request
The sample below displays a request to fetch campaign 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, end_date, and campaign_id with your values in the required data type.
- For the campaign_id, use the builder_id found in the overall metrics API response. If you can check the campaign via the InOne panel, you can see the ID from the Web Push campaign link.
curl --location --POST 'https://web-push.api.useinsider.com/v1/statistics/campaign-metrics' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1a2b3c4d5e6f' \
--data '{
"partner_id": "YOURPARTNERID",
"start_date" : "2023-06-01",
"end_date" : "2023-06-08",
"campaign_id" : "11111"
}'Sample Responses
200 OK
{
"success": true,
"message": "",
"name": "The campaign",
"statusName": "completed",
"status": 1,
"workingStatus": 3,
"sendType": 0,
"primaryGoal": "salesFromClick",
"startDate": "2023-10-31T21:00:00.000000Z",
"endDate": "2023-11-30T20:59:59.999999Z",
"isRecurring": false,
"alias": "single",
"preferredCurrency": "TRY",
"personalizationStatus": "Active",
"isTTLEnded": true,
"goalMenu": {
"camp-join": "Clicks",
"sales-from-click": "Purchases From Click..."
},
"overview": {
"total": {
"targeted": "1",
"deliveryRate": "100.00%",
"ctr": "0.00%",
"conversionRate": "0.00%"
},
"targeted": {
"sent": "1",
"dropped": "0"
},
"deliveryRate": {
"delivered": "1",
"undelivered": "0"
},
"ctr": {
"clicks": "0"
},
"conversionRate": {
"conversions": "0"
},
"revenue": "0 TRY"
},
"deviceMetrics": [
{
"device": "Desktop",
"sent": "1",
"delivered": "1",
"deliveryRate": "100.00%",
"clicks": "0",
"ctr": "0.00%",
"conversions": "0",
"conversionRate": "0.00%",
"revenue": "0 TRY"
},
{
"device": "Mobile",
"sent": "0",
"delivered": "0",
"deliveryRate": "0.00%",
"clicks": "0",
"ctr": "0.00%",
"conversions": "0",
"conversionRate": "0.00%",
"revenue": "0 TRY"
}
],
"unsuccessfulMessages": {
"dropped": [
{
"label": "frequencyCapped",
"count": "0",
"percentage": 0
},
{
"label": "unsubscriptions",
"count": "0",
"percentage": 0
},
{
"label": "serviceProviderErrors",
"count": "0",
"percentage": 0
},
{
"label": "internalErrors",
"count": "0",
"percentage": 0
}
],
"undelivered": [
{
"label": "offlineRecipients",
"count": "0",
"percentage": 0
},
{
"label": "other",
"count": "0",
"percentage": 0
}
]
},
"comparisonData": []
}Your title goes here
You can refer to Web Push Campaign Level Analytics Metrics for further information.
401 Unauthorized
{
"message": "Unauthorized"
}424 Failed Dependency
{
"message": "SERVICE:-Campaign not found"
}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 Key should 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 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.