The Dice Roll API provides endpoints for simulating dice rolls. It allows clients to request a roll of a single die with a specified number of sides, multiple dice rolls at once, and retrieving the result of a previous roll using its UUID.
/api/roll/single/:sides
sides
: Number of sides of the die.store
: Optional query parameter to store the roll result.# Roll a 6-sided die without storing the result
curl https://yourapiurl.com/api/roll/single/6
# Roll a 20-sided die and store the result
curl https://yourapiurl.com/api/roll/single/20?store=true
/api/roll/multiple
store
: Optional query parameter to store the roll results.# Roll multiple dice without storing the results
curl -X POST -H "Content-Type: application/json" \
-d '{"dice":[{"sides":6, "rolls":2}, {"sides":10, "rolls":1}]}' \
https://yourapiurl.com/api/roll/multiple
# Roll multiple dice and store the results
curl -X POST -H "Content-Type: application/json" \
-d '{"dice":[{"sides":6, "rolls":2}, {"sides":10, "rolls":1}]}' \
https://yourapiurl.com/api/roll/multiple?store=true
/api/roll
uuid
: UUID of the stored dice roll.# Retrieve a dice roll with a specific UUID
curl https://yourapiurl.com/api/roll?uuid=your-uuid-here