What does 401 unauthorized mean and how do I resolve it? How about 403 Forbidden?



If you receive a 401 UNAUTHORIZED_ACCESS, the likely cause is that your authentication credentials were missing or incorrect. The Ads API requires the use of OAuth 1.0A and HTTPS and we strongly recommend that you use an OAuth library rather than trying to roll your own. If using a known library, we can help you with debugging; see here for some suggestions.

If you receive a 403 FORBIDDEN, this means that the request itself has been understood, but it has been refused or access is not allowed. You will receive a representative error message that should explain why you received a 403. Alongside an error message, there will also be an error code. You can have a look here to see what each error code corresponds to. For example, an error code of 64 means your account is suspended and is not permitted to access this feature.

Related Links:

UNAUTHORIZED_ACCESS - 401 Error - Authorization Required
Unauthorized client application
Ads API Frequently Asked Questions (FAQs)
Error Forbidden
Getting unauthorized client error with Ads API
Ads API calls with PHP
Reach & frequency calls return authentication error despite our REACH_AND_FREQUENCY_ANALYTICS whitelist
Ads API code in PHP
Ads API 403 'Unauthorized Access"
Guidance for UNAUTHORIZED_ACCESS issues
I can get campaign by Ads API, but I received 403 when create campaign
TON API 403 Error