- Joined
- Sep 17, 2021
- Messages
- 89
- Reaction score
- 110
I have a question regarding 3CX API authentication and the permissions assigned within the bearer token.
When I perform the login as officially documented via /connect/token, this does not work correctly for me from PHP, or it results in a token with very limited usability. If I instead use the same login flow as the web client, i.e. via /webclient/api/Login/GetAccessToken, I still only receive a token with user-level permissions.
This behavior occurs regardless of whether I log in with the admin account or a dedicated API user—both are defined as System Owner in the 3CX Management Console. API endpoints that require system-level permissions, such as /xapi/v1/Parameters, consistently return 403 Forbidden when called from PHP.
In contrast, access using PowerShell or Postman works flawlessly with the same user and provides full system_owner access to those exact endpoints. This strongly suggests that the issued token receives different claims or permissions depending on the login context (PHP vs. Web Client / Postman / PowerShell).
Therefore, my questions are:
Thank you in advance for any clarification.
When I perform the login as officially documented via /connect/token, this does not work correctly for me from PHP, or it results in a token with very limited usability. If I instead use the same login flow as the web client, i.e. via /webclient/api/Login/GetAccessToken, I still only receive a token with user-level permissions.
This behavior occurs regardless of whether I log in with the admin account or a dedicated API user—both are defined as System Owner in the 3CX Management Console. API endpoints that require system-level permissions, such as /xapi/v1/Parameters, consistently return 403 Forbidden when called from PHP.
In contrast, access using PowerShell or Postman works flawlessly with the same user and provides full system_owner access to those exact endpoints. This strongly suggests that the issued token receives different claims or permissions depending on the login context (PHP vs. Web Client / Postman / PowerShell).
Therefore, my questions are:
- Is it by design that external clients such as PHP only receive user-level tokens, even when authenticating with valid System Owner users?
- If so, what is the reason for this restriction?
- If not, what is the official or recommended approach to obtain a fully system_owner-capable token when authenticating from PHP?
Thank you in advance for any clarification.