### Get Player Note Info - Response Example Source: https://www.battlemetrics.com/developers/documentation An example of a successful response (200 OK) when retrieving information about a specific player note. ```json { "data": { "id": "example", "type": "playerNote", "attributes": { "note": "example", "shared": true, "createdAt": "2015-01-01T12:00:00Z", "expiresAt": "example", "clearanceLevel": 42 }, "relationships": { "player": { "data": { "type": "player", "id": "42" } }, "organization": { "data": { "type": "organization", "id": "42" } }, "user": { "data": { "type": "user", "id": "42" } }, "trigger": { "data": { "type": "trigger", "id": "01234567-89ab-cdef-0123-456789abcdef" } } } }, "included": [ ] } ``` -------------------------------- ### Server Response Example Source: https://www.battlemetrics.com/developers/documentation Example of a successful response when querying server information. ```json { "type": "server", "id": "42", "attributes": { "id": "42", "name": "Server Name", "address": "play.example.com", "ip": "127.0.0.1", "port": 2302, "portQuery": 2303, "players": 42, "maxPlayers": 42, "rank": 42, "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "location": [ 47.6140999, -122.1966574 ], "country": "US", "status": "online", "details": null, "metadata": { }, "rconActive": true, "queryStatus": null, "rconStatus": null, "rconLastConnected": "2015-01-01T12:00:00Z", "rconDisconnected": "2015-01-01T12:00:00Z", "private": false }, "relationships": { "game": { "data": { "type": "game", "id": "ark" } } } } ``` -------------------------------- ### Curl Example for Server Downtime History Source: https://www.battlemetrics.com/developers/documentation Example using curl to fetch server downtime history with required start and stop parameters, and an optional resolution. ```bash $ curl -n https://api.battlemetrics.com/servers/$SERVER_ID/relationships/downtime -G \ -d start=2015-01-01T12%3A00%3A00Z \ -d stop=2015-01-01T12%3A00%3A00Z \ -d resolution=60 ``` -------------------------------- ### Example Server Response Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP response when retrieving server information. ```http HTTP/2.0 200 OK ``` ```json { "data": { "type": "server", "id": "42", "attributes": { "id": "42", "name": "Server Name", "address": "play.example.com", "ip": "127.0.0.1", "port": 2302, "portQuery": 2303, "players": 42, "maxPlayers": 42, "rank": 42, "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "location": [ 47.6140999, -122.1966574 ], "country": "US", "status": "online", "details": null, "metadata": { }, "rconActive": true, "queryStatus": null, "rconStatus": null, "rconLastConnected": "2015-01-01T12:00:00Z", "rconDisconnected": "2015-01-01T12:00:00Z", "private": false }, "relationships": { "game": { "data": { "type": "game", "id": "ark" } } } } } ``` -------------------------------- ### Get Server First Time Player History Source: https://www.battlemetrics.com/developers/documentation Retrieve historical data on when players first joined a specific server. Requires start and stop date-time parameters. ```bash $ curl -n https://api.battlemetrics.com/servers/$SERVER_ID/first-time-history -G \ -d start=2015-01-01T12%3A00%3A00Z \ -d stop=2015-01-01T12%3A00%3A00Z ``` -------------------------------- ### Session Resource Response Example Source: https://www.battlemetrics.com/developers/documentation Example JSON response for a session resource, detailing player activity on a server. ```json { "data": [ { "id": "01234567-89ab-cdef-0123-456789abcdef", "type": "session", "attributes": { "start": "2015-01-01T12:00:00Z", "stop": "2015-01-01T12:00:00Z", "firstTime": true, "name": "Quark", "private": false, "metadata": [ ] }, "relationships": { "server": { "data": { "type": "server", "id": "42" } }, "organization": { "data": { "type": "organization", "id": "42" } }, "player": { "data": { "type": "player", "id": "42" } }, "identifiers": { "data": [ { "type": "identifier", "id": "example" } ] } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/players/1/relationshps/sessions?page[key]=2016-10-05T14:35:51.962Z&page[rel]=next", "prev": "https://api.battlemetrics.com/players/1/relationshps/sessions?page[key]=2015-10-05T14:35:51.962Z&page[rel]=prev" } } ``` -------------------------------- ### Get Specific Player Query Response Example Source: https://www.battlemetrics.com/developers/documentation Example JSON response when retrieving a single player query by its ID. It contains the full details of the specified player query. ```json { "data": { "type": "playerQuery", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "queryName": "Alt Detection", "conditions": [ { "scoreType": "score", "score": 42.0, "types": [ null ], "condition": { "and": [ ] } } ] }, "relationships": { "organization": { "data": { "type": "organization", "id": "42" } }, "user": { "data": { "type": "user", "id": "42" } } } } } ``` -------------------------------- ### Server Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP response when retrieving server information. It includes details about the server's status, players, and metadata. ```http HTTP/2.0 200 OK ``` ```json { "data": [ { "type": "server", "id": "42", "attributes": { "id": "42", "name": "Server Name", "address": "play.example.com", "ip": "127.0.0.1", "port": 2302, "portQuery": 2303, "players": 42, "maxPlayers": 42, "rank": 42, "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "location": [ 47.6140999, -122.1966574 ], "country": "US", "status": "online", "details": null, "metadata": { }, "rconActive": true, "queryStatus": null, "rconStatus": null, "rconLastConnected": "2015-01-01T12:00:00Z", "rconDisconnected": "2015-01-01T12:00:00Z", "private": false }, "relationships": { "game": { "data": { "type": "game", "id": "ark" } } } } ], "included": [ null ], "links": { "next": "https://api.battlemetrics.com/servers?page[size]=10&key=2016-10-05T14:35:51.962Z", "prev": "https://api.battlemetrics.com/servers?page[size]=10&key=2015-10-05T14:35:51.962Z" } } ``` -------------------------------- ### Curl Example for Get Ban List Exemption Read Source: https://www.battlemetrics.com/developers/documentation Example cURL command to fetch details of a specific ban exemption. Ensure the BAN_ID and BANEXEMPTION_ID environment variables are set. ```bash $ curl -n https://api.battlemetrics.com/bans/$BAN_ID/relationships/exemptions/$BANEXEMPTION_ID ``` -------------------------------- ### Response Example for Ban List Invite Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful response when retrieving ban list invites. ```json { "data": [ { "type": "banListInvite", "id": "rygK6AV7YW", "attributes": { "uses": 42, "limit": 42, "permManage": true, "permCreate": true, "permUpdate": true, "permDelete": true }, "relationships": { "banList": { "data": { "type": "banList", "id": "01234567-89ab-cdef-0123-456789abcdef" } }, "organization": { "data": { "type": "organization", "id": "42" } }, "user": { "data": { "type": "user", "id": "42" } } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/ban-lists/eb41620e-8cec-11e7-a78d-03816ea7c7f0/relationships/invites?page[size]=10&key=example", "prev": "https://api.battlemetrics.com/ban-lists/eb41620e-8cec-11e7-a78d-03816ea7c7f0/relationships/invites?page[size]=10&key=example" } } ``` -------------------------------- ### Player Flag List Response Example Source: https://www.battlemetrics.com/developers/documentation Example of a successful HTTP 200 OK response when listing player flags. ```json { "data": [ { "id": "01234567-89ab-cdef-0123-456789abcdef", "type": "playerFlag", "meta": { "shared": true }, "attributes": { "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "icon": null, "name": "example", "color": "example", "description": "example" }, "relationships": { "organization": { "data": { "type": "organization", "id": "42" } }, "user": { "data": { "type": "user", "id": "42" } } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/player-flagss?page[size]=10&key=2016-10-05T14:35:51.962Z", "prev": "https://api.battlemetrics.com/player-flags?page[size]=10&key=2015-10-05T14:35:51.962Z" } } ``` -------------------------------- ### HTTP Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP response when creating a ban list. ```http HTTP/2.0 201 Created ``` ```json { "data": { "type": "banList", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "name": "example", "action": "none", "permManage": true, "permCreate": true, "permUpdate": true, "permDelete": true, "defaultIdentifiers": [ "steamID", "ip" ], "defaultReasons": [ "{{uid}} - Reason - ({{admin}})" ], "defaultAutoAddEnabled": true, "defaultNativeEnabled": true, "nativeBanTTL": null, "nativeBanTempMaxExpires": null, "nativeBanPermMaxExpires": null }, "relationships": { "organization": { "data": { "type": "organization", "id": "1" } }, "owner": { "data": { "type": "organization", "id": "1" } } } } } ``` -------------------------------- ### Server Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP 2.0 201 Created response when creating or updating a server. It includes detailed attributes of the server and its relationships. ```http HTTP/2.0 201 Created ``` ```json { "data": { "type": "server", "id": "42", "attributes": { "id": "42", "name": "Server Name", "address": "play.example.com", "ip": "127.0.0.1", "port": 2302, "portQuery": 2303, "players": 42, "maxPlayers": 42, "rank": 42, "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "location": [ 47.6140999, -122.1966574 ], "country": "US", "status": "online", "details": null, "metadata": { }, "rconActive": true, "queryStatus": null, "rconStatus": null, "rconLastConnected": "2015-01-01T12:00:00Z", "rconDisconnected": "2015-01-01T12:00:00Z", "private": false }, "relationships": { "game": { "data": { "type": "game", "id": "ark" } } } } } ``` -------------------------------- ### Command Stats Response Example Source: https://www.battlemetrics.com/developers/documentation Example of a successful response when retrieving command statistics for an organization. ```json { "data": [ { "id": "1:1", "type": "commandStats", "attributes": { }, "relationships": { "organization": { "data": { "type": "organization", "id": "42" } }, "games": { "data": [ { "type": "game", "id": "ark" } ] }, "user": { "data": { "type": "user", "id": "42" } } } } ] } ``` -------------------------------- ### Curl Example for Server Outage History Source: https://www.battlemetrics.com/developers/documentation Example using curl to fetch server outage history with various optional parameters. ```bash $ curl -n https://api.battlemetrics.com/servers/$SERVER_ID/relationships/outages -G \ -d page[size]=42 \ -d page[key]=100 \ -d page[rel]=next \ -d filter[range]=2017-12-01T00%3A00%3A00Z%3A2017-12-31T00%3A00%3A00Z \ -d include=uptime%3A90 ``` -------------------------------- ### HTTP Response Example Source: https://www.battlemetrics.com/developers/documentation Example of a successful HTTP response from the BattleMetrics API. ```http HTTP/2.0 200 OK ``` -------------------------------- ### Session Response Example Source: https://www.battlemetrics.com/developers/documentation Example JSON response for a session, detailing its attributes and relationships. ```json { "data": { "id": "01234567-89ab-cdef-0123-456789abcdef", "type": "session", "attributes": { "start": "2015-01-01T12:00:00Z", "stop": "2015-01-01T12:00:00Z", "firstTime": true, "name": "Quark", "private": false, "metadata": [ ] }, "relationships": { "server": { "data": { "type": "server", "id": "42" } }, "organization": { "data": { "type": "organization", "id": "42" } }, "player": { "data": { "type": "player", "id": "42" } }, "identifiers": { "data": [ { "type": "identifier", "id": "example" } ] } } }, "included": [ ] } ``` -------------------------------- ### List Player Queries Response Example Source: https://www.battlemetrics.com/developers/documentation Example JSON response when listing player queries. It includes a 'data' array containing player query objects and a 'links' object for pagination. ```json { "data": [ { "type": "playerQuery", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "queryName": "Alt Detection", "conditions": [ { "scoreType": "score", "score": 42.0, "types": [ null ], "condition": { "and": [ ] } } ] }, "relationships": { "organization": { "data": { "type": "organization", "id": "42" } }, "user": { "data": { "type": "user", "id": "42" } } } } ], "links": { "next": "https://api.battlemetrics.com/player-queries?page[size]=10&key=2016-10-05T14:35:51.962Z", "prev": "https://api.battlemetrics.com/player-queries?page[size]=10&key=2015-10-05T14:35:51.962Z" } } ``` -------------------------------- ### Session CoPlay Response Example Source: https://www.battlemetrics.com/developers/documentation Example JSON response for session coPlay, including pagination links. ```json { "data": [ { "id": "01234567-89ab-cdef-0123-456789abcdef", "type": "session", "attributes": { "start": "2015-01-01T12:00:00Z", "stop": "2015-01-01T12:00:00Z", "firstTime": true, "name": "Quark", "private": false, "metadata": [ ] }, "relationships": { "server": { "data": { "type": "server", "id": "42" } }, "organization": { "data": { "type": "organization", "id": "42" } }, "player": { "data": { "type": "player", "id": "42" } }, "identifiers": { "data": [ { "type": "identifier", "id": "example" } ] } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/sessions/dd6b1a60-f29a-11e9-a987-573e55219a58/relationships/coplay?page[key]=2016-10-05T14:35:51.962Z&page[rel]=next", "prev": "https://api.battlemetrics.com/sessions/dd6b1a60-f29a-11e9-a987-573e55219a58/relationships/coplay?page[key]=2015-10-05T14:35:51.962Z&page[rel]=prev" } } ``` -------------------------------- ### Get Game Information Source: https://www.battlemetrics.com/developers/documentation This snippet shows an example of a successful HTTP response when retrieving game data. It includes details like the game's name, player counts, and server distribution. ```http HTTP/2.0 200 OK ``` ```json { "data": { "id": "ark", "type": "game", "attributes": { "name": "ARK: Survival Evolved", "metadata": { "appid": 42.0, "gamedir": "example", "noPlayerList": true }, "players": 300, "servers": 300, "serversByCountry": { "US": 100, "CA": 100, "GB": 100 }, "playersByCountry": { "US": 100, "CA": 100, "GB": 100 }, "maxPlayers30D": 42.0, "maxPlayers7D": 42.0, "maxPlayers24H": 42.0, "minPlayers30D": 42.0, "minPlayers7D": 42.0, "minPlayers24H": 42.0 } } } ``` -------------------------------- ### Ban Import Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful response when importing a ban. It includes the details of the created ban. ```json { "type": "ban", "id": "42", "attributes": { "id": "42", "uid": "41opA0OgW", "timestamp": "2016-10-05T14:35:51.962Z", "reason": "41opA0OgW - Scammer (Sisko)", "note": "Quark was reported by another player. Video showing scam: https://example.com/video", "expires": "2016-11-05T14:35:51.962Z", "identifiers": [ 1000, { "type": "steamID", "identifier": "1111111111111111", "manual": true } ], "orgWide": true, "autoAddEnabled": true, "nativeEnabled": null }, "meta": { "player": "example" }, "relationships": { "player": { "data": { "type": "player", "id": "42" } }, "server": { "data": { "type": "server", "id": "42" } }, "organization": { "data": { "type": "organization", "id": "42" } }, "user": { "data": { "type": "user", "id": "42" } }, "banList": { "data": { "type": "banList", "id": "01234567-89ab-cdef-0123-456789abcdef" } }, "trigger": { "data": { "type": "trigger", "id": "01234567-89ab-cdef-0123-456789abcdef" } } } } ``` -------------------------------- ### Ban List Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful response when retrieving ban list details. ```json { "data": { "type": "banList", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "name": "example", "action": "none", "permManage": true, "permCreate": true, "permUpdate": true, "permDelete": true, "defaultIdentifiers": [ "steamID", "ip" ], "defaultReasons": [ "{{uid}} - Reason - ({{admin}})" ], "defaultAutoAddEnabled": true, "defaultNativeEnabled": true, "nativeBanTTL": null, "nativeBanTempMaxExpires": null, "nativeBanPermMaxExpires": null }, "relationships": { "organization": { "data": { "type": "organization", "id": "1" } }, "owner": { "data": { "type": "organization", "id": "1" } } } } } ``` -------------------------------- ### Player Note Creation Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful response when creating a player note, indicating a 201 Created status. ```json { "data": { "id": "example", "type": "playerNote", "attributes": { "note": "example", "shared": true, "createdAt": "2015-01-01T12:00:00Z", "expiresAt": "example", "clearanceLevel": 42 }, "relationships": { "player": { "data": { "type": "player", "id": "42" } }, "organization": { "data": { "type": "organization", "id": "42" } }, "user": { "data": { "type": "user", "id": "42" } }, "trigger": { "data": { "type": "trigger", "id": "01234567-89ab-cdef-0123-456789abcdef" } } } } } ``` -------------------------------- ### API Response Example for Player Data Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP/2.0 response (200 OK) containing player data. It includes the 'data' array with player details, 'included' for related resources, and 'links' for pagination. ```http HTTP/2.0 200 OK ``` ```json { "data": [ { "type": "player", "id": "42", "attributes": { "id": "42", "createdAt": "2015-01-01T12:00:00Z", "updatedAt": "2015-01-01T12:00:00Z", "name": "Quark", "private": false, "positiveMatch": false }, "meta": { "metadata": [ ] }, "relationships": { "organizations": { "data": [ { "type": "organization", "id": "42" } ] }, "server": { "data": { "type": "server", "id": "42" } }, "servers": { "data": [ { "type": "server", "id": "42", "meta": { "firstSeen": "2015-01-01T12:00:00Z", "lastSeen": "2015-01-01T12:00:00Z", "timePlayed": 42, "online": true } } ] }, "user": { "data": { "type": "user", "id": "42" } } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/players?page[size]=10&key=2016-10-05T14:35:51.962Z", "prev": "https://api.battlemetrics.com/players?page[size]=10&key=2015-10-05T14:35:51.962Z" } } ``` -------------------------------- ### Server Leaderboard Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP response when requesting server leaderboard data. It includes the data for leaderboard players and links for pagination. ```json { "data": [ { "type": "leaderboardPlayer", "id": "42", "attributes": { "name": "Quark", "value": 42, "rank": 42 } } ], "links": { "next": "https://api.battlemetrics.com/servers/1/leaderboards/time?page[size]=10&page[offset]=10", "prev": "https://api.battlemetrics.com/servers/1/leaderboards/time?page[size]=10&page[offset]=0" } } ``` -------------------------------- ### Example API Response Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP 2.0 response from the Battlemetrics API, showing the structure of metadata, data, included resources, and pagination links. ```http HTTP/2.0 200 OK ``` ```json { "meta": { "resultCount": 42.0, "operandLoadTimes": null }, "data": [ { "type": "playerQueryResult", "id": "example", "attributes": { "score": 42.0, "log": [ { "message": "Identifier Score", "code": "identifier", "success": true, "reference": { "type\"": "identifierScore", "identifierType\"": "name" }, "children": [ ] } ] }, "relationships": { "player": { "data": { "type": "player", "id": "42" } } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/players/1/relationships/player-query/35a06396-c6e8-4142-a81a-4af8adc8079b?page[size]=10&page[offset]=0", "prev": "https://api.battlemetrics.com/players/1/relationships/player-query/35a06396-c6e8-4142-a81a-4af8adc8079b?page[size]=10&page[offset]=20" } } ``` -------------------------------- ### Ban List List Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful response when listing multiple ban lists, including pagination links. ```json { "data": [ { "type": "banList", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "name": "example", "action": "none", "permManage": true, "permCreate": true, "permUpdate": true, "permDelete": true, "defaultIdentifiers": [ "steamID", "ip" ], "defaultReasons": [ "{{uid}} - Reason - ({{admin}})" ], "defaultAutoAddEnabled": true, "defaultNativeEnabled": true, "nativeBanTTL": null, "nativeBanTempMaxExpires": null, "nativeBanPermMaxExpires": null }, "relationships": { "organization": { "data": { "type": "organization", "id": "1" } }, "owner": { "data": { "type": "organization", "id": "1" } } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/ban-lists?page[size]=10&key=example", "prev": "https://api.battlemetrics.com/ban-lists?page[size]=10&key=example" } } ``` -------------------------------- ### Server Outage History Response Example Source: https://www.battlemetrics.com/developers/documentation Example response structure for server outage history, including metadata and outage data points. ```json { "meta": { "min": 42.0, "max": 42.0, "sum": 42.0, "count": 42.0, "onlineSince": "2015-01-01T12:00:00Z", "offlineSince": "2015-01-01T12:00:00Z", "lastPlayerJoin": "2015-01-01T12:00:00Z" }, "data": [ { "id": "01234567-89ab-cdef-0123-456789abcdef", "type": "serverOutage", "attributes": { "start": "2015-01-01T12:00:00Z", "stop": "2015-01-01T12:00:00Z" }, "relationships": { "server": { "data": { "type": "server", "id": "42" } } } } ], "included": [ null ], "links": { "next": "https://api.battlemetrics.com/servers/1/relationships/outages?key=3a8cd808-2e8d-11b2-b96f-fb44c9b688db&rel=next", "prev": "https://api.battlemetrics.com/servers/1/relationships/outages?key=3a8cd808-2e8d-11b2-b96f-fb44c9b688db&rel=prev" } } ``` -------------------------------- ### HTTP Response Example for Ban Import Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP response when importing a ban. It indicates a 201 Created status. ```http HTTP/2.0 201 Created ``` -------------------------------- ### Native Ban Response Example Source: https://www.battlemetrics.com/developers/documentation This is an example of a successful HTTP 2.0 200 OK response when retrieving native ban data. It includes the ban details, related entities, and pagination links. ```json { "data": [ { "type": "banNative", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "state": "added", "createdAt": "2016-10-05T14:35:51.962Z", "updatedAt": "2016-10-05T14:35:51.962Z", "updateAt": "2016-10-05T14:35:51.962Z", "reason": "41opA0OgW - Scammer (Sisko)", "expires": "2016-11-05T14:35:51.962Z", "type": "steamID", "identifier": "76561197960265720" }, "relationships": { "ban": { "data": { "type": "ban", "id": "42" } }, "server": { "data": { "type": "server", "id": "42" } }, "organization": { "data": { "type": "organization", "id": "42" } } } } ], "included": [ ], "links": { "next": "https://api.battlemetrics.com/bans-native?page[size]=10&key=2016-10-05T14:35:51.962Z", "prev": "https://api.battlemetrics.com/bans-native?page[size]=10&key=2015-10-05T14:35:51.962Z" } } ``` -------------------------------- ### Server Create Source: https://www.battlemetrics.com/developers/documentation Add a server to the system. ```APIDOC ## POST /servers ### Description Add a server to the system. ### Method POST ### Endpoint /servers ``` -------------------------------- ### Response Example for Get Ban List Exemption List Source: https://www.battlemetrics.com/developers/documentation Example response when listing ban exemptions. It returns an array of exemption objects, each containing type, ID, attributes, and relationships. ```json { "data": [ { "type": "banExemption", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "reason": null }, "relationships": { "organization": { "data": { "type": "organization", "id": "1" } }, "ban": { "data": { "type": "ban", "id": "1" } } } } ] } ``` -------------------------------- ### Server Create Source: https://www.battlemetrics.com/developers/documentation Creates a new server entry. ```APIDOC ## POST /servers ### Description Creates a new server entry. ### Method POST ### Endpoint /servers ``` -------------------------------- ### Response Example for Get Ban List Exemption Read Source: https://www.battlemetrics.com/developers/documentation Example response for retrieving a ban exemption. It includes the exemption's ID, attributes like reason, and relationships to the organization and ban. ```json { "data": { "type": "banExemption", "id": "01234567-89ab-cdef-0123-456789abcdef", "attributes": { "reason": null }, "relationships": { "organization": { "data": { "type": "organization", "id": "1" } }, "ban": { "data": { "type": "ban", "id": "1" } } } } } ``` -------------------------------- ### Curl Example for Get Ban List Exemption List Source: https://www.battlemetrics.com/developers/documentation Example cURL command to list ban exemptions for a given ban ID, requesting only the 'reason' attribute. This helps in fetching specific data efficiently. ```bash $ curl -n https://api.battlemetrics.com/bans/$BAN_ID/relationships/exemptions \ -G \ -d fields[banExemption]=reason ``` -------------------------------- ### Get Server Unique Player History Source: https://www.battlemetrics.com/developers/documentation Retrieve historical data on the number of unique players for a specific server. Requires start and stop date-time parameters. ```bash $ curl -n https://api.battlemetrics.com/servers/$SERVER_ID/unique-player-history -G \ -d start=2015-01-01T12%3A00%3A00Z \ -d stop=2015-01-01T12%3A00%3A00Z ``` -------------------------------- ### Create Ban List - POST /ban-lists Source: https://www.battlemetrics.com/developers/documentation Use this endpoint to create a new ban list. Ensure you have the necessary permissions. ```bash POST /ban-lists ``` -------------------------------- ### Get Server Time Played History Source: https://www.battlemetrics.com/developers/documentation Retrieve historical data on player time played for a specific server. Requires start and stop date-time parameters. ```bash $ curl -n https://api.battlemetrics.com/servers/$SERVER_ID/time-played-history -G \ -d start=2015-01-01T12%3A00%3A00Z \ -d stop=2015-01-01T12%3A00%3A00Z ``` -------------------------------- ### Get Player Note Info - cURL Example Source: https://www.battlemetrics.com/developers/documentation This cURL command retrieves information for a specific player note. Ensure you have the correct player ID and player note ID. ```bash $ curl -n https://api.battlemetrics.com/players/$PLAYER_ID/relationships/notes/$PLAYERNOTE_ID ``` -------------------------------- ### Curl Example for Listing Game Features Source: https://www.battlemetrics.com/developers/documentation This cURL command demonstrates how to fetch game features with specific filters and pagination parameters. It includes filtering by game, setting page size, and specifying the page relation. ```bash $ curl -n https://api.battlemetrics.com/game-features -G \ -d filter[game]=example \ -d page[size]=42 \ -d page[key]=100 \ -d page[rel]=next \ -d fields[gameFeature]=display ``` -------------------------------- ### Create Server API Request Source: https://www.battlemetrics.com/developers/documentation Use this endpoint to create a new server resource. Ensure all required attributes and relationships are correctly formatted. The 'metadata' object can be used to configure game-specific settings. ```bash $ curl -n -X POST https://api.battle.metrics.com/servers \ -d '{ "data": { "type": "server", "attributes": { "ip": "127.0.0.1", "port": 2302, "portQuery": 2303, "portRCON": 2302, "rconPassword": "password", "metadata": { } }, "relationships": { "game": { "data": { "type": "game", "id": "ark" } } } } }' \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Player Time Played History Source: https://www.battlemetrics.com/developers/documentation Returns the data used for rendering time played history charts for a specific player on a specific server. The start and stop timestamps are truncated to the date. ```APIDOC ## GET /players/{player_id}/time-played-history/{server_id} ### Description Returns the data we use for rendering time played history charts. Start and stop are truncated to the date. ### Method GET ### Endpoint /players/{player_id}/time-played-history/{server_id} ### Parameters #### Path Parameters - **player_id** (string) - Required - The ID of the player. - **server_id** (string) - Required - The ID of the server. #### Query Parameters - **start** (date-time) - Required - Start timestamp. Must be within three months of stop. - **stop** (date-time) - Required - Stop timestamp. Must be within three months of start. ### Request Example ```bash curl -n https://api.battlemetrics.com/players/$PLAYER_ID/time-played-history/$SERVER_ID \ -G \ -d start=2015-01-01T12%3A00%3A00Z \ -d stop=2015-01-01T12%3A00%3A00Z ``` ### Response #### Success Response (200) - **meta** (object) - Contains the start and stop timestamps. - **start** (date-time) - The start timestamp. - **stop** (date-time) - The stop timestamp. - **data** (array) - An array of data points. - **type** (string) - Resource type, always "dataPoint". - **attributes** (object) - Attributes of the data point. - **timestamp** (date-time) - The timestamp of the data point. - **group** (integer) - The group of the data point. - **name** (string) - The name of the metric. - **max** (integer) - The maximum value for the metric. - **value** (integer) - The value of the metric. - **min** (integer) - The minimum value for the metric. #### Response Example ```json { "meta": { "start": "2015-01-01T12:00:00Z", "stop": "2015-01-01T12:00:00Z" }, "data": [ { "type": "dataPoint", "attributes": { "timestamp": "2015-01-01T12:00:00Z", "group": 0, "name": "games.arma3.players", "max": 42, "value": 42, "min": 42 } } ] } ``` ```