Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token invalid via Dequests & Documentation #21

Open
Normanras opened this issue Apr 5, 2022 · 0 comments
Open

Token invalid via Dequests & Documentation #21

Normanras opened this issue Apr 5, 2022 · 0 comments

Comments

@Normanras
Copy link

Normanras commented Apr 5, 2022

Got another one for you guys, please close out if it's human error.

If I run the command https GET api.spacetraders.io/my/account token==$token from my terminal, I get back the correct information. If I replace $token with the actual string token, it also returns the correct information.

However, from the documentation if I put in my token and hit "send" I get the following:

Error 401: 
{
    "error": {
        "message": "Token was invalid or missing from the request. Did you confirm sending the token as a query parameter or authorization header?",
        "code": 40101
    }
}

Here is the python script that returns the same 401 error.

import requests                                                                        
token="XXXXXX"
authheader={'Authorization' : '{token}'}

response=requests.get("https://api.spacetraders.io/my/account", "{authheader}")
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant