Civilian Requests
The API has been deprecated and is no longer in use.
Civilian Information
Now we are going to request an already existing civilians information, For this you will require an already create civilian character inside your guild, Let make the first request with a JSON Body.
Civilian Information
GET https://roleplaybot.xyz/api/civilian/info
Returns a civilians information
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Request Body
name*
CIV_NAME
Civilian Characters Name
{
"guildID": "GUILD_ID",
"userID": "USER_ID",
"userName": "USER_NAME",
"civilian": [],
"citations": [],
"fines": [],
"arrests": [],
"hospitalRecords": []
}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)"
}Deleting, Editing And Creating Civilians
With the API you can form almost anything that you can do with the normal version of RoleplayBot, Leaving it ideal for individual projects and different variations of RoleplayBot. If you have created something with RoleplayBot's API then please get in contact with us, We Would love to reward active developers!
Delete Civilian
DELETE https://roleplaybot.xyz/api/civilian/delete
Deletes a civilian character
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Request Body
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)"
}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
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>)"
}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)"
}Create Civilian
POST https://roleplaybot.xyz/api/civilian/create
Creates a civilian character with supplied parameters
Headers
Authorization*
API_KEY
API Authorization Key
Guild*
GUILD_ID
Discord Guild ID
Request Body
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)"
}Listing Civilians
To list and view the current amount of active civilians registered inside your guild using the following endpoint, The civilians array with provide an object per civilian. Run the request to get a better idea of the structure
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
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)"
}Moving On
Now that you have the general idea of GET, POST, PATCH and DELETE requests its time to move on and expand your knowledge, We recommend checking out the endpoints section for a list of API Endpoints and methods.
Last updated
Was this helpful?