🖥️
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
  • Civilian Endpoints
  • Civilian Information
  • List Civilians
  • Create Civilian
  • Edit Civilian
  • Civilian BOLO
  • Civilian Deceased
  • Delete Civilian

Was this helpful?

  1. API Documentation
  2. Endpoints

Civilian Endpoints

The API has been deprecated and is no longer in use.

Civilian Endpoints

Raw list of civilian endpoints:

  • GET /civilian/info

  • GET /civilian/list

  • POST /civilian/create

  • PATCH /civilian/edit

  • PATCH /civilian/bolo

  • PATCH /civilian/deceased

  • DELETE /civilian/delete

List of civilian endpoint methods

If you see the empty "civilian" array or civilian: [] This is simply just the placeholder for the civilian object structure, Which looks like this in all major requests: (Inside the array)

{            
   deceased: "DECEASED",
   bolo: "BOLO",
   boloReason: "REASON",
   civilianAge: "AGE",
   civilianDOB: "DOB",
   civilianGender: "GENDER",
   civilianHairColor: "HAIR COLOR",
   civilianHeight: "HEIGHT",
   civilianWeight: "WEIGHT",
   civilianAddress: "ADDRESS",
   civilianOccupation: "OCCUPATION",
   registrationTimestamp: "TIMESTAMP",
}

Civilian Information

GET https://roleplaybot.xyz/api/civilian/info

Returns a civilians information

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 Characters Name (String)

Citations, Fine, Arrests and Hospital Record arrays provide an object per action.

{
    "guildID": "GUILD_ID",
    "userID": "USER_ID",
    "userName": "USER_NAME",
    "civilian": [],
    "citations": [
        {
            "officerName": "OFFICER_NAME",
            "officerID": "OFFICER_ID",
            "amount": "AMOUNT",
            "charges": "CHARGES",
            "timestamp": "TIMESTAMP"
        }
    ],
    "fines": [
        {
            "officerName": "OFFICER_NAME",
            "officerID": "OFFICER_ID",
            "amount": "AMOUNT",
            "charges": "CHARGES",
            "timestamp": "TIMESTAMP"
        }
    ],
    "arrests": [
        {
            "officerName": "OFFICER_NAME",
            "officerID": "OFFICER_ID",
            "time": "TIME",
            "charges": "CHARGES",
            "timestamp": "TIMESTAMP"
        }
    ],
    "hospitalRecords": [
        {
            "medicName": "MEDIC_NAME",
            "medicID": "MEDIC_ID",
            "injures": "INJURES",
            "time": "TIME",
            "timestamp": "TIMESTAMP"
        }
    ]
}

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)"
}

Civilian character could not be found

{
    error: "404 Not found",
    details: "Character not found (10023)"
}

List Civilians

GET https://roleplaybot.xyz/api/civilian/list

Provides an array with objects per active civilian characters, also returns a value specifying the current amount of civilians

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 civilians found and listed

{
    amount: "CIV_AMOUNT",
    guildID: "GUILD_ID",
    civilians: []
}

There is no registered civilian characters inside the guild

{
    error: "404 Not found",
    details: "Unable to find any civilian characters (20060)"
}

Create Civilian

POST https://roleplaybot.xyz/api/civilian/create

Creates a civilian character with supplied parameters

Headers

Name
Type
Description

Authorization*

API_KEY

API Authorization Key

Guild*

GUILD_ID

Discord Guild ID

Request Body

Name
Type
Description

userID*

USER_ID

Creating Users ID (String)

userName*

USER_NAME

Creating Users Name (String)

name*

CIV_NAME

Civilian Name (String) (<100 Characters)

age*

CIV_AGE

Civilian Age (Number) (<100)

dob*

CIV_DOB

Civilian Date Of Birth (String)

gender*

CIV_GENDER

Civilian Gender (Takes: Male, Female Or Other)

hair*

CIV_HAIR

Civilian Hair Color (String)

weight*

CIV_WEIGHT

