Report API

Endpoints

Base URL: https://developers.insticator.com

GET /api/v1/reports/list

Retrieve a list of reports created for an account. For the accountId value, please reach out to the account manager. They should be able to provide it. To generate the authorization header value, visit the developer tools page in the Publisher Portal. Please note that the Authorization header and accountId are required for all requests.

Headers:

KeyTypeRequiredDescription
authorizationStringYesUnique user key

Request Body:

KeyTypeRequiredDescription
accountIdStringYesUnique publisher account ID

Response:

A list of reports, please see sample report response below.

Errors:

Status CodeMessage
404Not found!
401Authorization header missing!
401Invalid account ID!
500Internal Server Error

GET /api/v1/report/:reportUUID

Retrieve the status of a specific report. For instance, /api/v1/report/41e1c183-4431-4dec-a090-54e6784ceb84

Headers:

KeyTypeRequiredDescription
authorizationStringYesUnique user key

URL Parameters:

KeyTypeRequiredDescription
reportUUIDStringYesUnique report ID

Request Body:

KeyTypeRequiredDescription
accountIdStringYesUnique publisher account ID

Sample Response:

{
  "reportUUID": "41e1c183-4431-4dec-a090-54e6784ceb84",
  "accountUUID": "01905b65-fbfc-7792-9664-b37992d12747",
  "name": "Report Name",
  "dateRange": "CUSTOM",
  "from": "2024-02-13",
  "to": "2024-02-19",
  "dimensions": [
    "DATE"
  ],
  "metrics": [
    "NET_REVENUE"
  ],
  "filters": {
    "DEVICE": [
      "DESKTOP"
    ]
  },
  "schedule": {
    "frequency": "ONCE",
    "format": "CSV",
    "recipientEmails": ["[email protected]"]
  },
  "createdAt": 1719511328000,
  "reportStatus": "Ready"
}

Errors:

Status CodeMessage
500Not found!
401Authorization header missing!
401Invalid account ID!

POST /api/v1/report

Generate a new report.

Headers:

KeyTypeRequiredDescription
authorizationStringYesUnique user key

Request Body:

KeyTypeRequiredDescription
accountIdStringYesUnique publisher account ID
nameStringYesName of the report(It must always be unique)
dateRangeStringYesInterval for which the report is generated
YESTERDAY,LAST_SEVEN_DAYS,LAST_THIRTY_DAYS,LAST_WEEK,LAST_MONTH,CUSTOM
fromDateNoStart date of the interval, e.g) 2024-05-05
toDateNoEnd date of the interval, e.g) 2024-05-07
dimensionsArrayYesArray of dimensions, DATE,YEAR,WEEK,MONTH,QUARTER,PRODUCT_TYPE,SITE
metricsArrayYesMetrics for the report. Possible values are,
NET_REVENUE,TOTAL_IMPRESSIONS,MONETIZABLE_PAGE_VIEW,AVG_RPM,VIEWABILITY,
BID_RATE,WIN_RATE,AD_REQUEST
filtersObjectYesFilters based on GEO, and DEVICE
Possible values
Geo: ANSI country code, e.g. US, CA, UK
Device: MOBILE, DESKTOP
scheduleObjectYesScheduling details (frequency, format, recipientEmails)
Possible values
Frequency: ONCE,DAILY,WEEKLY,MONTHLY
Format: CSV, XLSX
Recipient Emails: email address in String

Errors:

Status CodeMessage
500Internal Server Error
401Authorization header missing!
401Invalid account ID!

GET /api/v1/report/:reportUUID/download

Download a generated report.

Headers:

KeyTypeRequiredDescription
authorizationStringYesUnique user key

URL Parameters:

KeyTypeRequiredDescription
reportUUIDStringYesUnique report ID

Request Body:

KeyTypeRequiredDescription
accountIdStringYesUnique publisher account ID

Response:

CSV, XLSX file of the report.

Errors:

Status CodeMessage
500No report record found!
500No report file found!
401Authorization header missing!
401Invalid account ID!
500Failed to generate report!

DELETE /api/v1/report/:reportUUID

Delete a specific report.

Headers:

KeyTypeRequiredDescription
authorizationStringYesUnique user key

URL Parameters:

KeyTypeRequiredDescription
reportUUIDStringYesUnique report ID

Request Body:

KeyTypeRequiredDescription
accountIdStringYesUnique publisher account ID

Response:

Status CodeMessage
200Report has been deleted successfully.

Errors:

Status CodeMessage
500Report not found!
401Authorization header missing!
401Invalid account ID!
500Internal Server Error

Sample Requests

Retrieving a list of reports under an account

curl --location --request GET 'https://developers.insticator.com/api/v1/reports/list' \
--header 'authorization: <api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "accountId": "<account_id>"
}'

Retrieving a report

curl --location --request GET 'https://developers.insticator.com/api/v1/report/<reportUUID>' \
--header 'authorization: <api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "accountId": "<account_id>"
}'

Generate a new report

curl --location 'https://developers.insticator.com/api/v1/report' \
--header 'authorization: <api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "accountId": "<account_id>",
    "name": "report_name",
    "dateRange": "YESTERDAY",
    "dimensions": [
        "DATE",
        "WEEK",
        "MONTH",
        "PRODUCT_TYPE"
    ],
    "metrics": [
        "NET_REVENUE",
        "TOTAL_IMPRESSIONS"
    ],
    "filters": {
        "GEO": [
            "US"
        ]
    },
    "schedule": {
        "frequency": "ONCE",
        "format": "CSV",
        "recipientEmails": [
            "[email protected]"
        ]
    }
}'

Downloading a report

curl --location --request GET 'https://developers.insticator.com/api/v1/report/<reportUUID>/download' \
--header 'authorization: <api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "accountId": "<account_id>"
}'

Deleting a report

curl --location --request DELETE 'https://developers.insticator.com/api/v1/report/<reportUUID>' \
--header 'authorization: <api_key>' \
--header 'Content-Type: application/json' \
--data '{
    "accountId": "<account_id>"
}'