Apple Ads Authorization
apl_auth(
client_id = Sys.getenv("APL_CLIENT_ID"),
team_id = Sys.getenv("APL_TEAM_ID"),
key_id = Sys.getenv("APL_KEY_ID"),
private_key_path = Sys.getenv("APL_PRIVATE_KEY_PATH"),
account_name = Sys.getenv("APL_ACCOUNT_NAME"),
cache_path = rappdirs::site_data_dir("rappleads")
)character with access_token
You receive your clientId when you upload a public key.
The client secret is a JWT that you create and sign with your private key.
The value is your keyId that returns when you upload a public key.
Path to the .pem file containing your private key.
Your apple ads account name
Path to the directory where cached authentication data will be stored.
This implementation process guides you through the following steps:
Invite users with API permissions.
Generate a private-public key pair.
Extract a public key from your persisted private key.
Upload a public key.
Set system environments variables.
Request an access token.
API users need to create a private key. If you’re using MacOS or a UNIX-like operating system, OpenSSL works natively. If you’re on a Windows platform, you need to download OpenSSL.
openssl ecparam -genkey -name prime256v1 -noout -out private-key.pem
openssl ec -in private-key.pem -pubout -out public-key.pem
Open the public-key.pem file in a text editor and copy the public key, including the begin and end lines.
Follow these steps to upload your public key:
From the Ads UI, choose Account Settings > API. Paste the key created in the above section into the Public Key field.
Click Save. A group of credentials displays as a code block above the public key field. Use your clientId, teamId, and keyId to create a client secret.
Run usethis::edit_r_environ() and set variables:
APL_CLIENT_ID
APL_TEAM_ID
APL_KEY_ID
APL_PRIVATE_KEY_PATH
APL_ACCOUNT_NAME
Once the environment variables listed above are set, no further action is required from you — any function from the package will automatically request and refresh the access token when executed.
For more information see API Oauth documentation.