Skip to content

Latest commit

Β 

History

History
537 lines (374 loc) Β· 15.2 KB

File metadata and controls

537 lines (374 loc) Β· 15.2 KB

FiltersApi

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

Method HTTP request Description
apiV1FiltersGet GET /api/v1/filters List all filters across types.
apiV1FiltersPost POST /api/v1/filters Create a filter and populate it with items.
apiV1FiltersTypeIdActivePatch PATCH /api/v1/filters/{type}/{id}/active Activate or deactivate a filter (exclusion types only).
apiV1FiltersTypeIdDelete DELETE /api/v1/filters/{type}/{id} Delete a filter (and its items, for IP pools).
apiV1FiltersTypeIdGet GET /api/v1/filters/{type}/{id} Get a single filter with its items.
apiV1FiltersTypeIdItemsItemDelete DELETE /api/v1/filters/{type}/{id}/items/{item} Remove a single item from a filter.
apiV1FiltersTypeIdItemsPost POST /api/v1/filters/{type}/{id}/items Add items to an existing filter.

apiV1FiltersGet

ApiV1FiltersGet200Response apiV1FiltersGet(type)

List all filters across types.

Each filter has a type and may apply globally or to specific campaigns. Types: | type | meaning | toggleable | |---------------|----------------------------------|:----------:| | `domain_excl` | Block these domains | yes | | `domain_incl` | Only allow these domains | no | | `adzone_excl` | Block these ad zones | yes | | `adzone_incl` | Only allow these ad zones | no | | `isp_excl` | Block these ISPs | yes | | `subid_excl` | Block these SubIDs | yes | | `subid_incl` | Only allow these SubIDs | no | | `ip` | IP-pool blocking | no |

Example

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

  const body = {
    // 'domain_excl' | 'domain_incl' | 'adzone_excl' | 'adzone_incl' | 'isp_excl' | 'subid_excl' | 'subid_incl' | 'ip' | Filter to one type. (optional)
    type: type_example,
  } satisfies ApiV1FiltersGetRequest;

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

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

Parameters

Name Type Description Notes
type domain_excl, domain_incl, adzone_excl, adzone_incl, isp_excl, subid_excl, subid_incl, ip Filter to one type. [Optional] [Defaults to undefined] [Enum: domain_excl, domain_incl, adzone_excl, adzone_incl, isp_excl, subid_excl, subid_incl, ip]

Return type

ApiV1FiltersGet200Response

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Filter list across types -

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

apiV1FiltersPost

FilterDetail apiV1FiltersPost(apiV1FiltersPostRequest)

Create a filter and populate it with items.

For `domain_excl` / `domain_incl`: items can be domain URLs (`"https://evil.com/x\"`) β€” automatically resolved to internal domain IDs β€” or numeric domain IDs as strings. For `adzone_excl` / `adzone_incl` / `isp_excl`: items must be numeric IDs. For `subid_excl` / `subid_incl`: items are raw SubID strings. IP pool creation is not yet exposed via the public API.

Example

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

  const body = {
    // ApiV1FiltersPostRequest
    apiV1FiltersPostRequest: ...,
  } satisfies ApiV1FiltersPostOperationRequest;

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

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

Parameters

Name Type Description Notes
apiV1FiltersPostRequest ApiV1FiltersPostRequest

Return type

FilterDetail

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Filter created -
422 Validation error / duplicate name -

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

apiV1FiltersTypeIdActivePatch

ApiV1FiltersTypeIdActivePatch200Response apiV1FiltersTypeIdActivePatch(type, id, apiV1CampaignsTypeIdActivePatchRequest)

Activate or deactivate a filter (exclusion types only).

Only `*_excl` filters have an active/inactive state. Inclusion filters and IP pools always apply when a campaign references them β€” disable by removing the reference instead.

Example

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

  const body = {
    // string
    type: type_example,
    // number
    id: 56,
    // ApiV1CampaignsTypeIdActivePatchRequest
    apiV1CampaignsTypeIdActivePatchRequest: ...,
  } satisfies ApiV1FiltersTypeIdActivePatchRequest;

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

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

Parameters

Name Type Description Notes
type string [Defaults to undefined]
id number [Defaults to undefined]
apiV1CampaignsTypeIdActivePatchRequest ApiV1CampaignsTypeIdActivePatchRequest

Return type

ApiV1FiltersTypeIdActivePatch200Response

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 New state -
422 Filter type not toggleable -

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

apiV1FiltersTypeIdDelete

apiV1FiltersTypeIdDelete(type, id)

Delete a filter (and its items, for IP pools).

Example

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

  const body = {
    // string
    type: type_example,
    // number
    id: 56,
  } satisfies ApiV1FiltersTypeIdDeleteRequest;

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

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

Parameters

Name Type Description Notes
type string [Defaults to undefined]
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 Deleted -
404 Not found -

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

apiV1FiltersTypeIdGet

FilterDetail apiV1FiltersTypeIdGet(type, id)

Get a single filter with its items.

Example

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

  const body = {
    // string
    type: type_example,
    // number
    id: 56,
  } satisfies ApiV1FiltersTypeIdGetRequest;

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

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

Parameters

Name Type Description Notes
type string [Defaults to undefined]
id number [Defaults to undefined]

Return type

FilterDetail

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Filter details -
404 Not found -

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

apiV1FiltersTypeIdItemsItemDelete

ApiV1FiltersTypeIdItemsItemDelete200Response apiV1FiltersTypeIdItemsItemDelete(type, id, item)

Remove a single item from a filter.

`{item}` is the stored value β€” domain ID, adzone ID, ISP ID, or SubID string. URL-encode special characters.

Example

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

  const body = {
    // string
    type: type_example,
    // number
    id: 56,
    // string
    item: item_example,
  } satisfies ApiV1FiltersTypeIdItemsItemDeleteRequest;

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

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

Parameters

Name Type Description Notes
type string [Defaults to undefined]
id number [Defaults to undefined]
item string [Defaults to undefined]

Return type

ApiV1FiltersTypeIdItemsItemDelete200Response

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Removed -
404 Item not present in this filter -

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

apiV1FiltersTypeIdItemsPost

ApiV1FiltersTypeIdItemsPost200Response apiV1FiltersTypeIdItemsPost(type, id, apiV1FiltersTypeIdItemsPostRequest)

Add items to an existing filter.

Same input format as creating a filter β€” domain URLs are auto-resolved to IDs for domain filters, numeric IDs required for adzone/ISP filters, raw strings for SubID filters. Already-present items are deduplicated silently.

Example

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

  const body = {
    // string
    type: type_example,
    // number
    id: 56,
    // ApiV1FiltersTypeIdItemsPostRequest
    apiV1FiltersTypeIdItemsPostRequest: ...,
  } satisfies ApiV1FiltersTypeIdItemsPostOperationRequest;

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

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

Parameters

Name Type Description Notes
type string [Defaults to undefined]
id number [Defaults to undefined]
apiV1FiltersTypeIdItemsPostRequest ApiV1FiltersTypeIdItemsPostRequest

Return type

ApiV1FiltersTypeIdItemsPost200Response

Authorization

apiKey

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 New item set -

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