Accounts

The API provides methods to:

Retrieve a user's list of accounts

You can retrieve all accounts associated with the currently authenticated user by sending an HTTP GET request to the Accounts Resource URI, which has the following format:

https://www.googleapis.com/adexchangebuyer/v1.4/accounts

Request

Here is an example:

GET https://www.googleapis.com/adexchangebuyer/v1.4/accounts?access_token=token

The access token can be obtained by following the steps in the Authorization guide.

Response

If the request succeeds, the server responds with a 200 OK HTTP status code and the account data. You can use a returned ID to obtain information for a specific account as described in the following section.

{
  'items': [
    {
      "kind": "adexchangebuyer#account",
      "maximumTotalQps": 100,
      "bidderLocation": [
        {
          "url": "http://test.bidder.com/rtb.py",
          "maximumQps": 90,
          "region": "US_EAST"
        }
      ],
      "cookieMatchingNid": "testnetwork",
      "id": "123456789",
      "cookieMatchingUrl": "http://cookie-match.com/match?id="
    }
    {
      "kind": "adexchangebuyer#account",
      "maximumTotalQps": 120,
      "bidderLocation": [
        {
          "url": "http://test.mybidder.com/myrtb.py",
          "maximumQps": 100
          "region": "US_EAST"
        }
      ],
      "cookieMatchingNid": "mytestnetwork",
      "id": "987654321",
      "cookieMatchingUrl": "http://my-cookie-match.com/match?id="
    }
  ]
}

See the following code samples that use client libraries to retrieve a user's list of accounts:

Retrieve a specific account

You can retrieve information for a specific account by sending an HTTP GET request to the Account URI, which has the following format:

https://www.googleapis.com/adexchangebuyer/v1.4/accounts/id

Request

Here is an example:

GET https://www.googleapis.com/adexchangebuyer/v1.4/accounts/123456789?access_token=token

The access token can be obtained by following the steps in the Authorization guide.

Response

If the request succeeds, the server responds with a 200 OK HTTP status code and the account's data:

{
  "kind": "adexchangebuyer#account",
  "maximumTotalQps": 100,
  "bidderLocation": [
    {
      "url": "http://test.bidder.com/rtb.py",
      "maximumQps": 90,
      "region": "US_EAST"
    }
  ],
  "cookieMatchingNid": "testnetwork",
  "id": "123456789",
  "cookieMatchingUrl": "http://cookie-match.com/match?id="
}

Update accounts

To update and fully replace an existing account resource, follow these steps:

  1. Retrieve the resource that you want to update.
  2. Modify the properties you want to change.
  3. Send a PUT request to the resource URI and supply the modified resource as the message body.

The URI for the Accounts Resource has the following format:

https://www.googleapis.com/adexchangebuyer/v1.4/accounts/id

Note: The id, cookieMatchingNid, and maximumTotalQps properties are read-only. If you try to update them you will receive an error.

Request

Here is an example of a PUT request (the final step above) that updates and fully replaces an account resource:

PUT https://www.googleapis.com/adexchangebuyer/v1.4/accounts/123456789
Authorization: /* auth token here */
Content-Type: application/json

{
  "kind": "adexchangebuyer#account",
  "maximumTotalQps": 100,
  "bidderLocation": [
    {
      "url": "http://mytest.bidder.com/rtb.py",
      "maximumQps": 90
      "region": "US_EAST"
    }
  ],
  "cookieMatchingNid": "testnetwork",
  "id": "123456789",
  "cookieMatchingUrl": "http://cookie-match.com/match?id="
}

Note: The user must be authenticated to update Ad Exchange Buyer resources, so you must provide the Authorization HTTP header with the PUT request.

Response

If the request succeeds, the server responds with a 200 OK status code and the full representation of the modified resource.

Patch accounts

This method of updating accounts is similar to PUT, but instead of a full data replacement, PATCH applies only a delta update.

To update and patch an existing account resource, follow these steps:

  1. Retrieve the resource that you want to update.
  2. Modify the properties you want to change.
  3. Send a PATCH request to the resource URI and supply the modified resource as the message body.

The URI for the Accounts Resource is the same as for an update with full replace:

https://www.googleapis.com/adexchangebuyer/v1.4/accounts/id

Note: The id, cookieMatchingNid, and maximumTotalQps properties are read-only. If you try to update them you will receive an error.

Request

Here is an example of a PATCH request (the final step above) that updates and patches an account resource:

PATCH https://www.googleapis.com/adexchangebuyer/v1.4/accounts/123456789
Authorization: /* auth token here */
Content-Type: application/json

{
  "bidderLocation": [
    {
      "url": "http://mytest.bidder.new.com/rtb.py",
      "maximumQps": 90
      "region": "US_EAST"
    }
  ],
}

Note: The user must be authenticated to update Ad Exchange Buyer resources, so you must provide the Authorization HTTP header with the PATCH request.

Response

If the request succeeds, the server responds with a 200 OK status code and the full representation of the modified resource.

Send feedback about...

Buyer REST API
Buyer REST API