invalid_client when obtaining Apple Search Ads API token

Hi, I'm following this page to get the token of ASA API:

implementing_oauth_for_the_apple_search_ads_api

I have my clientId, client_secret all ready but when i send the POST request, i get {"error": "invalid_client"}

Any help would be much appreciated, thank you

Hmm I can get the token if I use postman to send POST request but cannot get it if I use curl command.

How this could happen

I'm trying with Curl, Postman and Insomnia. Nothing works.

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"

invalid_client when obtaining Apple Search Ads API token
 
 
Q