Get Web Push Overall Metrics Analytics
  • 05 Mar 2024
  • 2 Minutes to read

    Get Web Push Overall Metrics Analytics


      Article Summary

      Overview

      Insider's web push API allows you to get the campaigns analytics of your web push notifications from your own back-end without using the Insider's InOne panel. This API returns overall metric analytics with campaign information in the given time interval in API request payload. It corresponds to the data displayed below.

      Endpoints and Headers

      POST https://web-push.api.useinsider.com/v1/statistics/overall-metrics

      Headers

      HeaderSample ValueDescription
      AuthorizationBearer 1a2b3c4d5e6fThis key is required to authorize your request. Refer to API Authentication Tokens to generate your token.
      Content-Typeapplication/jsonThis header specifies the media type of the resource.

      Body Parameters

      ParameterDescriptionData TypeRequired
      partner_idThis is your partner identification number, available from InOne Settings > Account Preferences.StringYes
      start_dateThis 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.StringYes
      end_dateThis specifies the date on which you will stop requesting campaign analytics. The date format should be YYYY-MM-DD.StringYes
      pageSpecifies the number of campaigns to be listed per page. Default value is 1.StringNo
      per_pageSpecifies the number of pages of campaign campaigns. Default value is 10.StringNo

      Sample Example

      Sample Request

      Before sending the request, make sure:

      • To replace the authorization value with your own API key.
      • To replace the sample values in partner_id, start_date, and end_date with your own 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": "In Stock Alert",
                  "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 Key should be provided as the authorization key on 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. 

      Was this article helpful?

      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses