retrievePlannableUserLists method

Future<RetrievePlannableUserListsResponse> retrievePlannableUserLists(
  1. String advertiserId, {
  2. String? filter,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Retrieves first and third party user lists available for forecasting.

API support for generating reach forecasts and retrieving related metadata is in beta. This method is only available to allowlisted users.

Request parameters:

advertiserId - Required. The ID of the advertiser to retrieve plannable user lists for. Value must have pattern ^\[^/\]+$.

filter - Optional. Allows filtering by plannable user list properties. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by AND or OR logical operators. * A restriction has the form of {field} {operator} {value}. * The displayName field must use the HAS (:) operator. * All other fields must use the EQUALS (=) operator. Supported fields: * plannableStatus * displayName * userListType * name Examples: * All plannable user lists: plannableStatus="PLANNABLE" * Plannable user lists with display name containing "Shopping": plannableStatus="PLANNABLE" AND displayName:"Shopping" * First party user lists: userListType="FIRST_PARTY" The length of this field should be no more than 500 characters. Reference our [filter LIST requests](/display-video/api/guides/how-tos/filters) guide for more information.

pageSize - Optional. Requested page size. Must be between 1 and 5000. If unspecified will default to 5000.

pageToken - Optional. A token identifying a page of results the server should return. Typically, this is the value of next_page_token returned from the previous call to RetrievePlannableUserLists method. If not specified, the first page of results will be returned.

$fields - Selector specifying which fields to include in a partial response.

Completes with a RetrievePlannableUserListsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<RetrievePlannableUserListsResponse> retrievePlannableUserLists(
  core.String advertiserId, {
  core.String? filter,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'filter': ?filter == null ? null : [filter],
    'pageSize': ?pageSize == null ? null : ['${pageSize}'],
    'pageToken': ?pageToken == null ? null : [pageToken],
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ =
      'v4/advertisers/' +
      core.Uri.encodeFull('$advertiserId') +
      '/reachForecast:retrievePlannableUserLists';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return RetrievePlannableUserListsResponse.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}