Automatic Roster System Logo
Back to API Overview

GET /api/roster/{page_id}/{discord_id}

Get detailed information about a specific user in a roster.

Overview

This endpoint returns detailed information about a specific user in a roster page. The response includes the user's name, Discord ID, rank, certifications, subdivisions, and patrol hours (if available).

Note: You can only access roster pages that you own. For security reasons, attempting to access rosters owned by other users will result in a permission denied error.

Parameters

Path Parameters

Name Type Required Description
page_id string Yes The UUID of the roster page (e.g., c88006c8-b9ea-433c-8a8b-749ec1af0756)
discord_id string Yes The Discord ID of the user to retrieve information for

Headers

Name Required Description
X-API-Key Yes Your API key for authentication

Response

Response Fields

Field Type Description
name string The name of the user
discord_id string The Discord ID of the user
discord_username string The Discord username of the user
rank string The rank of the user
certifications array Array of certification names the user has
subdivisions array Array of subdivision names the user belongs to
promotion_date string The date the user was promoted to their current rank (YYYY-MM-DD)
promotion_officer string The name of the officer who promoted the user
patrol_hours number The number of patrol hours the user has (if patrol logs are enabled)

Example Response

{
  "name": "John Doe",
  "discord_id": "123456789012345678",
  "discord_username": "johndoe",
  "rank": "Commander",
  "certifications": ["Firearms", "Driving"],
  "subdivisions": ["SWAT", "K9"],
  "promotion_date": "2025-01-15",
  "promotion_officer": "Jane Smith",
  "patrol_hours": 42.5
}

Error Responses

404 Not Found - Roster

{
  "error": "Roster page not found"
}

404 Not Found - User

{
  "error": "User not found in roster"
}

401 Unauthorized

{
  "error": "Invalid or missing API key"
}

403 Forbidden

{
  "error": "API access requires premium subscription"
}

403 Forbidden - Permission Denied

{
  "error": "You do not have permission to access this roster"
}

This error occurs when you try to access a roster that you don't own. For security reasons, API keys can only access rosters owned by the user who created the API key.

Code Examples

cURL

curl -X GET "https://autorosters.com/api/roster/c88006c8-b9ea-433c-8a8b-749ec1af0756/123456789012345678" \
     -H "X-API-Key: your-api-key-here"

Python

import requests

api_key = "your-api-key-here"
page_id = "c88006c8-b9ea-433c-8a8b-749ec1af0756"
discord_id = "123456789012345678"
url = f"https://autorosters.com/api/roster/{page_id}/{discord_id}"

headers = {
    "X-API-Key": api_key
}

response = requests.get(url, headers=headers)
data = response.json()

print(data)

JavaScript

const apiKey = "your-api-key-here";
const pageId = "c88006c8-b9ea-433c-8a8b-749ec1af0756";
const discordId = "123456789012345678";
const url = `https://autorosters.com/api/roster/${pageId}/${discordId}`;

fetch(url, {
  method: "GET",
  headers: {
    "X-API-Key": apiKey
  }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));