The FiveRoster API is currently in a BETA and you may experience bugs. Please log a support ticket if you encounter any problems.
Authentication
In order to authenticate with the FiveRoster API, you'll need to provide the API key you have generated in the header of the request under "X-API-KEY". The API may return a variety of different error messages:
The API has several protections in place to prevent API spam and misuse. By default, the API will rate limit IP addresses that attempt to make more than 50 requests per minute.
{"error":["code":"rate_limit_exceeded","message":"Too many requests. Try again in 60 seconds."]}
Retrieve all roster information
GET/api/v1/rosters
This endpoint is used to retrieve all roster information for a given Discord server and is returned in a JSON format. Rank information and flags are not omitted at this point for all rosters.
Headers
Name
Value
Content-Type
application/json
X-API-KEY
Generated API Key
Example Response (200 OK)
Field
Description
id
The unique roster UUID
name
Name of the roster
guild_id
The Discord server ID
active_players
Count of players within the roster
role_access
Array of Discord roles that have access to view the specific roster
announcement_channels
Array of Discord channels that will receive roster notifications (appointments, promotions)
announce_demotions
Boolean if FiveRoster will announce demotion events
announce_demotion_channels
Array of Discord channels that will receive roster demotion alerts
announce_strikes
Boolean if FiveRoster will announce strike events
announce_strikes_channels
Array of Discord channels that will receive roster strike alerts
created_by
Discord user ID of the individual who created the roster
Retrieve specific roster information
GET/api/v1/rosters/{roster_uuid}
This endpoint is used to retrieve specific roster information for a given Discord server and is returned in a JSON format. Rank information and flags IS omitted at this point for the roster.
Headers
Name
Value
Content-Type
application/json
X-API-KEY
Generated API Key
Example Response (200 OK)
Retrieve roster player information
GET/api/v1/rosters/{roster_uuid}/players
This endpoint is used to retrieve all roster player information for a given roster and is returned in a JSON format. This only includes players enrolled actively on the roster itself.
Headers
Name
Value
Content-Type
application/json
X-API-KEY
Generated API Key
Example Response (200 OK)
Code Examples
Here are some examples of how to request information from the FiveRoster API.
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main() {
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-KEY", "YOUR_API_KEY_HERE");
var response = await client.GetAsync("https://fiveroster.com/api/v1/rosters");
if (response.IsSuccessStatusCode) {
string data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
} else {
Console.WriteLine("Error: " + response.StatusCode);
}
}
}