API Documentation
The platform exposes a REST API for public consumption.
NOTE: This documentation is only temporary and will be replaced by a Swagger.io/Postman documentation.
Get headshots
URL: GET /api/headshots
\
Public: Yes
- The collection envelope is called items
- Every item has the following fields
profile_id
: integer The player profile idtarget_id
: integer The target idtarget_name
: string The target nametimer
: integer The time in seconds for completionfirst
: boolean If the headshot was firstrating
: integer The user provided difficulty rating for the targetcreated_at
: datatime The headshot was achieved
Sample item
{
"profile_id":"177952",
"target_id":24,
"target_name":"tweek",
"timer":26740,
"first":false,
"rating":-1,
"created_at":"2020-09-11 04:15:47"
}
Parameters:
filter
: filter throughfilter[field_name]=field_value
example:filter[profile_id]=1337
fields
: selecting fields throughfields=field_name,field_name...
syntax egfields=target_name,profile_id
to select only the target name and profile_idsort
: sorting through sort eg sort=-created_at,profile_id to sort created_at descending and profile_id ascendingper-page
: limiting results per page through per-page eg per-page=100, accepted values in the range of [1...100]
Examples:
- Simple request
curl -i -H "Accept:application/json" "https://echoctf.red/api/headshots"
- filter only headshots for player with profile_id=31337
curl -i -H "Accept:application/json" "https://echoctf.red/api/headshots?filter[profile_id]=31337"
- filter only headshots for player with profile_id=31337 and get only the target names
curl -i -H "Accept:application/json" "https://echoctf.red/api/headshots?filter[profile_id]=31337&fields=target_name"