Skip to content

Latest commit

 

History

History
104 lines (77 loc) · 4.31 KB

File metadata and controls

104 lines (77 loc) · 4.31 KB

StatsAffiliateApi

All URIs are relative to https://up.go-adserver.com

Method HTTP request Description
apiV1PublisherOffersStatsGet GET /api/v1/publisher/offers/stats Affiliate / smartlink offer performance — publisher side.

apiV1PublisherOffersStatsGet

StatsResponse apiV1PublisherOffersStatsGet(from, to, interval, groupBy, metrics, format, page, perPage, sort)

Affiliate / smartlink offer performance — publisher side.

group_by: `offer`, `country`, `device`, `os`, `browser`, `domain`, `subid`, `website`, `adzone`, `sid1`, `sid2`, `sid3`, `sid4`, `sid5`. Metrics: `clicks`, `conversions`, `cr`, `epc`, `earned`, `conv_a`, `conv_b`, `conv_c`.

Example

import {
  Configuration,
  StatsAffiliateApi,
} from 'goadserver-sdk';
import type { ApiV1PublisherOffersStatsGetRequest } 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 StatsAffiliateApi(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 ApiV1PublisherOffersStatsGetRequest;

  try {
    const data = await api.apiV1PublisherOffersStatsGet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Parameters

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]

Return type

StatsResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Stats response -

[Back to top] [Back to API list] [Back to Model list] [Back to README]