FAXES Documentation > FaxCAD > API Endpoints

API Endpoints

FAXES

The FaxCAD v2 API allows communities to enhance and connect their CAD to their own services. All you need to do is create calls to endpoints.

Below is a table on all the API endpoints and their information.

Endpoint Link
Get All Civilians /api/getallcivilians
Get All Emergency Personnel /api/getallemerg
Get Civilian Arrests /api/getarrests
Get All BOLOs /api/getbolos
Get Site Settings /api/getsettings
Get Civilian Tickets /api/gettickets
Get All Warrants /api/getwarrants
Search Calls /api/searchcalls
Search Civilian By Name /api/searchname
Search Vehicle By Plate /api/searchplate

To access an API page you use https://<YOUR_DOMAIN>/api/<YOUR_REQUEST>.

If an API requests succeeds it will return the below along with other data.

{
    "status": "Found",
    "details": "Found API request."
}

However, if an API request fails to work or grab data you might get something like these:

{
    "status": "Error",
    "details": "This civilian has no arrests on record."
}
{
    "status": "Error",
    "details": "Search parameter not found (q)."
}

Get All Civilians

This API request returns an array of all the civilians in your CAD and outputs some information on all those civilians. This is similar to the output on /api/searchname.

Parameters:
This request doesn't require any parameters.

Request example:
https://<YOUR_DOMAIN>/api/getallcivilians

{
    "status": "Found",
    "details": "Found civilians.",
    "0": {
        "id": "1",
        "ownerId": "350548443522924545",
        "charInfo": {
            "firstName": "FANTA",
            "lastName": "FAXES",
            "DoB": "21/10/2000",
            "address": "1 Cat Lane",
            "gender": "Other",
            "race": "Asian",
            "hairColor": "Blue",
            "dead": "0"
        },
        "image": "https://faxcad.faxes.zone/assets/civimages/nomale.png",
        "license": {
            "drivers": "None",
            "commercial": "None",
            "firearms": "None",
            "boat": "None",
            "aviation": "None",
            "hunting": "None",
            "fishing": "None"
        }
    }
}

Get All Emergency Personnel

This API request allows you to fetch all emergency personnel in one array. This request works very much like /api/getallcivilians.

Parameters:
This request doesn't require any parameters.

Request example:
https://<YOUR_DOMAIN>/api/getallemerg

{
    "status": "Found",
    "details": "Found emergency table.",
    "0": {
        "id": "1",
        "ownerId": "282762192544333827",
        "name": "FAXES Cop",
        "dept": {
            "dept": "Police",
            "deptType": "0"
        },
        "duty": {
            "status": "10-97",
            "server": "1",
            "callId": "0",
            "panic": "2"
        }
    },
    "1": {
        "id": "2",
        "ownerId": "282762192544333827",
        "name": "FAXES Fire",
        "dept": {
            "dept": "Fire Department",
            "deptType": "1"
        },
        "duty": {
            "status": "10-15",
            "server": "1",
            "callId": "0",
            "panic": "0"
        }
    }
}

Get Civilian Arrests

This API request returns an array of all the civilians arrests in your CAD specified by the civilians ID. This is similar to the output on /api/gettickets.

Parameters:

q - Civilian characters ID.

Request example:
https://<YOUR_DOMAIN>/api/getarrests?q=1

{
    "status": "Found",
    "details": "Found civilians arrests.",
    "0": {
        "id": "1",
        "civName": "Test Joe",
        "offence": "Breathing x2",
        "officerName": "FAXES",
        "officerDisId": "282762192544333827",
        "type": "Warrant",
        "forceUsed": "Yes",
        "propDamage": "Yes",
        "lethalUsed": "No",
        "injuryCaused": "Yes",
        "reportDetails": "Breathing",
        "jail": "90000",
        "fine": "90000",
        "pcode": "233232",
        "location": "2222222",
        "date": "27/05/2020",
        "time": "12:11:41pm"
    }
}

Get All BOLOs

Returns all CAD BOLO's that are active.

Parameters:
This request doesn't require any parameters.

Request example:
https://<YOUR_DOMAIN>/api/getbolos

{
    "status": "Found",
    "details": "Found BOLOs.",
    "0": {
        "id": "1",
        "details": "This is a bolo. Say hi to the details.",
        "date": "31/05/2020",
        "time": "05:32:12am"
    }
}

Get Site Settings

