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.
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", ... }] }
-
Retrieves multiple campaigns.
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 NoteNote: 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"]}} NoteNote: 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 |
Retrieves a specific campaign.
Name |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
id |
ID of the requested campaign |
Integer |
Required |
Retrieves site contact from an advertiser that uses that campaign.
Name |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
getSiteContactFromAdvertiserLevel |
Determines whether to retrieve site contacts. |
Boolean |
Required |
GET https://adapi.sizmek.com/sas/campaigns/1234567890/siteContacts/1234567890?getSiteContactFromAdvertiserLevel=true
Adds a new campaign.
Name |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
Body |
Request containing campaign body to create. |
JSON |
Required |
Updates a campaign with specified information.
Name |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
id |
ID of campaign. |
Long |
Required |
|
Body |
Request containing campaign body to update. |
JSON |
Required |
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 |
Internal Code |
STRING |
Description |
---|---|---|
62001 |
Campaign has verification tracking placements. |
Verification is set to None but a verification tracking placement exists in the campaign. |
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. |
Comments