[Django]-Python requests, keep getting 401 error when accessing an API

4đź‘Ť

âś…

The documentation seems to point out that the value is actually token=TOKEN, not just the token itself…

AUTHORIZATION: Token token=my_organization_server_api_key

Try replacing

'Authorization': 'Token <MyApiKeyIsHere>',

with this, and see if it responds properly

'Authorization': 'Token token=<MyApiKeyIsHere>',
👤Bryan

0đź‘Ť

Try to get result:

curl -X GET -H “Content-Type: application/json” -H “AUTHORIZATION: Token token=exxxx….xxxxxxxxxxxx6” https://manager.gimbal.com/api/applications

headers = {
… “Authorization: Token “,
… “content-type: application/json”
… }

👤jcasoft

Leave a comment