Fetches the CAD's site settings and provides them in the JSON output.

Parameters:
This request doesn't require any parameters.

Request example:
https://<YOUR_DOMAIN>/api/getsettings

{
    "status": "Found",
    "details": "Found site settings.",
    "id": "1",
    "masterAdmin": "282762192544333827",
    "debugMode": true,
    "installLocation": "/var/www/faxcad20",
    "branding": {
        "name": "My Community",
        "nameSml": "MC",
        "description": "ChaseRP CAD System",
        "shareColor": "#0099ff",
        "favicon": "https://faxcad.faxes.zone/assets/favicon.png"
    },
    "discord": {
        "invite": "https://faxes.zone/discord",
        "discordGuildId": "GuildID"
    },
    "cad": {
        "logintype": "3",
        "backgroundColor": "#202225",
        "maxChars": "2",
        "penalCode": "https://faxes.zone",
        "liveMap": "Live map link",
        "nameFormat": "1A-01 | FAXES"
    }
}

Get Civilian Tickets

From providing a civilians database ID you can search and fetch all of the tickets assigned to that civilian. This is similar to the output on /api/getarrests.

Parameters:

q - Civilian characters ID.

Request example:
https://<YOUR_DOMAIN>/api/gettickets?q=1

{
    "status": "Found",
    "details": "Found civilians tickets.",
    "0": {
        "id": "2",
        "civName": "FANTA FAXES",
        "offence": "Being too much like FANTA",
        "officerName": "Fanta-100 | Matthew M",
        "officerDisId": "350548443522924545",
        "fine": "10000",
        "jail": "1000",
        "location": "Porcorpio Drive",
        "plate": "N/A",
        "model": "N/A",
        "date": "31/05/2020",
        "time": "02:05:39am"
    }
}

Get All Warrants

Returns all warrants that are in the CAD system.

Parameters:
This request doesn't require any parameters.

Request example:
https://<YOUR_DOMAIN>/api/getwarrants

{
    "status": "Found",
    "details": "Found warrants.",
    "0": {
        "id": "1",
        "civId": "2",
        "civName": "Test Joe",
        "details": "This is a warrant because he's a bad boy"
    }
}

Search Calls

This API request allows you to fetch a open or closed call via ID.

Parameters:

q - A Call ID.

Request example:
https://<YOUR_DOMAIN>/api/searchcalls?q=1

{
    "status": "Found",
    "details": "Found call.",
    "id": "1",
    "closed": "1",
    "server": "1",
    "CallInfo": {
        "primaryId": "1",
        "primaryName": "FAXES Cop ",
        "callType": "All Call",
        "location": "Home",
        "details": "Officer pulled guy from BREATHING"
    },
    "narrative": "<strong>FAXES:</strong> Created The Call.",
    "attachedUnits": "",
    "date": "27/05/2020",
    "time": "12:21:25pm"
}

Search Civilian By Name

This API request returns an array of all the civilians information provided via the civilians name.

Parameters:

q - A Civilians first and last name.

Request example:
https://<YOUR_DOMAIN>/api/searchname?q=test joe

{
    "status": "Found",
    "details": "Found character.",
    "id": "2",
    "ownerId": "282762192544333827",
    "charInfo": {
        "firstName": "Test",
        "lastName": "Joe",
        "DoB": "12/12/1212",
        "address": "Sandy Shores",
        "gender": "Male",
        "race": "White",
        "hairColor": "Black",
        "dead": "0"
    },
    "image": "https://faxcad.faxes.zone/assets/civimages/p81op4wkjpilglbkadlizbfxddt8z1.png",
    "license": {
        "drivers": "Valid",
        "commercial": "Suspended",
        "firearms": "None",
        "boat": "None",
        "aviation": "None",
        "hunting": "None",
        "fishing": "None"
    }
}

Search Vehicle By Plate

This API request returns an array of the vehicle searched by plate. It shows basic information on thew vehicle along with the owners name.

Parameters:

q - A vehicle plate to search for.

Request example:
https://<YOUR_DOMAIN>/api/searchplate?q=1234

{
    "status": "Found",
    "details": "Found vehicle.",
    "id": "1",
    "ownerId": "282762192544333827",
    "VehInfo": {
        "plate": "1234",
        "model": "Tesla",
        "color": "Black",
        "registration": "Expired",
        "insurance": "Valid",
        "stolen": "No",
        "ownerName": "Test Joe"
    }
}