Mutate and retrieve resources

Each resource in the Waze Ads Management API has a corresponding service that allows operations on the resources. Each service has the following methods:

  • create a single instance of the resource.
  • update a single instance of the resource.
  • get a single instance of the resource for inspection.
  • list all instances of the resource the authenticated user can access.

This guide uses the service CampaignService to demonstrate how to manipulate and inspect Campaign resources, but the same concepts also apply to all other services.

Create resources

Each service has a create method that accepts a request which consists of the following:

  • In the URL, an ACCOUNT_ID of the account under which this resource will be created.
  • An instance of the resource with all required fields.

For example, the accounts.campaigns.create method URL v1/accounts/ACCOUNT_ID/campaigns accepts a Campaign.

Update resources

Each service has a patch method that accepts a request which consists of the following:

  • A name of the resource in the URL.
  • An updateMask, which is a field mask that tells the Waze Ads API which resource fields to modify.
  • A partial resource with the fields to be patched.

Retrieve resources

In addition to the ability to create and update resources, each service also has a get method to retrieve all the attributes of a single resource. This method accepts a GET request whose only attribute is name.

List resources

To retrieve all attributes of all instances of a resource, each service has a list method which accepts a GET request with the following:

  • An ACCOUNT_ID in the URL.
  • A pageSize to indicate the maximum number of resources to return.
  • A pageToken, received from a previous list call, to retrieve a subsequent page

If the pageSize is unspecified, at most 50 resources will be returned. The maximum value is 1,000; values above 1,000 will be coerced to 1,000. When paginating, the pageSize must match the call that provided the pageToken.