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 Accounts whose leads should be synced to the destination
Your application should display the list of available ad accounts to the user for them to select which ones they would like to sync leads for. Best practice is to include the ad account name and id.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
q | string | ||
search | string | ||
fields | string |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
LinkedIn-Version | string | ||
X-Restli-Protocol-Version | string | ||
Authorization | string |
RESPONSES
status: OK
{"paging":{"start":0,"count":2,"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}]}