Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Guilds: 401 Unauthorized

Tags:

discord

I'm working on a web app that uses Discord to sign and I was hoping to be able to pull the user's guild information once signed. I've already gone through the Authorization code grant process and have successfully retrieved the user's Access Token (Bearer). The Access Token has the 'identity' and 'guild' scope. When trying to retrieve the guild using the endpoint I get a 401 'unauthorized' error. I'm including the Bearer Access Token in the header of the request.

Endpoint: GET/guilds/{guild.id}

I'm unable to see what I'm missing/doing wrong. Any help would be appreciated.

Postman Screen Shot

like image 460
Brian Anstett Avatar asked Mar 09 '26 20:03

Brian Anstett


1 Answers

The guilds OAuth scope is not described to give access to the GET /guilds/{guild.id} route. The scope only seems to give access to GET /users/@me/guilds, which returns limited information.

{
    "id": "80351110224678912",
    "name": "1337 Krew",
    "icon": "8342729096ea3675442027381ff50dfe",
    "owner": true,
    "permissions": 36953089
}

https://discordapp.com/developers/docs/resources/user#get-current-user-guilds

like image 67
Freya Avatar answered Mar 12 '26 17:03

Freya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!