| |
Reference: RidgeStar-Rest API |
Criteria is now using saved Site values
Sites with the RidgeStar REST (Representational State Transfer) API (Application Programming Interface) active will be capable of interacting with remote Clients (other websites and/or programs at other Internet end-points), as follows:
The APIThe API has been built to generally conform to commonly accepted standards associated with RESTful Servers. This is not to say that the API is 100% a REST implementation, but it has made efforts to adhere to the principles and concepts embodied by REST. The API is built upon a few basic terms that should be clarified from the outset: - Resource
- Identifies a logical set of information available from the API. In this context, a Resource might refer to a single database table, might be a subset or superset of one or more database tables, or might even be simple meta-data available to describe the available Resources.
- Properties
- Each Resource has one or more Properties that, in turn, have one or more values. Conceptually, when a Resource is the result of a data table, a Property is a data field within the data table and the Property's value is synonymous with the data field value.
SyntaxThe API Get has the general form: {protocol}:// {site} /api {/resource} [.{format}] [/{item} ...] [? {keywords} ] ] where... - protocol
- Specifies the connection protocol to be followed. Use "HTTPS" (if TLS certificates are supported by the {site}), otherwise use "HTTP".
- site
- The identity, name, or destination containing the REST Server
- api
- The lower case constant "api" specifies that you desire to contact the Application Program (REST) Interface for the {site}
- resource
- The named "Resource" available from the {site} via the API
- format
- The Type of response expected/preferred. Specify .json (the default if no {format} is specified), .xml, or .html (if desired). The Get Request Accept Header will be honored (application/json, application/xml, or text/html), if provided, but will be overridden by the {format} specified in the URI (if present).
- item
- An optional specific Item within the Resource. Additional {item} specification can be provided, if the Resource offers multiple levels of data available (varies by {site} and Resource).
- keywords
- Provides additional qualifiers to control the contents of the response and can contain....
- criteria
- permits the query to be constructed such that Boolean conditions can be specified. General syntax is
criteria={argument=value [{,|:} ...]] } [{,|:}{argument=value[, ...]} ] Each {argument and value pair is ORed (,) or ANDed(:) together} which is then ORed (,) or ANDed(:) with the other {...} entries to develop the list of data records that will be returned.The operator to specify the AND condition within individual {...} entities is a colon (:) NOT an ampersand. This is because the ampersand is parsed as an independent HTTP element and, thus, is not a portion of the criteria element the REST Server can utilize. (Note: REST Version 5.3.3 will accept either syntax, but....use the colon, not the ampersand for clarity). - expand
- Identifies the exact Properties of the Resource that should be "expanded" to an array containing all pertinent Properties of the Item. This is useful to obtain detailed information about a Resource Property that does, itself, also represent a Resource with distinct Properties.
There are specialized grouping values that can be specified to imply expansion to more than one Property in the Resource: - Positions: requests that all Referee positions be expanded (Ref, AR1, AR2, ... as specified in the {site}
- Dates: requests that all Dates and DateTime defined Properties that are returned be expanded to include additional detail about the Date and Time (TimeZone, etc.)
- limit
- The number of entries to return in the response (default is unspecified or "No limit")
- offset
- The first entry to include in the response (default is 1 or the "first" entry)
- order
- Specified the sequence that sorts the resulting response entries (detault is defined by the {site} Resource definition).
- properties
- Identifies the individual Properties that should be returned (a list of properties is delimited by a comma). The default set of Properties returned for a Resource is defined by the {site}
- Positions
- keywords defined by the Resource can be provided to control which Items in the Resource will be obtained
- {criteria}
- keywords defined by the Resource can be provided to control which Items in the Resource will be obtained. Specifying multiple keywords (e.g. dmaGender=G&dmaLevel=U14) implies a boolean AND between the data elements. Use the criteria keyword itself to specify any desired boolean OR conditions.
ExamplesAll the following examples can be executed by clicking the desired symbol (for HTML, JSON, or XML) below and are sent to Referees.biz for processing. - /officers
- Get a list of all Chapter Officers
- /officers/17
- Get all default Properties for a specific individual
- /matches?dmaClient=LakeView&dmaLevel=U16&dmaDate[from]=2020-11-30
- Retrieve Matches for a specific Client and Level of play between specific Dates
- /matches?dmaLevel=U14,U15
- Retrieve Matches for 2 different Levels of play
- Sending
- https://www.referees.biz/api/matches.html?dmaLevel=U14,U15
- Request Headers
rsr-Date: 2024-11-21T06:10:09-08:00 Content-Type: application/json; rsr-Powered-By: RidgeStar/6.3.0 - Response Headers
HTTP_Response: 200 Date: Thu, 21 Nov 2024 14:10:09 GMT
Server: Apache/2.4.62 (Fedora Linux) OpenSSL/3.2.2
X-Powered-By: PHP/8.3.13
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
rsr-Powered-By: server/6.2.6
rsr-Resource: matches total=65, first=1, last=10
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: rsr-Powered-By,rsr-Resource
Set-Cookie: PHPSESSID=egbq8m835cf7shm66qaa3plvt2; path=/; SameSite=Strict
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8 - Data returned
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><body><p><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><body><h1>Matches</h1><p><ol><ol><li>dmaKey=61</li><li>dmaDate=2024-02-24</li><li>dmaTime=10:01:00</li><li>dmaField=22</li><li>dmaStatus=Normal</li><li>dmaClient=KIDS</li><li>dmaLeague=WSYL</li><li>dmaGender=M</li><li>dmaLevel=U14</li><li>dmaDivision=2</li><li>dmaSeason=</li><li>dmaHome=Boys 142</li><li>dmaAway=Needham</li><li>dmaPositions=<ol><li>dmaRef=15</li><li>dmaAR1=15</li><li>dmaAR2=0</li><li>dma4th=0</li></ol></li><li>dloKey=3</li><li>dloName=Bell College</li><li>dloAddress=10501 NE 2nd Street</li><li>dloCity=Bellevue</li><li>dloState=WA</li><li>dloZip=98004</li><li>dloLongitude=-122.2000388</li><li>dloLatitude=47.6120017</li><li>dfdKey=22</li><li>dfdName=BC#3</li></ol></ol><ol><ol><li>dmaKey=111</li><li>dmaDate=2024-07-07</li><li>dmaTime=18:45:00</li><li>dmaField=22</li><li>dmaStatus=Normal</li><li>dmaClient=</li><li>dmaLeague=D2</li><li>dmaGender=B</li><li>dmaLevel=U14</li><li>dmaDivision=1</li><li>dmaSeason=Fall</li><li>dmaHome=Cold Ones</li><li>dmaAway=Swollen Knees</li><li>dmaPositions=<ol><li>dmaRef=45</li><li>dmaAR1=0</li><li>dmaAR2=0</li><li>dma4th=0</li></ol></li><li>dloKey=3</li><li>dloName=Bell College</li><li>dloAddress=10501 NE 2nd Street</li><li>dloCity=Bellevue</li><li>dloState=WA</li><li>dloZip=98004</li><li>dloLongitude=-122.2000388</li><li>dloLatitude=47.6120017</li><li>dfdKey=22</li><li>dfdName=BC#3</li></ol></ol><ol><ol><li>dmaKey=6</li><li>dmaDate=2024-07-27</li><li>dmaTime=08:01:00</li><li>dmaField=26</li><li>dmaStatus=Normal</li><li>dmaClient=NYSA</li><li>dmaLeague=WSYL</li><li>dmaGender=G</li><li>dmaLevel=U15</li><li>dmaDivision=2</li><li>dmaSeason=Summer</li><li>dmaHome=Powerhouse</li><li>dmaAway=Blue Lightning</li><li>dmaPositions=<ol><li>dmaRef=11</li><li>dmaAR1=18</li><li>dmaAR2=129</li><li>dma4th=0</li></ol></li><li>dloKey=7</li><li>dloName=Indoor Soccer Arena</li><li>dloAddress=12728 N.E. 178th Street</li><li>dloCity=Woodinville</li><li>dloState=WA</li><li>dloZip=98072</li><li>dloLongitude=-122.1690883</li><li>dloLatitude=47.7568813</li><li>dfdKey=26</li><li>dfdName=IA#2</li></ol></ol><ol><ol><li>dmaKey=57</li><li>dmaDate=2024-08-06</li><li>dmaTime=10:00:00</li><li>dmaField=33</li><li>dmaStatus=Normal</li><li>dmaClient=HSC</li><li>dmaLeague=WSYL</li><li>dmaGender=B</li><li>dmaLevel=U14</li><li>dmaDivision=1</li><li>dmaSeason=</li><li>dmaHome=anytown</li><li>dmaAway=anycity</li><li>dmaPositions=<ol><li>dmaRef=0</li><li>dmaAR1=0</li><li>dmaAR2=0</li><li>dma4th=0</li></ol></li><li>dloKey=10</li><li>dloName=Sixty Acres</li><li>dloAddress=11600 154th Place NE</li><li>dloCity=Redmond</li><li>dloState=WA</li><li>dloZip=98052</li><li>dloLongitude=-122.1336082</li><li>dloLatitude=47.7039921</li><li>dfdKey=33</li><li>dfdName=60 Acres#2</li></ol></ol><ol><ol><li>dmaKey=97</li><li>dmaDate=2024-09-06</li><li>dmaTime=12:15:00</li><li>dmaField=34</li><li>dmaStatus=Cancelled</li><li>dmaClient=BWSA</li><li>dmaLeague=WSYL</li><li>dmaGender=B</li><li>dmaLevel=U15</li><li>dmaDivision=1</li><li>dmaSeason=Spring</li><li>dmaHome=Anaconda</li><li>dmaAway=Rambo</li><li>dmaPositions=<ol><li>dmaRef=</li><li>dmaAR1=</li><li>dmaAR2=</li><li>dma4th=0</li></ol></li><li>dloKey=10</li><li>dloName=Sixty Acres</li><li>dloAddress=11600 154th Place NE</li><li>dloCity=Redmond</li><li>dloState=WA</li><li>dloZip=98052</li><li>dloLongitude=-122.1336082</li><li>dloLatitude=47.7039921</li><li>dfdKey=34</li><li>dfdName=60 Acres#3</li></ol></ol><ol><ol><li>dmaKey=1267</li><li>dmaDate=2024-09-20</li><li>dmaTime=13:00:00</li><li>dmaField=34</li><li>dmaStatus=Normal</li><li>dmaClient=NYSA</li><li>dmaLeague=WSYL</li><li>dmaGender=B</li><li>dmaLevel=U14</li><li>dmaDivision=3</li><li>dmaSeason=</li><li>dmaHome=Racers</li><li>dmaAway=Powerhouse</li><li>dmaPositions=<ol><li>dmaRef=17</li><li>dmaAR1=0</li><li>dmaAR2=0</li><li>dma4th=0</li></ol></li><li>dloKey=10</li><li>dloName=Sixty Acres</li><li>dloAddress=11600 154th Place NE</li><li>dloCity=Redmond</li><li>dloState=WA</li><li>dloZip=98052</li><li>dloLongitude=-122.1336082</li><li>dloLatitude=47.7039921</li><li>dfdKey=34</li><li>dfdName=60 Acres#3</li></ol></ol><ol><ol><li>dmaKey=65</li><li>dmaDate=2024-09-20</li><li>dmaTime=14:30:00</li><li>dmaField=34</li><li>dmaStatus=Normal</li><li>dmaClient=NYSA</li><li>dmaLeague=WSYL</li><li>dmaGender=B</li><li>dmaLevel=U14</li><li>dmaDivision=3</li><li>dmaSeason=</li><li>dmaHome=Racers</li><li>dmaAway=Powerhouse</li><li>dmaPositions=<ol><li>dmaRef=46</li><li>dmaAR1=7</li><li>dmaAR2=0</li><li>dma4th=0</li></ol></li><li>dloKey=10</li><li>dloName=Sixty Acres</li><li>dloAddress=11600 154th Place NE</li><li>dloCity=Redmond</li><li>dloState=WA</li><li>dloZip=98052</li><li>dloLongitude=-122.1336082</li><li>dloLatitude=47.7039921</li><li>dfdKey=34</li><li>dfdName=60 Acres#3</li></ol></ol><ol><ol><li>dmaKey=120</li><li>dmaDate=2024-10-05</li><li>dmaTime=14:30:00</li><li>dmaField=34</li><li>dmaStatus=Normal</li><li>dmaClient=NYSA</li><li>dmaLeague=WSYL</li><li>dmaGender=B</li><li>dmaLevel=U14</li><li>dmaDivision=2</li><li>dmaSeason=</li><li>dmaHome=Racers</li><li>dmaAway=Munchhausen</li><li>dmaPositions=<ol><li>dmaRef=6</li><li>dmaAR1=0</li><li>dmaAR2=0</li><li>dma4th=0</li></ol></li><li>dloKey=10</li><li>dloName=Sixty Acres</li><li>dloAddress=11600 154th Place NE</li><li>dloCity=Redmond</li><li>dloState=WA</li><li>dloZip=98052</li><li>dloLongitude=-122.1336082</li><li>dloLatitude=47.7039921</li><li>dfdKey=34</li><li>dfdName=60 Acres#3</li></ol></ol><ol><ol><li>dmaKey=1205</li><li>dmaDate=2024-10-27</li><li>dmaTime=08:00:00</li><li>dmaField=33</li><li>dmaStatus=Normal</li><li>dmaClient=LakeView</li><li>dmaLeague=WSYL</li><li>dmaGender=g</li><li>dmaLevel=U14</li><li>dmaDivision=1</li><li>dmaSeason=Spring</li><li>dmaHome=Robbers</li><li>dmaAway=FC United</li><li>dmaPositions=<ol><li>dmaRef=1</li><li>dmaAR1=74</li><li>dmaAR2=78</li><li>dma4th=0</li></ol></li><li>dloKey=10</li><li>dloName=Sixty Acres</li><li>dloAddress=11600 154th Place NE</li><li>dloCity=Redmond</li><li>dloState=WA</li><li>dloZip=98052</li><li>dloLongitude=-122.1336082</li><li>dloLatitude=47.7039921</li><li>dfdKey=33</li><li>dfdName=60 Acres#2</li></ol></ol><ol><ol><li>dmaKey=1204</li><li>dmaDate=2024-10-27</li><li>dmaTime=20:00:00</li><li>dmaField=32</li><li>dmaStatus=Normal</li><li>dmaClient=</li><li>dmaLeague=WSYL</li><li>dmaGender=b</li><li>dmaLevel=U15</li><li>dmaDivision=1</li><li>dmaSeason=Spring</li><li>dmaHome=Raiders</li><li>dmaAway=MetroStars</li><li>dmaPositions=<ol><li>dmaRef=0</li><li>dmaAR1=0</li><li>dmaAR2=0</li><li>dma4th=0</li></ol></li><li>dloKey=10</li><li>dloName=Sixty Acres</li><li>dloAddress=11600 154th Place NE</li><li>dloCity=Redmond</li><li>dloState=WA</li><li>dloZip=98052</li><li>dloLongitude=-122.1336082</li><li>dloLatitude=47.7039921</li><li>dfdKey=32</li><li>dfdName=60 Acres#1</li></ol></ol></p></body></html></p></body></html>
- /matches?criteria={dmaLevel=U14},{dmaLeague=NFHS}
- Retrieve Matches for a specific Level of Play OR in a specific League of play
- /matches/1137?properties=dmaKey,dmaDate,dmaRef
- Get 3 Property values for a specific Match
- /matches/1137?properties=dmaKey,dmaDate,dmaRef&expand=dmaRef,Dates
- Expand data fields to obtain translated values
- /matches?properties=dmaKey,dmaDate,dmaRef,dmaAR1,dmaAR2&dmaPositions=17
- Obtain assignments for a specific Referee
- /matches?dmaLevel=U14&offset=4&limit=2
- Starting with the fourth Match, list only 2
- /doc
- Retrieve information about the API and Site hosting it
- /doc/resources/locations
- Obtain a description of the Get options for the Resource named "locations"
|