To pull reporting data from Apple Search Ads (ASA) we have to generate and share a series of access keys. This differs from a standard username / password or Oauth2 authentication and requires a few additional steps.
Requested access to ASA for the email we will use for authenticating
this would typically handled by the agency or client that owns the ASA account
the account requires 'Api Key Manager' role
Create a new Apple ID for the email address that has been granted
Generate a Private Key to upload to Apple Search Ads
{client-code} should be replace by the Bright Analytics client 'stub' code
openssl ecparam -genkey -name prime256v1 -noout -out asa-{client-code}-key.pem
Generate a Public Key for uploading to ASA
{client-code} should be replace by the Bright Analytics client 'stub' code
openssl ec -in asa-{client-code}-key.pem -pubout -out asa-{client-code}-public-key.pem
Extract the Public Key and upload to ASA
Securely store the Client Credentials generated by ASA
clientId
teamId
keyId
Create a connection in Bright Connect and define the following options
apple_search_client_id (see above)
apple_search_team_id (see above)
apple_search_key_id (see above)
apple_search_org_id : this is the ASA Account ID you wish to pull data
if the account you wish to pull from is managed by an agency then the orgId may not be the one displayed the ASA UI
to see which Accounts a user's access token has access to you should send a GET request, authenticated by the access token generated from the credentials above, to:
https://api.searchads.apple.com/api/v4/acls
the response to this API call will show the details of the accounts you have access to and should clarify which orgId to specify in the connection options.
apple_search_private_key - key generated in step 3
the entire private key should be base64 encoded before being added
echo -n '{PRIVATE-KEY-GOES-HERE}' | base64
Create the ASA import jobs in Bright Connect
add relevant target tables
specify the corresponding 'method' option per target table
Associate the new ASA connection with the new ASA import job
Test the job works.