2. Get the user's sponsored accounts (ad accounts)
GET {{baseUrl}}/adAccounts?q=search&search=(status:(values:List(ACTIVE)),test:false)&fields=id,name,test,referenceInfo&count=10&start=0
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 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. Allow the user to select an Ad Account
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
q | string | ||
search | string | ||
fields | string | ||
count | number | ||
start | number |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-Restli-Protocol-Version | string | ||
LinkedIn-Version | string |
RESPONSES
status: OK
{"paging":{"start":0,"count":10,"links":[],"total":2},"elements":[{"name":"Ad Account A","id":1234567,"test":false,"referenceInfo":{"organization":{"name":{"localized":{"en_US":"Highlander Cranberries LLC"},"preferredLocale":{"country":"US","language":"en"}},"vanityName":"highlander-cranberries-llc","localizedName":"Highlander Cranberries LLC","id":11223344}}},{"name":"New Ad Account B","id":5678910,"test":false,"referenceInfo":{"organization":{"name":{"localized":{"en_US":"Highlander Cranberries LLC"},"preferredLocale":{"country":"US","language":"en"}},"vanityName":"highlander-cranberries-llc","localizedName":"Highlander Cranberries LLC","id":11223344}}}]}