API - NamelessMC/Nameless-Link GitHub Wiki
GET
/status
(v1.0, v1.1, v1.2, v2.0, v3, v4, v5)
Response (/text/plain
)
success
(no newline)
POST
/roleChange
(v1.0, v1.1, v1.2)
warning: this description is for old versions, please read on for the newer endpoint description
request (json object):
guild_id
- Discord guild iduser_id
- Discord user idapi_key
- Website API keyremove_role_id
- Id of role to add to this useradd_role_id
- Id of role to remove from this user
responses:
badparameter
- Missing or invalid parameter, see aboveerror
- Bot internal error, not the API caller's faultinvguild
- Guild does not exist or bot is not in guildinvuser
- User does not exist or is not in specified guildnotlinked
- Bot is not linked to website for this guildunauthorized
- Invalid API keyinvrole
hierarchy
- Just a warning, not an error. Means that the bot could not add/remove roles because they are higher than the bot role. If multiple roles are specified (add and remove) the other may have been changed successfully.success
POST
/roleChange
(v2, v3, v4)
Warning: this endpoint is deprecated, use applyRoleChanges instead. Due to excessive load, the official bot ignores roleChange requests by always responding with fullsuccess
without doing anything.
Request (json object):
guild_id
- Discord guild iduser_id
- Discord user idapi_key
- Website API keyroles
- array of objectsid
- role idaction
- 'add' or 'remove'
Responses:
badparameter
- Missing or invalid parameter, see aboveerror
- Bot internal error, not the API caller's faultinvguild
- Guild does not exist or bot is not in guildinvuser
- User does not exist or is not in specified guildnotlinked
- Bot is not linked to website for this guildunauthorized
- Invalid API keypartsuccess
- Just a warning, not an error. Means that the bot could not add/remove some roles because they are higher than the bot role or the role id is invalid. If multiple roles are specified, others may have been changed successfully.fullsuccess
- All roles have been added/removed successfully
POST
/applyRoleChanges
(v4 since 2022-11-08, v5)
This API method replaces /roleChange
.
Request (json object)
guild_id
- Discord guild id stringapi_key
- Website API keyrole_changes
- Array of objectsuser_id
- Discord user id stringrole_id
- Discord role id stringaction
- string 'add' or 'remove'
Response (application/json
)
status
stringmeta
may or may not be present to provide additional info. Only meant for developers, do not display this to end users (except for log files etc)role_changes
- array of objectsuser_id
stringrole_id
stringstatus
- see below
Possible status
responses:
bad_request
, HTTP 400 - Missing or invalid parameternot_linked
, HTTP 400unauthorized
, HTTP 401 - Invalid API keyinvalid_guild
, HTTP 400 - guild id is invalid or bot is not in guildsuccess
, HTTP 200 - NOTE some roles changes may not have been applied successfully, also check status for every role change!
Possible role_changes
->status
responses:
none
the role was already added or was already removed, no action was neededadded
the role was addedremoved
the role was removedno_permission
the bot could not add or remove the role because of role hierarchy; the bot only has permission to modify roles below its own role.invalid_user
user id is invalid or user is not member of guildinvalid_role
role id is invalid
/sendDirectMessage
(v5 since 2024-06-08)
POST Request (json object):
guild_id
numberuser_id
numberapi_key
stringmessage
string