Update Delivery Status of Campaigns
You can update the delivery activation status of campaigns using this PUT operation. You can pause, resume, archive and unarchive campaigns as part of this API operation.
- This API supports batch operations with a max batch size of 10. For bulk operation, the advertiserId must be the same across all requests in the payload.
- advertiserId and campaignId combination should be unique in the request payload
Request Parameters
| Parameters | Notes | Type | Required | Possible Values |
|---|---|---|---|---|
| advertiserId | ID of advertiser whose campaign is to be scheduled | integer | Y | Advertiser ID for which the campaign needs to be updated for delivery status |
| campaignId | ID of the campaign requiring updates to its delivery status | integer | Y | Unique numeric identifier |
| action | Delivery activation status Only campaigns in DRAFT state, that have never gone live or scheduled to go live previously can be ARCHIVED.If a campaign has multiple ad groups, all ad groups must also be in DRAFT and should never have gone live or scheduled to go live. | string | Y | • pause • resume • archive • unarchive |
Campaign Status Update Conditions
The following table describes which action can be applied to campaigns of a given status:
| Action | Allowed In Status |
|---|---|
| Pause | scheduled, live |
| Resume | paused |
| Archive | draft, scheduled |
| Unarchive | archived |
Sample Request
curl -X PUT \ 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/campaigns/action' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************' \ --header 'WM_SEC.KEY_VERSION: 1' \ --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \ --header 'WM_CONSUMER.intimestamp: 1565309779' -data ' [ { "advertiserId": 1, "campaignId": 1, "action": "pause" }
] '
Sample Request (Batch Operation)
curl -X PUT \ 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/campaigns/action' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <auth_token>'
--header 'WM_SEC.AUTH_SIGNATURE: **************' \ --header 'WM_SEC.KEY_VERSION: 1' \ --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \ --header 'WM_CONSUMER.intimestamp: 1565309779' \ -data ' [ { "advertiserId": 1, "campaignId": 1, "action": "pause" }, { "advertiserId": 1, "campaignId": 2, "action": "resume" },
{ "advertiserId": 1, "campaignId": 3, "action": "archive" },
{ "advertiserId": 1, "campaignId": 4, "action": "unarchive " },
] 'Response
| Field | Description | Optional field/Nullable? | Type | Possible values |
|---|---|---|---|---|
| code | The response code can have following values:
Click here for more information about Status Codes and Errors | N | string | success, failure |
| details | Details will populate success or error message depending upon value of code. | N | string | Refer to this link for detailed error messages |
| campaignId | ID of the created campaign. Only returned in case of code=success | Y | integer | |
| message | High-level summary of the error, when available. | Y | string | |
| errors | Detailed information about one or more errors, including the affected field (when applicable), error code, and a human-readable description. | Y | array<object> |
errors Array Object Details
| Field | Description | Optional field/Nullable? | Type | Possible values |
|---|---|---|---|---|
| field | JSON field associated with the error (for example, startDate ). Omitted if the error applies to the request as a whole. | Y | string | |
| errorType | Machine-readable error code that uniquely identifies the error condition. Applications should use this value for error handling logic. | N | string | |
| description | Human-readable explanation of the error, including why the request failed and, when possible, how to resolve it | N | string |
Sample Response Success
[ { "code": "success", "details": ["string"], "campaignId": 1 }
]Sample Response Failure
[ { "code": "failure", "details": [ "string" ], "message": "string",
"errors": [ { "field": "string", "errorType": "string", "description": "string" } ] }
]Sample Response Multi-Status (Batch Operation)
[ { "code": "success", "details": ["string"], "campaignId": 1 }, { "code": "success", "details": ["string"], "campaignId": 2 }, { "code": "failure", "details": ["string"], "campaignId": 3, "message": "string",
"errors": [ { "field": "string", "errorType": "string", "description": "string" } ] }, { "code": "success", "details": ["string"], "campaignId": 4 }
]
Sample Response Failure (Batch Operation)
[ { "code": "failure", "details": [ "string" ], "message": "string",
"errors": [ { "field": "string", "errorType": "string", "description": "string" } ] }, { "code": "failure", "details": [ "string" ], "message": "string",
"errors": [ { "field": "string", "errorType": "string", "description": "string" } ] }, { "code": "failure", "details": [ "string" ], "message": "string",
"errors": [ { "field": "string", "errorType": "string", "description": "string" } ] }, { "code": "failure", "details": [ "string" ], "message": "string",
"errors": [ { "field": "string", "errorType": "string", "description": "string" } ] }
] Updated 9 days ago
Did this page help you?
