Hello!
I'm using this article to receive the token to get access to the API.
I created new Apple ID, set up Search Ads, and invite this new user from my main account (with access to ads/campaigns) with shared access to data through API.
In parallel I generated two keys (private and public) and uploaded public key.
So, I got clientId, teamId and keyId. Don't know why, but clientId and teamId in my case are the same. Then I used Python example from docs to create JWT token (or client_secret).
I got client_secret and then tried to send POST request to get access_token.
I used CURL from example (with my data):
curl -X POST
-H 'Host: appleid.apple.com'
-H 'Content-Type: application/x-www-form-urlencoded'
https://appleid.apple.com/auth/oauth2/token?grant_type=client_credentials&
client_id=id_here&client_secret=jwt_here&scope=searchadsorg
But I always receives 400 error:
{
"error": "invalid_client"
}
How to fix it? Did I miss something?