Personal Access Token giving me a 401 error

Hello,

I am working on a project that requires me to fetch data of some of my repos using GraphQL but i keep getting a 401 error.

I think this has to do with the scopes/permissions of my token, funny thing is, I check all fields when i want to generate this token, but I noticed that on the top of where this token gets generated, there is a message that says something about not all permissions are being saved. And maybe this is where the. issue lies.

Please how do i resolve

1 Like

:wave: Welcome!

If you’re seeing this

Some of the scopes you’ve selected are included in other scopes. Only the minimum set of necessary scopes has been saved.

That’s normal. This just means that some of the things you’ve selected inherently include others - like, the ability to delete a thing includes the ability to see that it exists for instance, so we just select only the minimum scopes you need.

You can run this to try your PAT out. If you want to show us the output, please make sure you remove your token before you post. That will be in the command, but also potentially in the output.

curl -v -H "Authorization: bearer TOKEN_HERE" -X POST -d "{ \"query\": \"query { viewer { login }}\" }" 'https://api.github.com/graphql'
1 Like