Unable to request an access token from Search Ads Api

Hi,

I'm trying to follow the guide for implementing OAuth for Apple Search Ads Api: https://developer.apple.com/documentation/apple_search_ads/implementing_oauth_for_the_apple_search_ads_api

I've created both keys, uploaded the public one, generated the JWT. Something goes wrong when I try to request the access token. Everything sent with Curl, Insomnia or Postman generates a 400 response with invalid_client as data. I've used a JWT debugger to make sure that the client secret I have sent is correct. The request is sent as a POST, with the header and params set like in the example from the documentation. What could possibly be wrong? There is nothing in the documentation regarding invalid_client.

Best regards Mike

I was having the exact same issue - I got it working by enclosing the URL in double quotes and then it worked

i.e.

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=<insert_client_id>&client_secret=<insert_client_secret>&scope=searchadsorg"

Unable to request an access token from Search Ads Api
 
 
Q