Randomizer API Documentation

Spring 2019

Overview

This web service will provide the teams to be randomly chosen in either text or json format.

Randomizer API

Endpoint: https://courses.cs.washington.edu/courses/cse154/19sp/tools/randomizer/randomizer.php

The web service randomizer.php, provides data about each of the team with one “GET” query and either text or json as a parameter.

Query 1: Get team names as text

Request Format: randomizer.php?mode=text
Request Type: GET
Returned Data Format: plain text

Description: This first request takes the parameter mode with the value text and returns a plain text response with all of the team names currently participating.

Request: https://courses.cs.washington.edu/courses/cse154/19sp/tools/randomizer/randomizer.php?mode=text

Output:



    Catz
    Dawgs
    Those in the back row
    No name team 1
        

Query 2: Get all team data in JSON format

Request Format: randomizer.php?mode=json
Request Type: GET
Returned Data Format: JSON

Description: The second request type takes as a parameter mode with the value json and returns a detailed JSON object containing all of the data about this team (team name and team members).

Request: https://courses.cs.washington.edu/courses/cse154/19sp/tools/randomizer/randomizer.php?mode=json

Example Output:



1 {
2   "teams": [
3     {
4       "name": "Catz",
5       "students": ["Jack", "Spot", "Whitney", "Charlie"]
6     },
7     {
8       "name": "Dawgs",
9       "students": ["Mowgli", "Ruby", "Moss"]
10     },
11     ...
??   ]