Skip to content

Latest commit

 

History

History
155 lines (107 loc) · 3.6 KB

File metadata and controls

155 lines (107 loc) · 3.6 KB

AdspacesApi

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

Method HTTP request Description
apiV1AdspacesGet GET /api/v1/adspaces List ad zones owned by the caller.
apiV1AdspacesIdGet GET /api/v1/adspaces/{id} Get a single adspace.

apiV1AdspacesGet

ApiV1AdspacesGet200Response apiV1AdspacesGet(siteId, page, perPage)

List ad zones owned by the caller.

Example

import {
  Configuration,
  AdspacesApi,
} from 'goadserver-sdk';
import type { ApiV1AdspacesGetRequest } 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 AdspacesApi(config);

  const body = {
    // number | Filter to one site. (optional)
    siteId: 56,
    // number (optional)
    page: 56,
    // number (optional)
    perPage: 56,
  } satisfies ApiV1AdspacesGetRequest;

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

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

Parameters

Name Type Description Notes
siteId number Filter to one site. [Optional] [Defaults to undefined]
page number [Optional] [Defaults to 1]
perPage number [Optional] [Defaults to 100]

Return type

ApiV1AdspacesGet200Response

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Adspace list (filtered by resource_filter.site_ids/adzone_ids when set). -

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

apiV1AdspacesIdGet

apiV1AdspacesIdGet(id)

Get a single adspace.

Example

import {
  Configuration,
  AdspacesApi,
} from 'goadserver-sdk';
import type { ApiV1AdspacesIdGetRequest } 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 AdspacesApi(config);

  const body = {
    // number
    id: 56,
  } satisfies ApiV1AdspacesIdGetRequest;

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

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

Parameters

Name Type Description Notes
id number [Defaults to undefined]

Return type

void (Empty response body)

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 Adspace -
404 Not found -

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