Hi @imsam67
That code snippet looks fine.
There can be a couple of reasons why your API is rejecting your requests:
- check that you are sending the access_token correctly, this is dependant on how the API is built but the standard is to send the access_token in the Authorization header with the bearer format (e.g.
Authorization: Bearer <access_token>
) - check that your API is correctly validating the access_token (e.g. if using the standard Authorization header method, make sure to strip out the
Bearer
portion of the header)