Skip to content

Repository files navigation

rpi-scoreboard

Work in progress. Raspberry Pi Scoreboard US BYD and IOT solution.

API Overview

The application programming interface (API) allows you to programmatically query and make changes to Scoreboard US scoreboards.

This API is currently developed for a standard baseball scoreboard, but will be expanded to support other standard sport configurations. Since the API is based on REST principles, it conforms to some standard resource-oriented practices for naming conventions and data manipulation. You can use your browser to access URLs, and you can use any HTTP client in any programming language to interact with the API.

Authentication

Basic, but Not supported yet.

REST API

If you are new to REST, here’s a few resources to get you started:

Understanding Resources
A Million APIs
RESTful Design

On to the API

Each resource () has a similar structure. For example, the API will respond to the following commands for /status/score to read the current score.

HTTP Method: GET
Recieve: JSON

Example:


Request:
http://XXX.XXX.XXX.XXX:3001/status/score

Reply:

HTTP/1.1 200 OK

Date: Wed, 29 Aug 2018 16:20:12 GMT
Etag: W/"5b-pbuDJZbxdBbkWtGY/kuskWGKeEM"
Content-Type: application/json; charset=utf-8
Connection: keep-alive
X-Powered-By: Express
Content-Length: 91

{
"message": "Success",
"homeScore": 0,
"awayScore": 0,
"inning": 0,
"balls": 0,
"strikes": 0,
"outs": 0
}

Resources:

/setDigit


URL:

/setDigit/resetScore
/setDigit/home/add
/setDigit/home/subtract
/setDigit/away/add
/setDigit/away/subtract
/setDigit/inning/add
/setDigit/inning/subtract
/setDigit/balls/add
/setDigit/balls/subtract
/setDigit/strikes/add
/setDigit/strikes/subtract
/setDigit/outs/add
/setDigit/outs/subtract
/setDigit/home/"Set numerical value"
/setDigit/away/"Set numerical value"
/setDigit/inning/"Set numerical value"

/status


URL:

/status/score"
/status/serialport
/status/serialport/open
/status/serialport/close

About

Work in progress. Raspberry Pi Scoreboard US BYD solution.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages