Skip to main content

Getting Advertising Connected Accounts

A Connected Account represents the metadata of an advertising account that has been connected to a specific Business Location in Advertising Intelligence.

info

For info on Business Locations see the Businesses guide

Setup​

Create an access token with advertising scopes following the Authorization guide.

Examples​

Fetching Connected Accounts For A Business​

Connected accounts can be fetched for a single business location using its Business Location ID. This data can be used to provide an overview of all advertising accounts for a business, or to fetch account stats afterwards for returned connected accounts. The following request will fetch all advertising accounts connected to a given business. In this case, AG-X5FZQG6T25 has both Google and Facebook advertising accounts connected.

curl -X GET 'https://prod.apigateway.co/products/advertising/connectedAccounts?businessLocation.id=AG-X5FZQG6T25' \
-H 'Authorization: Bearer <Access Token with "advertising" scope>' \
-H 'Content-Type: application/vnd.api+json'

For more details on this endpoint see List Connected Accounts

Filtering Accounts By Provider​

By default, this endpoint will return connected accounts for all providers. If you want to get accounts for only one provider, you can set the filter[provider] parameter to either google, facebook or localAds.

This example will get all Google Ads accounts connected to the businesses AG-JT87JWQ7KN

curl -X GET 'https://prod.apigateway.co/products/advertising/connectedAccounts?businessLocation.id=AG-JT87JWQ7KN&filter%5Bprovider%5D=google&filter%5Bprovider%5D=facebook' \
-H 'Authorization: Bearer <Access Token with "advertising" scope>' \
-H 'Content-Type: application/vnd.api+json'

For more details on this endpoint see List Connected Accounts

Retrieving A Connected Account With ID​

A single connected account can be retrieved using the ID previously found using the list operation. This data can be used to provide an overview of a single advertising account for a business when the advertising account ID is known.

curl -X GET 'https://prod.apigateway.co/products/advertising/connectedAccounts/AG-X5FZQG6T25:google:1324354698' \
-H 'Authorization: Bearer <Access Token with "advertising" scope>' \
-H 'Content-Type: application/vnd.api+json'

For more details on this endpoint see Get A Connected Account