Civilian Weight in KG (Number) (<500)

height*

CIV_HEIGHT

Civilian Height in CM (Number) (<500)

address*

CIV_ADDRESS

Civilian Address (String)

occupation*

CIV_OCCUPATION

Civilian Occupation (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>)"
}

A civilian with that specified name already existing inside your guild

{
    error: "400 Bad request",
    details: "Civilian character already exists (10020)"
}
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: "Successfully created civilian",
    civilian: []
}

Database error, Unable to register civilian character inside database. Contact RoleplayBot support

{
    error: "500 Internal server error",
    details: "Unable to execute request (10022)"
}

Edit Civilian

PATCH https://roleplaybot.xyz/api/civilian/edit

Edits a civilian character with the specified field and value Valid Fields: - hair color (Value: String) - name (Value: String) - age (Value: Number <100) - dob (Value: String) - height (Value: Number <500) - weight (Value: Number <500) - occupation (Value: String) - address (Value: String)

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>)"
}

Setting value is the same as the current value

{
    error: 'Character <FIELD> is already <VALUE> (<ERR_CODE>)'
}

Civilian successfully edited

{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userName: "USER_NAME",
    userID: "USER_ID",
    field: "FIELD",
    value: "VALUE",
    oldValue: "OLD_VALUE",
    success: 'Field updated',
    civilian: []
}

Database error, Unable to edit civilian character inside database. Contact RoleplayBot support

{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}

Civilian BOLO

PATCH https://roleplaybot.xyz/api/civilian/bolo

Call to activate or deactivate a BOLO

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)

bolo*

BOLO

Set BOLO (Boolean) (*True = Activate BOLO)

reason

REASON

BOLO Reason (Required when bolo is set to true)

Accessing a guild that is not authorized apart of your API key

{
    "error": "403 Forbidden",
    "details": "Unauthorised guild access (20058)"
}

Requested civilian character cannot be found

{
    error: "404 Not found",
    details: "Character not found (10023)"
}

Civilian has an active BOLO

{
    guildID: "GUILD",
    userName: "USER_NAME",
    userID: "USER_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    error: 'BOLO is already (active/incative)',
    civilian: []
}

Civilian doesn't have an active BOLO

{
    guildID: "GUILD",
    userName: "USER_NAME",
    userID: "USER_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    success: 'BOLO set (active/inactive)',
    civilian: []
}

The bolo or reason field is missing or invalid (Incorrect Type)

{
    error: "400 Bad request",
    details: "Invalid <FIELD> Provided (<ERR-CODE>)"
}

Civilian Deceased

PATCH https://roleplaybot.xyz/api/civilian/deceased

Sets a civilian deceased. WARNING: This action is irreversible, Once a civilian is set deceased it can no longer be used.

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)

deceased*

DECEASED

Deceased Value (True Boolean) (True = Set Deceased)

{
    guildID: "GUILD",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userName: "USER_NAME",
    userID: "USER_ID",
    deceased: "DECEASED",
    error: 'Character is already marked deceased'
}

The deceased field is missing or invalid (Incorrect Type)

{
    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)"
}

Civilian has been marked deceased

{
    guildID: "GUILD_ID",
    civilianName: "CIV_NAME",
    civilianID: "CIV_ID",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: 'Marked deceased',
    civilian: []
}

Delete Civilian

DELETE https://roleplaybot.xyz/api/civilian/delete

Deletes 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)

Successfully deleted civilian

{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    userName: "USER_NAME",
    userID: "USER_ID",
    success: "Deleted civilian",
    civilian: []
}
{
    "error": "400 Bad request",
    "details": "Invalid <FIELD> provided (<ERR-CODE>)"
}

Database error, Unable to delete civilian character inside database. Contact RoleplayBot support

{
    error: "500 Internal server error",
    details: "Unable to execute request (10021)"
}
PreviousEndpointsNextVehicle Endpoints

Last updated 1 year ago

Was this helpful?