2. Retrieve the user's Ad Accounts (sponsoredAccount)

GET {{baseUrl}}/adAccounts?q=search&search=(type:(values:List(BUSINESS)),status:(values:List(ACTIVE)),test:false)&fields=id,name,test,reference

View Search for Accounts documentation for more information.

This API call pulls back Ad Accounts that the member has access to where the status = ACTIVE, type = BUSINESS, and test = false (NOT a test Ad Account).

Learn more about Test Ad Accounts here.

For testing purposes, if you wish to use this example api to pull back a Test Ad Account, simply remove test:false from the search parameter.

3. Ask the user to select the Ad Account where the audience should be created or dynamically updated

Request Params

KeyDatatypeRequiredDescription
qstring
searchstring
fieldsstring

HEADERS

KeyDatatypeRequiredDescription
LinkedIn-Versionstring
Authorizationstring
X-Restli-Protocol-Versionstring

RESPONSES

status: OK

{"paging":{"start":0,"count":10,"links":[],"total":2},"elements":[{"name":"Test ad account","reference":"urn:li:organization:11223344","id":123456,"test":false},{"name":"MDO ad account","reference":"urn:li:organization:2355689","id":456789,"test":false}]}