API is in Alpha and may change at any time.
API Resources > Emergency
Get Active Unit
Get active unit for a user.
Get Active Unit
POST api/v1/emergency/get_active_unit
Request Body
| Name | Type | Description | Default | 
|---|---|---|---|
| user_id | number | Discord ID of the player. | Required | 
Example Request Body
                        
                            
{
    "user_id": 123456789123456789
}
                        
                    
                    Responses
200 A successful call.
                        
                            
{
    "success": true,
    "message": "",
    "data": [
        {
            "id": 88,
            "user_id": 188790560658685954,
            "user_department_id": 9,
            "officer_id": 531807882,
            "subdivision": null,
            "description": "Added to call: 2400023",
            "location": "Test Location",
            "status": "AVL",
            "first_on_duty_at": "04/14/2024 20:11:05",
            "off_duty_at": "04/16/2024 23:28:08",
            "off_duty_type": null,
            "is_panic": 0,
            "created_at": "04/14/2024 20:11:02",
            "updated_at": "04/16/2024 23:21:37",
            "attached_calls": [],
            "officer": {
                "id": 531807882,
                "user_id": 188790560658685954,
                "first_name": "Ariana",
                "last_name": "Daugherty",
                "full_name": "Ariana Daugherty",
                "formatted_name": "Ariana Daugherty",
                "picture": null,
                "date_of_birth": "10/08/1994",
                "gender": "Female",
                "race": "African American",
                "postal": 123,
                "street": "Illo nihil accusanti",
                "city": "Aut vitae illo dolor",
                "full_address": "123 Illo nihil accusanti Aut vitae illo dolor",
                "occupation": "Mollit cupiditate pl",
                "height": "71",
                "weight": "155",
                "created_at": "01/29/2024 22:00:13",
                "updated_at": "01/29/2024 22:00:13"
            },
            "user_department": {
                "id": 9,
                "user_id": 188790560658685954,
                "badge_number": "1C-1",
                "rank": "Test",
                "department": {
                    "id": 1,
                    "name": "Blane County Sheriffs Office",
                    "initials": "BCSO",
                    "logo": "https://communitycad.app/images/default_images/BCSO-2.png"
                }
            }
        }
    ]
}
                        
                    
                    200 with error message if the unit was not found.
                        
                            
{
    "success": false,
    "message": "No active unit found for the given user.",
    "data": []
}
                        
                    
                    200 with validation error messages.
                        
                            
{
    "success": false,
    "message": "Validation errors",
    "data": {
        "user_id": [
            "The user id field is required.",
            "The user id must be a number."
        ]
    }
}
                        
                    
                Still have questions?
Still have questions? Talk to support.