Firearm Endpoints
The API has been deprecated and is no longer in use.
Firearm Endpoints
Raw list of firearm endpoints:
GET /firearm/info
GET /firearm/list
POST /firearm/create
PATCH /firearm/edit
DELETE /firearm/delete
List of firearm endpoint methods
If you see the empty "firearm" array or firearm: [] This is simply just the placeholder for the firearm object structure, Which looks like this in all major requests: (Inside the array)
{
id: "ID",
userID: "USER_ID",
userName: "USER_NAME",
civilianID: "CIV_ID",
civilianName: "CIV_NAME",
stolen: "STOLEN",
serialNumber: "SERIAL_NUMBER",
model: "MODEL",
timestamp: "TIMESTAMP"
}Firearm Information (Search)
GET https://roleplaybot.xyz/api/firearm/info
Searches for a registered firearm, Returns information if it exists.
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Request Body
serialNumber*
SERIAL_NUMBER
Firearm Serial Number (String) (# ID)
Firearm found and information displayed
{
found: true,
guildID: "GUILD_ID",
firearm: []
}Invalid or missing field
{
"error": "400 Bad request",
"details": "Invalid <FIELD> provided (<ERR-CODE>)"
}Accessing a guild that is not authorized apart of your API key
{
"error": "403 Forbidden",
"details": "Unauthorised guild access (20058)"
}{
found: false,
error: "404 Not found",
details: "Firearm not found (10023)"
}List Firearms
GET https://roleplaybot.xyz/api/firearm/list
Provides every registered vehicle inside the guild
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Accessing a guild that is not authorized apart of your API key
{
"error": "403 Forbidden",
"details": "Unauthorised guild access (20058)"
}One or more firearms found and listed
{
amount: "FIREARM_AMOUNT",
guildID: "GUILD_ID",
firearms: []
}There is no registered firearms inside the guild
{
error: "404 Not found",
details: "Unable to find any firearms (20060)"
}Create Firearm
POST https://roleplaybot.xyz/api/firearm/create
Registers a firearm to a civilian character
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Request Body
name*
CIV_NAME
Civilian Name (String)
model*
MODEL
Firearm Model (String)
color*
COLOR
Firearm Color (String)
Accessing a guild that is not authorized apart of your API key
{
"error": "403 Forbidden",
"details": "Unauthorised guild access (20058)"
}Invalid or missing field
{
"error": "400 Bad request",
"details": "Invalid <FIELD> provided (<ERR-CODE>)"
}Registered vehicle
{
guildID: "GUILD_ID",
civilianID: "CIV_ID",
civilianName: "CIV_NAME",
userName: "USER_NAME",
userID: "USER_ID"
success: "Registered firearm",
firearm: []
}Database error, Unable to register firearm inside database. Contact RoleplayBot support
{
error: "500 Internal server error",
details: "Unable to execute request (10022)"
}Edit Firearm
PATCH https://roleplaybot.xyz/api/firearm/edit
Edits a firearm with the specified field and value Valid Fields: - color (Value: String) - stole (Value: Boolean)
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Request Body
name*
CIV_NAME
Civilian Name (String)
field*
FIELD
Field to edit (Must be listed in valid fields)
value*
VALUE
Value to set (Must match allocated field)
Accessing a guild that is not authorized apart of your API key
{
"error": "403 Forbidden",
"details": "Unauthorised guild access (20058)"
}{
"error": "400 Bad request",
"details": "Invalid <FIELD> provided (<ERR-CODE>)"
}Firearm successfully edited
{
guildID: "GUILD_ID",
serialNumber: "SERIAL_NUMBER",
civilianName: "CIV_NAME",
civilianID: "CIV_ID",
userID: "USER_ID",
userName: "USER_NAME",
plate: "PLATE",
success: "Updated firearm to <...>",
firearm: []
}Database error, Unable to edit firearm inside database. Contact RoleplayBot support
{
error: "500 Internal server error",
details: "Unable to execute request (10021)"
}Delete Vehicle
DELETE https://roleplaybot.xyz/api/firearm/delete
Deletes a firearm using the serial number
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Request Body
serialNumber*
SERIAL_NUMBER
Firearm Serial Number (String) (# ID)
Successfully deleted firearm
{
guildID: "GUILD_ID",
id: "VEHICLE_ID",
success: 'Deleted registered firearm'
}{
"error": "400 Bad request",
"details": "Invalid <FIELD> provided (<ERR-CODE>)"
}Database error, Unable to delete firearm inside database. Contact RoleplayBot support
{
error: "500 Internal server error",
details: "Unable to execute request (10021)"
}Last updated
Was this helpful?