Create New Ad Group

Create new ad groups within a campaign for an advertiser

📘

URL: POST /api/v1/adGroups

Note: Brand Assets are currently in beta.

Request Parameters

ParameterDescriptionTypeRequiredPossible Values
nameThe name of the ad groupstringYRelevant string value representing the ad group
statusSpecified status of ad groupstringYStatus values can be:
  • enabled
  • disabled
  • deleted
campaignIdId of the campaign this ad group belongs tointegerYUnique numeric identifier
brandAssetsArray containing the ID of a Brand Asset
  • Sponsored Brands manual campaigns are eligible to add Brand Assets
  • A Brand Asset must be approved by a review before adding to an ad group. Adding a Brand Asset that has not been approved will result in an error.
  • For Sponsored Brands manual campaigns, only one Brand Asset is allowed for an ad group.
  • Sponsored Brands campaigns only support one ad group.
Note:
  • If Brand Assets are not passed in the request, Brand Assets will not be added to the new ad group.
  • A null value or an empty array for brandAssets will create a new ad group without Brand Assets.
  • Sponsored Brands manual campaigns must be paused before adding Brand Assets<./li>
array<integer>N
  • A reviewed and approved Brand Asset ID
  • An empty array
  • A null value

Headers

Header NameDescriptionRequiredValues
AuthorizationThe token will provide you the access to the API. It is same for all advertisers you access through the API.YPlease utilize the generated auth_token shared with you at the time of partner onboarding from the Getting Started Guide
WM_CONSUMER.IDWe will provide you the consumer ID to access the API. It is same for all advertisers you access through the API.   YPlease use the generated ConsumerId shared with you at the time of partner onboarding. Refer to the Getting Started Guide for more information
WM_SEC.AUTH_SIGNATUREAuth signature as an API key.YUse the signature generator code from Getting Started Guide to generate this value
WM_SEC.KEY_VERSIONWe will provide you with the KEY VERSION to access the API. It is same for all advertisers you access through the API.Y1
WM_CONSUMER.intimestampTimestamp for which the auth signature is generated. Use Unix epoch format for the timestamp.YUse the signature generator code from Getting Started Guide to generate this value
Content-TypeFormat of the message bodyYapplication/json

Sample Request 1 - Create an ad group without Brand Assets (null)

curl -X POST \
'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/adGroups' \
--header 'Authorization: Bearer <auth_token>' \ --header 'accept: application/json' \
--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' \
--header 'Content-Type: application/json' \
--data '
{ "name": "AdGroup name", "status":"enabled", "campaignId": 500002, "brandAssets": null
}'

Sample Request 2 - Create an ad group without Brand Assets (empty)

curl -X POST \
'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/adGroups' \
--header 'Authorization: Bearer <auth_token>' \ --header 'accept: application/json' \
--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' \
--header 'Content-Type: application/json' \
--data '
{ "name": "AdGroup name", "status":"enabled", "campaignId": 400000, "brandAssets": []
}'

Sample Request 3 - Create an ad group with a single Brand Asset

curl -X POST \
'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/adGroups' \
--header 'Authorization: Bearer <auth_token>' \ --header 'accept: application/json' \
--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' \
--header 'Content-Type: application/json' \
--data '
{ "name": "AdGroup name", "status":"enabled", "campaignId": 400000, "brandAssets": [ { "brandAssetId": "600001" } ] }'

Response

ElementDescriptionType
codePossible values of response code: success,failurestring
detailsDetails of the error if value of response code is failurestring
adGroupIdID of the ad groupinteger

Sample Response 1

[ { "code": "success", "details": "", "adGroupId": 500000 } ]

Sample Response 2

[ { "code": "success", "details": "", "adGroupId": 500000 } ]

Sample Response 3

[ { "code": "success", "details": "", "adGroupId": 500000 }
]

Sample Response 4 - Creating multiple ad groups in a Sponsored Brands campaign

[ { "code": "failure", "details": "Only 1 ad group is allowed in this campaign.", "adGroupId": 0 }
]

Sample Response 5 - Creating an ad group with an unapproved Brand Asset

 [ { "code": "failure", "details": "Brand asset with brandAssetId=10435 is not approved.", "adGroupId": 0 }
]

Sample Response 6 - Creating an ad group with multiple Brand Assets for a Sponsored Brands campaign

[ { "code": "failure", "details": "Sponsored Brands Campaign cannot have more than 1 brand asset", "adGroupId": 0 }
]


Did this page help you?