OAuth2 Issues - 401 on requests when using it.
We need to make use of some API calls that only have OAuth2 as an authentication option for them, so we're making changes to our existing API client (which works fine). Unfortunately whenever we make a request using the OAuth token we get a 401 unauthorized back.
We've followed the steps outlined on the developer portal and in the PHP WHMCS example (we're not using the Acronis PHP lib though).
- Register a client and obtain client_id and client_secret from /api/2/clients - Done
- Use client_id and client_secret to issue a client_credentials token from /api/2/idp/token - Done
- Set header: Authorization: Bearer <access_token> - Done
- Also tried passing access_token=<access_token> as a parameter instead
At no point do we get any errors except when we try and make a request to any API endpoint once we've got the OAuth part handled.
It's driving me to distraction at the moment, so any help is appreciated.