PRODUCT

Amazon Ad Server will be sunset in Q4 2024, please visit this page (AAS offboarding information) for offboarding support resources and sunset FAQs. Details shared on that page represent the most up to date information in the Help Center, if you find disparate information in other resources please default to the information in the AAS offboarding information page accordingly.

Please note that on October 1, 2024, the ability to create new campaigns, placements and tag managers was disabled.

Follow

Overview

You can use the campaign resource to retrieve all campaigns, retrieve a specific campaign, create a campaign, update an existing campaign, or retrieve a site contact from an advertiser that uses the campaign.

Resource URL

https://adapi.sizmek.com/sas/campaigns

Objects Used by This Resource

HTTP Method and URI List

HTTP Method

URI

Description

GET

/campaigns

Retrieves multiple campaigns.

GET

/campaigns/{Id}

Retrieves a specific campaign.

GET

/campaigns/{Id}/siteContacts/{id}

Retrieves site contact from advertiser level.

POST

/campaigns

Create a campaign.

PUT

/campaigns/{Id}

Update a campaign.

Method Examples and Request Parameters

Important

Important:

  • For PUT calls, do the following:

    • For any PUT method that updates an object, make sure that you include the entire "result": object from the GET response in the request body. If there is missing information, even if it is read-only, the request might fail or override the existing fields with the new values.

    • You must also change the "result": to "entities": and make the entities contents into an array. For example, here is the output from the GET request:

       { "result": { "type": "Advertiser", ... } }      

      You should make the following modifications, including your specific modifications, to the json object that you submit for the request.

       { "entities": [{ "type": "Advertiser", ... }] }   
      
  • For POST calls, do the following:

    • Include the fields marked as Required, as indicated in the corresponding Object article.

    • Format the JSON object as follows:

       { "entities": [{ "type": "Advertiser", ... }] }   

Get Multiple Campaigns

Retrieves multiple campaigns.

Request Query Parameters

Name

Description

Type

Required

Notes

from

Starting index by which to fetch new campaigns for paging purposes.

Long

Required

Getting multiple entities requires using from and max query parameters.

max

Maximum number of campaigns to fetch for each page.

Long

Required

accountId

ID of account.

Long

Optional

siteId

ID of site.

Long

Optional

traffickingMode

Attachment process used in the campaign.

String

Optional

sort

Sort by field name (see here).

String

Optional

order

Sort order ASC or DESC, required if sort field name is specified (see here).

String

Optional

Note

Note: Required if a sort field name is specified.

By default, the API response is ascending.

q

Filtering options for the request (see here).

String

Optional

Example of query string: q={"1":{"CREATEDBYNAME":["MonicaSmith"]},"2":{"ADVERTISERNAME":["autoads"]}}

Note

Note: The date is according to the Unix epoch timestamp.

accountName

Name of account.

String

Optional

advertiserId

ID of advertiser.

Long

Optional

advertiserName

Name of advertiser.

String

Optional

brandId

ID of parent brand.

Long

Optional

Request Format

GET https://adapi.sizmek.com/sas/campaigns?from=0&max=250

Response Format

A successful request returns the HTTP 200 OK status code and a JSON response body that shows the campaigns' details filtered by data ownership.

Get a Campaign

Retrieves a specific campaign.

Request Parameters

Name

Description

Type

Required

Notes

id

ID of the requested campaign

Integer

Required

Request Format

GET https://adapi.sizmek.com/sas/campaigns/1234567890

Response Format

A successful request returns the HTTP 200 OK status code and a JSON response body that shows the variable details. If there is no variable, the request returns an empty response.

Retrieve Campaign Site Contact

Retrieves site contact from an advertiser that uses that campaign.

Request Parameters

Name

Description

Type

Required

Notes

getSiteContactFromAdvertiserLevel

Determines whether to retrieve site contacts.

Boolean

Required

Request Format

GET https://adapi.sizmek.com/sas/campaigns/1234567890/siteContacts/1234567890?getSiteContactFromAdvertiserLevel=true

Response Format

A successful request returns the HTTP 200 OK status code and a JSON response body that shows the site contact details.

Create a Campaign

Adds a new campaign.

Request Parameters

Name

Description

Type

Required

Notes

Body

Request containing campaign body to create.

JSON

Required

Request Format

POST https://adapi.sizmek.com/sas/campaigns

Response Format

A successful request returns the HTTP 200 OK status code and a JSON response body that shows the new campaign resource.

Update an Existing Campaign

Updates a campaign with specified information.

Request Parameters

Name

Description

Type

Required

Notes

id

ID of campaign.

Long

Required

Body

Request containing campaign body to update.

JSON

Required

Request Format

PUT https://adapi.sizmek.com/sas/campaigns/123456790

Response Format

A successful request returns the HTTP 200 OK status code and a JSON response body that shows the updated campaign resource.

Status Codes and Errors

The following table lists the possible HTTP status codes in responses.

Code

String

Description

200OK

String

Successful API execution

207

Multi-status error

Multi-status response

500

Internal Error

500 internal server errors

Multi-Status Errors

Internal Code

STRING

Description

62001

Campaign has verification tracking placements.

Verification is set to None but a verification tracking placement exists in the campaign.

Internal Server Errors

The following shows an example of an internal server error in a response body.

The following table lists the possible internal server errors for the campaign resource.

Internal Code

String

62000

Failed to update campaign with id {Campaign id} - TraffickingMode changed from advanced to simple when already attached placement exists.

62002

Cannot create campaign advertiser. %s data does not contain privacy section.

62003

Cannot save campaign. DisableCookies cannot be false while advertiser DisableCookies is true.

62004

You do not have sufficient privileges to perform this action.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments