Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Reysa's avatar
Level 1

Discord API (give role to guild member) returns 405

Hello.

I'm trying to give role to authorized user after logging in to website with discord OAuth.

I used GuzzleHttp and this my code:

$response = Http::PUT('api/guilds/{guild id}/members/{user id}/roles/{role id}');

return $response->json();

(I replaced ids and api link just here it's ok in my code)

But it returns 405 Method not allowed. problem is in Discord API documents method is PUT

I even send header with "withToken" but it didn't worked

0 likes
0 replies

Please or to participate in this conversation.