Apple Search Ads Api Error: UNAUTHORIZED: Invalid cert. cert null

Hi guys. I am using apple search ads api v4 to get my team's reports. I received clientId, teamId, keyId, privateKey from my leader and successfully got the access token, but when using that access token to get the campaign report, I get the 401 error: UNAUTHORIZED: invalid cert, cert null. Does anyone have any tips for this? Thanks for your help!

Replies

I fixed that, there was a silly mistake in my code that caused the token to be null. Then I send the request and get the error 403: A required header was not specified. Is this the correct header: -H "Authorization: Bearer {access_token}" ?

curl "https://api.searchads.apple.com/api/v4/campaigns" \
-H "Authorization: Bearer access_token"
  • thats right , aslo require X-AP-Context : orgId=8888888

Add a Comment

How to find X-AP-Context: orgID. and how to find reports.? Please help me and provide doc.

https://api.searchads.apple.com/api/v4/campaigns

  • { "data": null, "pagination": null, "error": { "errors": [ { "messageCode": "UNAUTHORIZED", "message": "Invalid token: 09aab6f3-e159-4a92-a033-757f8ab2032f", "field": "" } ] } }

Add a Comment

{ "data": null, "pagination": null, "error": { "errors": [ { "messageCode": "FORBIDDEN", "message": "A required header was not specified or was invalid.", "field": "" } ] } }