High Scores API

A sample API for educational demonstration by Minae Lee

View source View client View OpenAPI in YAML View OpenAPI in JSON Return to companion page
View Redoc Reference View Rapidoc Reference

API base URL

https://highscores-api.glitch.me

API endpoints

HTTP Method Path Description
GET /highscores Retrieve all high scores
GET /highscore/{id} Retrieve one high score by ID
POST /highscores Add a new high score
PATCH /highscores/{id} Update a high score
PUT /highscore/{id} Replace a high score
DELETE /highscore/{id} Delete one high score by ID
DELETE /highscores/{id} Delete all high scores

Sample cURL commands

Use cURL commands to send test HTTP requests to endpoints.

get

curl https://highscores-api.glitch.me/highscores

get/{id}

curl https://highscores-api.glitch.me/highscore/1

post

For Windows Command Prompt (cmd.exe), use:
curl -X POST -H "Content-Type: application/json" -d "{\"name\": \"Player1\", \"score\": 100}" https://highscores-api.glitch.me/highscore
For macOS Terminal, zsh, bash, or WSL, use:
curl -X POST -H "Content-Type: application/json" -d '{"name": "Player1", "score": 100}' https://highscores-api.glitch.me/highscore

patch/{id}

For Windows Command Prompt (cmd.exe), use:
curl -X PATCH -H "Content-Type: application/json" -d "{\"score\": 150}" "https://highscores-api.glitch.me/highscore/1"
For macOS Terminal, zsh, bash, or WSL, use:
curl -X PATCH -H "Content-Type: application/json" -d '{"score": 150}' https://highscores-api.glitch.me/highscore/1

delete/{id}

curl -X DELETE https://highscores-api.glitch.me/highscore/1