Example Workflows

Retrieving Department Information

fetch('https://api.stationwise.com/api/organization/my-department/', {
  headers: {
    'Authorization': 'Token your-api-token-here'
  }
})
  .then(response => response.json())
  .then(data => {
    console.log('Department name:', data.name);
    console.log('Battalions:', data.battalions.length);
  });

Accessing Shift Roster Information

// Get roster for a specific date and battalion
fetch('https://api.stationwise.com/api/shift/external/roster/?date=2025-05-06&battalion_id=123', {
  headers: {
    'Authorization': 'Token your-api-token-here'
  }
})
  .then(response => response.json())
  .then(roster => {
    console.log('Stations:', roster.stations.length);
    console.log('Employees assigned:', roster.employees.length);
  });