Introduction
This article can help you troubleshoot issues with the Perfect Gym API, particularly, when an Error: Authorization has been denied for this request occurs.
This error means that your API credentials, which have been used for authorization when making API calls, are no longer valid or were incorrectly entered.
- This article helps in solving issues when the Error: Authorization has been denied for this request occurs when making the API call.
- This article is for PG Champion, Administrator, Club Manager, Club Owner and API client, i.e. IT Technician or IT Developer.
Before you start
Make sure you are familiar with API Configuration - Basic information, API - General Troubleshooting and API v2 documentation.
Troubleshooting
How to solve API authorization error?
- Check if your API credentials: Client-Id and Client-Secret are entered correctly in the Headers, in the program you are using for API calls.
- Check in the PGM system if the employee account associated with API has the necessary system permissions:
- required system permissions: CreateApiClients and ApiAccess
- related article: How to change system permissions for employees?
- Check in the PGM system if the employee account associated with API is Active
- if the employee account has been deactivated, your current API credentials will also be deactivated. You either need to make that employee Active again or refer to point 4 below.
We recommend the option Don't deactivate automatically to be always enabled in case of employee accounts used for API purposes. You can read about it here.
4. If you have already checked everything:
- create a new employee account or use an existing employee account that has the necessary permissions for API.
- log into the PGM system as the employee that has permissions for API.
- generate the new API credentials and replace the old ones - this article will show you how to do that.