Jda: Route endpoints

Created on 13 Sep 2016  路  20Comments  路  Source: DV8FromTheWorld/JDA

In JDA 3.x, we now specify all Discord Routes. These are the routes left to be added.
Class can be seen here: link
Thanks to @MinnDevelopment for writing up this list.

Base: https://discordapp.com/api/

Global Endpoints

  • [x] voice/regions GET // Voice Regions
  • [x] gateway GET
  • [x] invites/:code DELETE // Delete invite
  • [x] invites/:code GET // Get invite
  • [x] invites/:code POST // Accept invite
  • [x] users/@me GET // Get self
  • [x] users/@me PATCH // Update self
  • [x] users/@me/guilds/:guild_id DELETE // leave guild
  • [x] users/@me/channels GET // Private channels
  • [x] users/@me/channels POST // Create Private Channel
  • [x] channels/:channel_id DELETE // Delete channel/close PM or group
  • [x] channels/:channel_id PATCH
  • [x] channels/:channel_id/messages GET
  • [x] channels/:channel_id/messages POST
  • [x] channels/:channel_id/messages/:message_id DELETE
  • [x] channels/:channel_id/messages/:message_id PATCH
  • [x] channels/:channel_id/messages/:message_id/reactions/:encoded/@me PUT
  • [x] channels/:channel_id/messages/:message_id/reactions/:encoded/@me DELETE
  • [x] channels/:channel_id/messages/:message_id/reactions DELETE // delete all reactions
  • [x] channels/:channel_id/typing POST
  • [x] channels/:channel_id/pins GET
  • [x] channels/:channel_id/pins/:message_id PUT
  • [x] channels/:channel_id/pins/:message_id DELETE
  • [x] channels/:channel_id/invites GET
  • [x] channels/:channel_id/invites POST
  • [x] channels/:channel_id/permissions GET
  • [x] channels/:channel_id/permissions/:permissionoverride_id GET
  • [x] channels/:channel_id/permissions/:permissionoverride_id PUT //Create permoverride
  • [x] channels/:channel_id/permissions/:permissionoverride_id PATCH
  • [x] channels/:channel_id/permissions/:permissionoverride_id DELETE
  • [x] channels/:channel_id/webhooks POST // Create Webhook
  • [x] channels/:channel_id/webhooks GET // Get channel webhooks
  • [x] users/@me/guilds GET
  • [x] guilds/:guild_id GET
  • [x] guilds/:guild_id PATCH
  • [x] guilds/:guild_id/channels GET
  • [x] guilds/:guild_id/channels POST
  • [x] guilds/:guild_id/channels PATCH //Batch modify channel positions
  • [x] guilds/:guild_id/bans GET
  • [x] guilds/:guild_id/bans/:user_id PUT
  • [x] guilds/:guild_id/bans/:user_id DELETE
  • [x] guilds/:guild_id/members/:user_id DELETE // kick user
  • [x] guilds/:guild_id/members/:user_id PATCH
  • [x] guilds/:guild_id/members/@me/nick PATCH // Update own nick
  • [x] guilds/:guild_id/prune POST
  • [x] guilds/:guild_id/prune GET // Get users that would be kicked by prune?
  • [x] guilds/:guild_id/roles POST
  • [x] guilds/:guild_id/roles GET
  • [x] guilds/:guild_id/roles/:role_id GET
  • [x] guilds/:guild_id/roles/:role_id DELETE
  • [x] guilds/:guild_id/roles/:role_id PATCH
  • [x] guilds/:guild_id/invites GET
  • [x] guilds/:guild_id/integrations GET
  • [x] guilds/:guild_id/integrations POST // Create Guild integrations
  • [x] guilds/:guild_id/integrations/:integration_id PATCH
  • [x] guilds/:guild_id/integrations/:integration_id DELETE
  • [x] guilds/:guild_id/integrations/:integration_id/sync POST
  • [x] guilds/:guild_id/embed GET //Guild Embed
  • [x] guilds/:guild_id/embed PATCH
  • [x] guilds/:guild_id/emojis GET
  • [x] guilds/:guild_id/webhooks GET // Get guild webhooks
  • [x] webhooks/:webhook_id GET // Get Webhook
  • [x] webhooks/:webhook_id PATCH //Modify webhook
  • [x] webhooks/:webhook_id DELETE //Delete webhook
  • [x] webhooks/:webhook_id/:webhook_token GET // Get webhook with token
  • [x] webhooks/:webhook_id/:webhook_token PATCH //modify webhook with token
  • [x] webhooks/:webhook_id/:webhook_token DELETE //Delete webhook with token
  • [x] webhooks/:webhook_id/:webhook_token POST //Execture webhook
  • [x] webhooks/:webhook_id/:webhook_token/slack POST //Execture slack webhook

Bot Only

  • [x] channel/:channel_id/messages/bulk-delete POST // Bulk delete(guild only)
  • [x] channel/:channel_id/messages/:message_id GET // Get Message By ID
  • [x] oauth2/applications/@me GET

