All URIs are relative to https://up.go-adserver.com
| Method | HTTP request | Description |
|---|---|---|
| apiV1PublisherSspStatsGet | GET /api/v1/publisher/ssp/stats | SSP / smart-campaign earnings. |
StatsResponse apiV1PublisherSspStatsGet(from, to, interval, groupBy, metrics, format, page, perPage, sort)
SSP / smart-campaign earnings.
group_by: `campaign`, `country`, `website`, `adzone`, `network`. Metrics: `requests`, `wins`, `views`, `clicks`, `ctr`, `ecpm`, `earned`, `errors`. Scoping (priority order): - `filter[feed_id]=<hash>` β the SSP feed hash from the campaign row (the same identifier you give to ad networks). Limits results to one campaign without needing the internal numeric ID. - `filter[campaign_id]=<id>` β internal numeric ID. - (default) every SSP campaign owned by the caller, optionally narrowed with `filter[ssptype]`.
import {
Configuration,
StatsPublisherSSPApi,
} from 'goadserver-sdk';
import type { ApiV1PublisherSspStatsGetRequest } from 'goadserver-sdk';
async function example() {
console.log("π Testing goadserver-sdk SDK...");
const config = new Configuration({
// Configure HTTP bearer authorization: apiKey
accessToken: "YOUR BEARER TOKEN",
});
const api = new StatsPublisherSSPApi(config);
const body = {
// Date | ISO date β inclusive start. Defaults to 7 days ago. (optional)
from: 2013-10-20,
// Date | ISO date β inclusive end. Defaults to today. Max range 92 days. (optional)
to: 2013-10-20,
// 'day' | 'hour' | 'week' | 'month' | 'sum' (optional)
interval: interval_example,
// string | Comma-separated dimensions to aggregate by, in priority order. Max 4 dimensions. Available dimensions vary per endpoint β see the per-endpoint description. (optional)
groupBy: groupBy_example,
// string | Optional comma-separated metric whitelist. When omitted, all metrics for the endpoint are returned. (optional)
metrics: metrics_example,
// 'json' | 'csv' (optional)
format: format_example,
// number (optional)
page: 56,
// number (optional)
perPage: 56,
// string | Field name. Prefix with `-` for descending (e.g. `-views`). (optional)
sort: sort_example,
} satisfies ApiV1PublisherSspStatsGetRequest;
try {
const data = await api.apiV1PublisherSspStatsGet(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);| Name | Type | Description | Notes |
|---|---|---|---|
| from | Date |
ISO date β inclusive start. Defaults to 7 days ago. | [Optional] [Defaults to undefined] |
| to | Date |
ISO date β inclusive end. Defaults to today. Max range 92 days. | [Optional] [Defaults to undefined] |
| interval | day, hour, week, month, sum |
[Optional] [Defaults to 'sum'] [Enum: day, hour, week, month, sum] |
|
| groupBy | string |
Comma-separated dimensions to aggregate by, in priority order. Max 4 dimensions. Available dimensions vary per endpoint β see the per-endpoint description. | [Optional] [Defaults to undefined] |
| metrics | string |
Optional comma-separated metric whitelist. When omitted, all metrics for the endpoint are returned. | [Optional] [Defaults to undefined] |
| format | json, csv |
[Optional] [Defaults to 'json'] [Enum: json, csv] |
|
| page | number |
[Optional] [Defaults to 1] |
|
| perPage | number |
[Optional] [Defaults to 100] |
|
| sort | string |
Field name. Prefix with `-` for descending (e.g. `-views`). | [Optional] [Defaults to undefined] |
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Stats response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]