Forum Discussion

amandeepmaman's avatar
amandeepmaman
Contributor
6 years ago

Getting unauthorized error while trying to access apis

I am trying to access the response generated here with postman or an ajax call:

https://logmein.stage.lithium.com/api/2.0/search?q=SELECT+%2A+FROM+messages

This works fine when entered in the search bar of the browswer.

I am able to get the response I want, but when I make an ajax call with that url, or use postman to access it, I get an Unauthorized (401) error.

Below is the url which I generated by following the documentation here, with my client_ID and redirect_url.

https://[myCompany].stage.lithium.com/auth/oauth2/authorize?client_id=[My Client ID]&response_type=code&redirect_uri=[my redirect page]/getaccessToken

Also, using postman, I get the unauthorized 401 error.