PRODUCT
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

Depending on the API user that was created for you, use one of the following URLs:

  • https://api.sizmek.com/rest/campaigns

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

Note

Note: Confirm with your Sizmek customer success manager regarding the correct URL to use.

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:

    • We recommend that for any PUT method that updates an object, 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.

    • 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", ... }] }   

For more information, see Campaign Object.

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

Depending on the API user that was created for you, use one of the following URLs:

  • GET https://api.sizmek.com/rest/campaigns?from=0&max=250

  • 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

Depending on the API user that was created for you, use one of the following URLs:

  • GET https://api.sizmek.com/rest/campaigns/1073869571

  • GET https://adapi.sizmek.com/sas/campaigns/1073869571

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

Depending on the API user that was created for you, use one of the following URLs:

  • GET https://api.sizmek.com/rest/campaigns/1073742668/siteContacts/1073742783?getSiteContactFromAdvertiserLevel=true

  • GET https://adapi.sizmek.com/sas/campaigns/1073742668/siteContacts/1073742783?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

Depending on the API user that was created for you, use one of the following URLs:

  • POST https://api.sizmek.com/rest/campaigns

  • 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

Depending on the API user that was created for you, use one of the following URLs:

  • PUT https://api.sizmek.com/rest/campaigns/1073741875

  • PUT https://adapi.sizmek.com/sas/campaigns/1073741875

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

Powered by Zendesk