Update Existing Campaigns
Update an existing campaign using PUT operation mentioned below
URL: PUT/api/v1/campaigns
Note:
• 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.
• PUT API requests will overwrite all current values and are not intended to be used as incremental updates like PATCH operations
• You must set all of budgetType, dailyBudget, totalBudget, startDate, endDate, and deliverySpeed parameters at same level i.e. either at campaign level or ad group level
Request Parameters
Parameters | Notes | Type | Required | Possible Values |
---|---|---|---|---|
campaignId | ID of the campaign | integer | Y | Unique numeric identifier |
advertiserId | ID of advertiser whose campaign is to be scheduled | integer | Y | Advertiser ID for which the campaign is to be created |
name | The name of the campaign Note: Limit on length of campaign name is 240 characters | integer | Y | The campaign name should be unique |
description | Campaign description Note: Limit on length of campaign description is 240 characters | string | N | Provide valid description corresponding to campaign type |
objective | Campaign objective | string | N | Values: • awareness • engagement • conversion Note: Default value for objective will be awareness, unless specified |
campaignType | The type of the campaign Note: - You can not update campaignType - Only value supported currently is 'ngd' | string | N | Values of campaignType: ngd |
startDate | The date to start campaign Note: - it must be set either at campaign or ad group level - You can update startDate only for campaigns in DRAFT and SCHEDULED state | date | This field is required only if it is not set at ad group level | Date should be in format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX Note: date values are internally converted to EST timezone |
endDate | The date when campaign ends Note: it must be set either at campaign or ad group level | date | This field is required only if it is not set at ad group level | Date should be in format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX To run campaign indefinitely, set its value as ‘9999-12-30T00:00:00Z’ Note: date values are internally converted to EST |
budgetType | The type of budget allocation you want to choose for your campaign _Note: - it must be set either at campaign or ad group level_ - You can not update budgetType | string | This field is required only if it is not set at ad group level | Values: - daily - total |
dailyBudget | Daily budget of campaign Note: - Daily budget cannot exceed your total budget amount - Up to 20% of the unspent budget will be rolled over to the next day - it must be set either at campaign or ad group level | double | This field is required only if: - It is not set at ad group level - budgetType is set to be daily | The value of daily budget should at least be $0.01 Note: This field is required only if budgetType is set to be dailyBudget |
totalBudget | Total budget of campaign Note: it must be set either at campaign or ad group level | double | This field is required only if: -It is not set at ad group level -budgetType is set to be total | The value of total budget should at least be $0.01 Note: This field is required only if budgetType is set to be totalBudget |
deliverySpeed | Determines pacing of ad delivery _Note: - it must be set either at campaign or ad group level_ - You can update it only for campaigns in DRAFT state | string | This field is required only if it is not set at ad group level | Values: - frontloaded - evenly Note: frontloaded pacing is not supported if budgetType is daily |
- You must set all of: budgetType, dailyBudget, totalBudget, startDate, endDate, and deliverySpeed parameters at same level i.e. either at campaign level or ad group level
- Budget, Schedule and Delivery speed must be set either at campaign or ad group level
Sample Request
curl -X PUT \ 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/campaigns' \ --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 ' [ { "campaignId": 1, "advertiserId": 1, "name": "string", "description": "string", "objective": "awareness", "campaignType": "ngd", "startDate": "2023-12-05T12:00:00Z ", "endDate": "2023-12-25T12:00:00Z ", "budgetType": "string", "dailyBudget": 0.0, "totalBudget": 0.0, "deliverySpeed": "string" }
]'
Sample Request (Batch Operation)
curl -X PUT \ 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/campaigns' \ --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 ' [ { "campaignId": 1, "advertiserId": 1, "name": "string", "description": "string", "objective": "awareness", "campaignType": "ngd", "startDate": "2023-12-05T12:00:00Z ", "endDate": "2023-12-25T12:00:00Z ", "budgetType": "string", "dailyBudget": 0.0, "totalBudget": 0.0, "deliverySpeed": "string" }, { "campaignId": 2, "advertiserId": 1, "name": "string", "description": "string", "objective": "awareness", "campaignType": "ngd", "startDate": "2023-12-05T12:00:00Z ", "endDate": "2023-12-25T12:00:00Z ", "budgetType": "string", "dailyBudget": 0.0, "totalBudget": 0.0, "deliverySpeed": "string" } ]'
Response
Element | Description | Type |
---|---|---|
code | The response code can have following values: • success • failure | string |
details | Details will populate success or error message depending upon value of code | string |
campaignId | ID of the campaign | integer |
Sample Response
[ { "code": "success", "details": ["string"], "campaignId": 1 } ]
Sample Response (Batch Operation)
[
{ "code": "success", "details": ["string"], "campaignId": 1
}, { "code": "failure", "details": ["stringA", "stringB"], "campaignId": 2 }
]
Updated 10 days ago