Client Only

  • [x] friend-suggestions GET // Get friend suggestions (displayed in the add friend tab)
  • [x] track POST // Track endpoint
  • [x] guilds POST // Create guild, duh... {name: "fgh", region: "eu-central", icon: null}
  • [x] guilds/:guild_id/delete POST // Delete guild with 2fa code
  • [x] guilds/:guild_id/ack POST // Ack a guild
  • [x] guilds/:guild_id/emojis POST //Create emoji
  • [x] guilds/:guild_id/emojis/:id PATCH //Edit emoji
  • [x] guilds/:guild_id/emojis/:id DELETE //Remove emoji
  • [x] users/@me/connections GET // Get Connections (twitch,steam,skype...)
  • [x] users/@me/settings PATCH // User-/Privacy Settings
  • [x] users/@me/notes/:user_id PUT // Notes
  • [x] users/@me/guilds/:guild_id/settings PATCH // Notification Settings for a Guild
  • [x] users/@me/mentions?limit=25&roles=true&everyone=false GET // Recent Mentions
  • [x] users/@me/mfa/codes POST // Backup codes
  • [x] users/@me/mfa/totp/disable POST // Disable 2FA
  • [x] users/@me/mfa/totp/enable POST // Enable 2FA
  • [x] users/@me/relationships GET // Get Friends/Blocks/Incoming/Outgoing
  • [x] users/@me/relationships/:user_id PUT // Add Friend/ Block
  • [x] users/@me/relationships/:user_id DELETE // Delete Block/Unfriend/Ignore Request/Cancel Outgoing
  • [x] channels/:channel_id/recipients GET // Get Group members
  • [x] channels/:channel_id/recipients/:user_id PUT // Add Group member by id
  • [x] channels/:channel_id/recipients/:user_id GET // Group member by id
  • [x] channels/:channel_id/recipients/:user_id DELETE // Kick member
  • [x] channels/:channel_id/messages/:messages_id/ack // Ack a message
  • [x] channels/:channel_id/call/ring POST //start call
  • [x] channels/:channel_id/call/stop-ringing POST //deny call
  • [x] oauth2/applications GET
  • [x] oauth2/applications POST
  • [x] oauth2/applications/:application_id GET
  • [x] oauth2/applications/:application_id PUT
  • [x] oauth2/applications/:application_id DELETE
  • [x] oauth2/applications/:application_id/bot POST
  • [x] oauth2/applications/:application_id/reset POST
  • [x] oauth2/applications/:application_id/bot/reset POST
  • [x] oauth2/tokens GET
  • [x] oauth2/tokens/:auth_id GET
  • [x] oauth2/tokens/:auth_id DELETE
enhancement

All 20 comments

guilds GET
should be
users/@me/guilds GET

guilds/:guild_id/channels/:channel_id PATCH Does not exist based on API docs. Does it actually exist?

added guilds/:guild_id/channels PATCH. This is the batch channel position change endpoint.

RE: guilds/:guild_id/channels/:channel_id PATCH

Does not exist, I checked and it was 404.

guilds/:guild_id/invites POST

POST is not allowed for this endpoint. Use channels/:channel_id/invites POST instead.

Missing endpoint: guilds/:guild_id/integrations GET

So guilds/:guild_id/invites POST effectively does not exist, yes? That means that you can only create invites with channels/:channel_id/invites POST right?

guilds/:guild_id/invites exists but the only allowed method is GET.
POST returned status 405: Method not allowed
Creating an invite is only possible through the channels endpoint.

guilds/:guild_id DELETE is not used to delete a guild.
It is used to leave a guild.
Reason: 2FA Guild delete requires a code which has to be provided to guilds/:guild_id/delete using POST.
Note: Without 2FA = POST {}
Edit: The one implemented here should not be listed under client only, renamed to LEAVE_GUILD and the correct endpoint is users/@me/guilds/:guild_id DELETE (returns 401 status if owned)

Track endpoint: track POST
It takes a JSON object with the contents:

  • event
    Client UI event (open_popup for instance)
  • properties
    a JSON object with Type and Source ({Type: "Instant Invite Modal", Source: "Invite Notice"})
  • token
    a special authorization token consisting of a base64 encoded userID and a random base64 string.

Emoji endpoints:
guilds/:guild_id/emojis POST //Create emoji
guilds/:guild_id/emojis/:id PATCH //Edit emoji
guilds/:guild_id/emojis/:id DELETE //Remove emoji

POST/PATCH body:
{"name":"abal","roles":["209445206016131073"]}

Note: name is required for POST.

Edit: roles is not available to client accounts anymore, unintended bug.

channel/:channel_id/messages/bulk_delete
should be
channel/:channel_id/messages/bulk-delete
since the former one was deprecated

Also Bulk Delete is listed as PUT here while on discord docs it's POST.

Jake told me that bulk_delete would remain as such for the remainder of gateway v6, only switching when moving to v7, however if bulk-delete works for v6 as well I will switch.

Also, can i get a testing confirmation that it should be POST, not PUT?

No PUT returns status 405 while POST works. (Tested with both unversioned API endpoints)
Edit: Updated the endpoint to POST

We should compare this with the list provided in the official docs #219

I would like to get the rest of these into JDA during the 3.1 development cycle even if we aren't using them yet.

I will cross out any routes that we decide not to include like accepting invites

All routes from this list have now been implemented into JDA.

Can anyone explain how I would go about using this to send a DM to a user?

Go to discord.gg/0hMr4ce0tIl3SLv5 to receive the needed help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

M4itreG picture M4itreG  路  5Comments

StijnSimons picture StijnSimons  路  3Comments

xeu100 picture xeu100  路  5Comments

Bungeefan picture Bungeefan  路  6Comments

andrei1058 picture andrei1058  路  6Comments