Passwort vergessen? Registrieren
Basic Example

This basic example looks at the first steps in using the REST interface, it looks at how to:

  • Retrieve an access token
  • Check which systems are online for the customer
  • Check System Status
  • Retrieve the passings from a specified file
  • Retrieve all passings from a specified starting point

 

Generating Token

A POST request is sent to the token command using the apikey

Request URL: https://rest.devices.raceresult.com/token
Headers: {"apikey":"12345.ABCDE....."}

Response: {"access_token": "ey.....", "expires_in": 7200, "token_type": "Bearer"}

This access token will be used for all subsequent commands.

Listing Available Systems

We now want to see which devices are currently available, so call the devices command with the parameter connected=true, the authorization token is now sent in the header as a bearer authorization.

Request URL: https://rest.devices.raceresult.com/customers/12345/devices?connected=true
Headers: {"Authorization": "Bearer ey....."}

Response: { "Devices": [ {"Customer": 12345, "DeviceID": "D-1234", "FileNo": 52 .......},{"Customer": 12345, "DeviceID": "U-12345".....} ] }

With this, we receive a list of all systems which are currently connected to the Customer ID specified in the URL to which the API key corresponds. We have the current running information of the system and the full decoder status. 

In this example we will take note of the FileNo (52) for D-1234, this indicates the device's current file number which we will use to retrieve the desired passings. 

Check System Status

Once we have the device we want to use, we can periodically check the system status, this allows us to check if it is still connected, or displaying any errors. 

The devices command when used with a specific device ID in the URL returns the status for that system. 

Request URL: https://rest.devices.raceresult.com/customers/12345/devices/D-1234
Headers: {"Authorization": "Bearer ey....."}

Response: {"Connected": true, "DeviceType": "Decoder", "DecoderStatus": {"Protocol": 3.2, "Firmware": "2.55", "ActiveExtension": {"Connected": true,... }, ....} }

With this we can see that the system has an Active Extension connected and so is currently in active timing mode.  

 

Retrieve Specific Passings File

Expanding on this further we can now call the passings file which we know is currently active (52), this command will attempt to return all passings for that file.

Note that the maximum which can be returned in a single call is 10,000, if the command returns more than 10,000 it will return an error and you will need to use the fromPassing and amount parameters additionally.

It is recommended to always specify an amount of passings to return to prevent running into errors. 

Request URL: https://rest.devices.raceresult.com/devices/D-1234/files/52/passings
Headers: {"Authorization": "Bearer ey....."}

Response: {"Passings": [ {"Code": "ZAABB01", "PassingNo": 1, "RealTime": "2020-11-03T05:10:48.325-05:00", "LoopID": 1,... },{...}, ] }

Here the full passing record is returned, you may wish to only select fields which are relevant to your application, a full explanation of the passing record is available here.

It is also possible to retrieve a passings file from a specific starting point and srt a maximum number of passings to return, this is recommended when handling large passings files. 

×

Haben Sie eine Frage?

Unser Team berät Sie gern persönlich.

╳

Schreiben Sie uns!

Das Team von RACE RESULT berät Sie gerne zu Ihren individuellen Bedürfnissen, behebt bestehende Probleme und beantwortet Ihre Fragen. Kontaktieren Sie uns jetzt über das Formular.

Wenn Sie eine Support-Frage haben, fügen Sie bitte Ihre Event-ID hinzu!

Ich habe die Datenschutzbestimmungen gelesen.