🖥️
RoleplayBot Docs
  • Home
  • Website
  • Support Server
  • Invite
  • Information
    • Configuration
    • Permissions
    • Getting Started
    • Data Transfer
    • RoleplayBot+
  • Advanced Information
    • CAD/MDT Information
      • Law Enforcement MDT
      • Fire Department MDT
      • Dispatcher MDT
    • FAQ
    • Bug Tracker
  • API Documentation
    • API Introduction
    • Guides
      • API Authorization
      • Getting Started
      • Civilian Requests
      • Building a Project
    • Endpoints
      • Civilian Endpoints
      • Vehicle Endpoints
      • Firearm Endpoints
      • Medical Endpoint
      • Law Enforcement Endpoints
    • Errors
      • Error Codes
      • Rate limited
Powered by GitBook
On this page
  • Firearm Endpoints
  • Firearm Information (Search)
  • List Firearms
  • Create Firearm
  • Edit Firearm
  • Delete Vehicle

Was this helpful?

  1. API Documentation
  2. Endpoints

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

Name
Type
Description

Authorization*

API_KEY

API Authorization Key

Guild*

GUILD_ID

Discord Guild ID

Request Body

Name
Type
Description

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

Name
Type
Description

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

Name
Type
Description

Authorization*

API_KEY

API Authorization Key

Guild*

GUILD_ID

Discord Guild ID

Request Body

Name
Type
Description

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

Name
Type
Description

Authorization*

API_KEY

API Authorization Key

Guild*

GUILD_ID

Discord Guild ID

Request Body

Name
Type
Description

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

Name
Type
Description

Authorization*

API_KEY

API Authorization Key

Guild*

GUILD_ID

Discord Guild ID

Request Body

Name
Type
Description

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)"
}
PreviousVehicle EndpointsNextMedical Endpoint

Last updated 1 year ago

Was this helpful?