> For the complete documentation index, see [llms.txt](https://docs.roleplaybot.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roleplaybot.xyz/api/endpoints/medical.md).

# Medical Endpoint

{% hint style="danger" %}
The API has been deprecated and is no longer in use.
{% endhint %}

### Medical Endpoints

Raw list of medical endpoints:

* GET /medical/records
* POST /medical/admit

List of medical endpoint methods

## Medical Records (Search)

<mark style="color:blue;">`GET`</mark> `https://roleplaybot.xyz/api/medical/records`

Searches a civilians medical records

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                   | Type      | Description            |
| -------------------------------------- | --------- | ---------------------- |
| name<mark style="color:red;">\*</mark> | CIV\_NAME | Civilian Name (String) |

{% tabs %}
{% tab title="200: OK Admissions Found" %}
Found one or more hospital admissions (Displays one or more objects inside the admissions array and empty if none are found)

<pre class="language-javascript"><code class="lang-javascript">{
<strong>    guildID: "GUILD_ID",
</strong><strong>    civilianName: "CIV_NAME",
</strong>    civilianID: "CIV_ID",
    amount: "AMOUNT",
    admissions: [
        {
            count: "COUNT",
            unitsName: "UNIT_NAME",
            unitsID: "UNIT_ID",
            time: "RECOVERY_TIME",
            injures: "INJURES",
            timestamp: "TIMESTAMP"
        }
    ]
}
</code></pre>

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

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

{% endtab %}

{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

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

{% endtab %}

{% tab title="404: Not Found Civilian not found" %}

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

{% endtab %}
{% endtabs %}

## Medical Admit

<mark style="color:green;">`POST`</mark> `https://roleplaybot.xyz/api/medical/admit`

Admits a user to hospital and creates record

#### Headers

| Name                                            | Type      | Description           |
| ----------------------------------------------- | --------- | --------------------- |
| Authorization<mark style="color:red;">\*</mark> | API\_KEY  | API Authorization Key |
| Guild<mark style="color:red;">\*</mark>         | GUILD\_ID | Discord Guild ID      |

#### Request Body

| Name                                       | Type       | Description                              |
| ------------------------------------------ | ---------- | ---------------------------------------- |
| name<mark style="color:red;">\*</mark>     | CIV\_NAME  | Civilian Name (String)                   |
| time<mark style="color:red;">\*</mark>     | TIME       | Recovery time (String) (>5000) (Seconds) |
| injures<mark style="color:red;">\*</mark>  | INJURES    | List of injures (String)                 |
| unitName<mark style="color:red;">\*</mark> | UNIT\_NAME | Admitting units name (String)            |
| unitID<mark style="color:red;">\*</mark>   | UNIT\_ID   | Admitting units ID (String)              |

{% tabs %}
{% tab title="403: Forbidden Forbidden Guild Access" %}
Accessing a guild that is not authorized apart of your API key

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

{% endtab %}

{% tab title="400: Bad Request One or more fields are invalid" %}
Invalid or missing field

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

{% endtab %}

{% tab title="201: Created Admitted civilian" %}
Registered vehicle

```javascript
{
    guildID: "GUILD_ID",
    civilianID: "CIV_ID",
    civilianName: "CIV_NAME",
    success: "Admitted civilian",
    admission: [
        {
            unitsName: "UNIT_NAME",
            unitsID: "UNIT_ID",
            time: "<TIME> Seconds",
            injures: "INJURES",
            timestamp: "TIMESTAMP"
         }
     ]
}
```

{% endtab %}

{% tab title="500: Internal Server Error Unable to admit civilian" %}
Database error, Unable to register admission inside database. Contact RoleplayBot support

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

{% endtab %}
{% endtabs %}
