Introduction
Welcome to the Sim Racing Limited Venue Management System (VMS) API! You can use the API to access data for use in your internal business systems or for creating customer-facing applications, and to add data to your VMS database from your own systems.
Please ensure that you use proper parsing libraries to handle the API responses, as additional fields may be added to endpoint output in the future. We aim never to remove fields from the output in a specific API version.
If you experience any issues, or feel that improvements could be made in either the API or the documentation, please don't hesitate to contact us.
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl "https://api.simracing.co.uk/v0.1/api_endpoint_here" \
-H "Authorization: SRL <your-API-key>"
Make sure to replace
<your-API-key>
with your API key.
Sim Racing Limited uses API keys to grant access to the API. API keys may be generated via the API section of the Account Management pages.
We strongly encourage that each application you write that requires API access has a separate API key. This means that should an API key need to be revoked, only a single application will be affected. For the same reason, we also encourage that you reference the API key in a single location in your application.
Up to three API keys may be generated via the Account Management site. Please contact us if you require additional keys.
API keys may be revoked/regenerated at your request, or may be revoked if we detect that the key has been compromised. Wherever possible we will attempt to contact you before revoking a key.
The VMS API requires the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: SRL <your-API-key>
Permissions
New API keys initially only have read access to the VMS database, so cannot alter any data, and also do not have access to your customers' personally identifiable information, such as their e-mail addresses and phone numbers.
If you attempt to access an API endpoint which the key does not have permission to access, you will receive a 403 Forbidden
error, and a response body stating that 'API key permissions do not permit access to this resource'.
You may alter your API key permissions to allow write access and/or access to customer PII, as well as adjust the specific endpoints that can be accessed. API key permissions can be configured via the API section of the Account Management pages.
Protocol Security
All requests made to the VMS API must be made via TLS (SSL) to the default HTTPS port, 443. This ensures the security and integrity of communications between Sim Racing Limited systems and your application.
Please ensure that the client or language you use to interact with the VMS API supports TLS 1.0 or higher. TLS 1.2 is recommended, as TLS 1.0 and 1.1 support may be deprecated in future API releases.
Compression
Gzip compression of returned data is optionally available for all endpoints. Gzip compression is recommended for applications that frequently transfer a lot of data (for example, a custom SWP replacement that may have to display several hundred laps at a time), or for applications that transfer data over unreliable network links such as a cellular network.
Gzip compression may be enabled by setting the following header in the request:
Accept-Encoding: gzip
If this header is set, your application will need to decompress the data before parsing it. Many libraries include inbuilt support for gzip decompression.
Rate Limiting
To prevent excessive load on the servers, and to provide good performance for all licensees, all API keys have associated rate limits for requests. Rate limits are reset at the start of every hour. Our default rate limit for API keys is 2,000 requests/hour.
Your current and historic usage may be viewed in the API section of the Account Management site, by clicking on the graph icon next to the relevant API key.
Please contact us if you find the default rate limits to be restrictive to your routine usage patterns.
Timezones
To authorize supplying your timezone, use this code:
# With shell, you can just pass the correct headers with each request
curl "https://api.simracing.co.uk/v0.1/api_endpoint_here" \
-H "Authorization: SRL <your-API-key>" \
-H "timezone-offset: <your-offset>" \
Make sure to replace
<your-API-key>
with your API key and<your-offset>
with your offset from UTC, in hours.
API queries which check whether something is in the past or the future require knowledge of the timezone of your request in order to accurately determine this information. Currently this includes listing hotlapping events, and listing bookings. If you wish to use the 'past' and 'future' query parameters with these endpoints, we highly recommend providing your timezone, otherwise the current UTC time will be used to determine whether something is in the past or the future.
Your timezone should be provided in a header named timezone-offset
, which takes a positive or negative value specifiying the offset from UTC to use. For example, if you are on the west coast of the US, and daylight savings time is not active, you should include a header that looks like the following:
timezone-offset: -8
You may include the timezone offset header in all API requests, to ensure that it is used when appropriate.
The timezone offset header does not alter the date or time fields of returned results. All date and time fields are considered to be in the local venue time, so are not translated.
If you do not wish to provide your timezone offset, it is highly recommended that you do not rely on 'past' or 'future' query parameters, and instead retrieve all data from a specific endpoint, and locally process the data to determine whether something is in the past or future.
Return and Error Codes
The VMS API uses the following return codes:
Return Code | Meaning |
---|---|
200 | OK -- Your request was successful. |
The VMS API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request had invalid, missing or conflicting data. Usually, an error message will also be returned with more information. |
401 | Unauthorized -- Your API key is incorrect or invalid. |
403 | Forbidden -- Either the API key permissions are set to disallow your request, or the account licence does not permit access to the specified API endpoint. Contact Sim Racing Limited for upgrade options. |
404 | Not Found -- The API endpoint was incorrect. |
405 | Method Not Allowed -- Your request was not valid for the specified API endpoint. |
429 | Too Many Requests -- You have exceeded the API rate limit for your API key. |
500 | Internal Server Error -- We had a problem fulfilling the request. Try again later or contact support. |
503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. |
Retrieving Data
An HTTP GET
request should be made to the appropriate endpoint, documented below, to retrieve information from the API. Ensure that you include your API key in all requests, as documented in the authentication instructions.
Bookings
Access to the booking endpoints requires the bookings feature to be enabled for your VMS account. If this feature is not enabled, you will receive a 403 error when attempting to access these endpoints.
List Bookings
curl "https://api.simracing.co.uk/v0.1/bookings" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<bookings>
<booking>
<id>1</id>
<event_name>Christmas Eve Party!</event_name>
<start_date>2018-12-24 18:00:00</start_date>
<end_date>2018-12-24 22:00:00</end_date>
<status>Booked</status>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<event_activity>Hotlapping</event_activity>
<group_size>60</group_size>
<number_of_pods>10</number_of_pods>
<requested_vehicles>
<vehicle>
<vehicle_id>1</vehicle_id>
<vehicle_name>1991 McLaren MP4/6</vehicle_name>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
</vehicle>
...
</requested_vehicles>
<requested_circuits>
<circuit>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
</circuit>
...
</requested_circuits>
<participants>
<customer>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
</customer>
...
</participants>
<staffing_notes>Peter unavailable to assist due to vacation.</staffing_notes>
<notes>Whole venue booking for Christmas party.</notes>
<payment_notes>20% deposit paid in advance, remainder to be paid on day.</payment_notes>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</booking>
...
</bookings>
This endpoint lists all available bookings.
HTTP Request
GET https://api.simracing.co.uk/v0.1/bookings
Query Parameters
Parameter | Default | Description |
---|---|---|
past | 1 | Include historic bookings. |
future | 1 | Include bookings in the future. |
Notes
- When using the 'past' and 'future' query parameters to filter results, it is highly recommended that you also supply your timezone, to ensure accurate results.
- Depending on the booking, either a
number_of_pods
field, containing a single number, or aspecific_pods
field, containing a list of comma-separated pod numbers, may be present.
Get a Specific Booking
curl "https://api.simracing.co.uk/v0.1/bookings/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<booking>
<id>1</id>
<event_name>Christmas Eve Party!</event_name>
<start_date>2018-12-24 18:00:00</start_date>
<end_date>2018-12-24 22:00:00</end_date>
<status>Booked</status>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<event_activity>Hotlapping</event_activity>
<group_size>60</group_size>
<number_of_pods>10</number_of_pods>
<requested_vehicles>
<vehicle>
<vehicle_id>1</vehicle_id>
<vehicle_name>1991 McLaren MP4/6</vehicle_name>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
</vehicle>
...
</requested_vehicles>
<requested_circuits>
<circuit>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
</circuit>
...
</requested_circuits>
<participants>
<customer>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
</customer>
...
</participants>
<staffing_notes>Peter unavailable to assist due to vacation.</staffing_notes>
<notes>Whole venue booking for Christmas party.</notes>
<payment_notes>20% deposit paid in advance, remainder to be paid on day.</payment_notes>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</booking>
This endpoint retrieves the details of the specified booking.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the booking to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/booking/<ID>
Notes
- Depending on the booking, either a
number_of_pods
field, containing a single number, or aspecific_pods
field, containing a list of comma-separated pod numbers, may be present.
Championships
Access to the championship endpoints requires the championships feature to be enabled for your VMS account. If this feature is not enabled, you will receive a 403 error when attempting to access these endpoints.
List Championships
curl "https://api.simracing.co.uk/v0.1/championships" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<championships>
<championship>
<id>1</id>
<name>1966 World Championship</name>
<venues>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<most_recent_event>2018-03-05 22:03:50</most_recent_event>
<championship_uri>https://api.simracing.co.uk/v0.1/championships/1</championship_uri>
</championship>
...
</championships>
This endpoint lists all available championships.
HTTP Request
GET https://api.simracing.co.uk/v0.1/championships
Get a Specific Championship
curl "https://api.simracing.co.uk/v0.1/championships/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<championships>
<championship>
<id>1</id>
<name>1966 World Championship</name>
<venues>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<max_events_counted>5</max_events_counted>
<summary>
<result>
<position>1</position>
<customer_id>4</customer_id>
<customer_name>Jack Brabham</customer_name>
<class_id>1</class_id>
<class_name>World Champions</class_name>
<score>45</score>
<max_counted_score>42</max_counted_score>
<events>
<event>
<number>1</number>
<id>844</id>
<type>group_event</type>
<position>20</position>
<score>0</score>
<group_event_uri>https://api.simracing.co.uk/v0.1/group_events/844</group_event_uri>
</event>
...
</events>
</result>
...
</summary>
<events>
<event>
<id>844</id>
<name>Monaco Grand Prix</name>
<start_date>2017-01-09 18:02:13</start_date>
<end_date>2017-01-09 21:58:45</end_date>
<venues>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<type>group_event</type>
<summary>
<result>
<position>1</position>
<customer_id>4</customer_id>
<customer_name>Jack Brabham</customer_name>
<qualification_points>9</qualification_points>
<race_points>70</race_points>
<fastest_practice_lap_id>1693339</fastest_practice_lap_id>
<fastest_practice_lap_time_ms>124533</fastest_practice_lap_time_ms>
<fastest_practice_lap_time_str>2:04.533</fastest_practice_lap_time_str>
<fastest_practice_lap_transmission>Manual</fastest_practice_lap_transmission>
<fastest_qualification_lap_id>1693406</fastest_qualification_lap_id>
<fastest_qualification_lap_time_ms>125928</fastest_qualification_lap_time_ms>
<fastest_qualification_lap_time_str>2:05.928</fastest_qualification_lap_time_str>
<fastest_qualification_lap_transmission>Manual</fastest_qualification_lap_transmission>
<fastest_race_lap_id>1693763</fastest_race_lap_id>
<fastest_race_lap_time_ms>123949</fastest_race_lap_time_ms>
<fastest_race_lap_time_str>2:03.949</fastest_race_lap_time_str>
<fastest_race_lap_transmission>Manual</fastest_race_lap_transmission>
<class_id>1</class_id>
<class_name>World Champion</class_name>
<race_wins>7</race_wins>
<total_points>79</total_points>
<practice_telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1693339&hash=abc</practice_telemetry_uri>
<qualification_telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1693406&hash=abc</qualification_telemetry_uri>
<race_telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1693763&hash=abc</race_telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/4</customer_uri>
<practice_lap_uri>https://api.simracing.co.uk/v0.1/laps/1693339</practice_lap_uri>
<qualification_lap_uri>https://api.simracing.co.uk/v0.1/laps/1693406</qualification_lap_uri>
<race_lap_uri>https://api.simracing.co.uk/v0.1/laps/1693763</race_lap_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
</result>
...
</summary>
<group_event_uri>https://api.simracing.co.uk/v0.1/group_events/844</group_event_uri>
</event>
...
</events>
<championship_uri>https://api.simracing.co.uk/v0.1/championships/1</championship_uri>
</championship>
</championships>
This endpoint retrieves the details of the specified championship, including the overall championship summary and a summary of each event in the championship.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the championship to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/championship/<ID>
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically. - The XML returned for a championship can be very big -- it is recommended to use gzip compression to reduce data transit times.
Circuits
Get a List of Circuits
curl "https://api.simracing.co.uk/v0.1/circuits" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<circuits>
<circuit>
<id>1</id>
<name>A1 Ring - GP</name>
<length>4.326</length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<vehicle_records_uri>https://api.simracing.co.uk/v0.1/circuits/1/vehicle_records</vehicle_records_uri>
<customer_records_uri>https://api.simracing.co.uk/v0.1/circuits/1/customer_records</customer_records_uri>
</circuit>
<circuit>
<id>2</id>
<name>Adelaide - GP 1994</name>
<length>3.78</length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/2</circuit_uri>
<vehicle_records_uri>https://api.simracing.co.uk/v0.1/circuits/2/vehicle_records</vehicle_records_uri>
<customer_records_uri>https://api.simracing.co.uk/v0.1/circuits/2/customer_records</customer_records_uri>
</circuit>
...
</circuits>
This endpoint lists all available circuits, in alphabetical order.
HTTP Request
GET https://api.simracing.co.uk/v0.1/circuits
Get a Specific Circuit
curl "https://api.simracing.co.uk/v0.1/circuits/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<circuit>
<id>1</id>
<name>A1 Ring - GP</name>
<length>4.326</length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<vehicle_records_uri>https://api.simracing.co.uk/v0.1/circuits/1/vehicle_records</vehicle_records_uri>
<customer_records_uri>https://api.simracing.co.uk/v0.1/circuits/1/customer_records</customer_records_uri>
</circuit>
This endpoint retrieves a specific circuit.
HTTP Request
GET https://api.simracing.co.uk/v0.1/circuit/<ID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the circuit to retrieve |
Get Vehicle Lap Records for a Circuit
curl "https://api.simracing.co.uk/v0.1/circuits/1/vehicle_records" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<circuit>
<id>1</id>
<name>A1 Ring - GP</name>
<length>4.326</length>
<vehicle_results>72</vehicle_results>
<results>
<result>
<date>2015-05-17 16:27:50</date>
<customer_id>2</customer_id>
<customer_name>Graham Hill</customer_name>
<lap_id>1229486</lap_id>
<lap_time_ms>69763</lap_time_ms>
<lap_time_str>1:09.763</lap_time_str>
<transmission>Manual</transmission>
<vehicle_id>1</vehicle_id>
<vehicle_name>1991 McLaren MP4/6</vehicle_name>
<vehicle_engine>3493cc</vehicle_engine>
<class_id>1</class_id>
<class_name>World Champion</class_name>
<class_icon>A</class_icon>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<invalid>0</invalid>
<verified>0</verified>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1229486&hash=abc</telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1229486</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</result>
...
</results>
</circuit>
This endpoint retrieves the fastest lap recorded by each vehicle for the specified circuit.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the circuit to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/circuits/<ID>/vehicle_records
Query Parameters
Parameter | Default | Description |
---|---|---|
index | 0 | The starting index for the list of results. |
count | 1000 | The number of results returned. |
invalid | 0 | Whether to include invalidated laps. |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically.
Get Customer Lap Records for a Circuit
curl "https://api.simracing.co.uk/v0.1/circuits/1/customer_records" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<circuit>
<id>1</id>
<name>A1 Ring - GP</name>
<length>4.326</length>
<customer_results>11447</customer_results>
<results>
<result>
<date>2015-05-17 16:27:50</date>
<customer_id>2</customer_id>
<customer_name>Graham Hill</customer_name>
<lap_id>1229486</lap_id>
<lap_time_ms>69763</lap_time_ms>
<lap_time_str>1:09.763</lap_time_str>
<transmission>Manual</transmission>
<vehicle_id>1</vehicle_id>
<vehicle_name>1991 McLaren MP4/6</vehicle_name>
<vehicle_engine>3493cc</vehicle_engine>
<class_id>1</class_id>
<class_name>World Champion</class_name>
<class_icon>A</class_icon>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<invalid>0</invalid>
<verified>0</verified>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1229486&hash=abc</telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1229486</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</result>
...
</results>
</circuit>
This endpoint retrieves the fastest lap recorded by each customer for the specified circuit.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the circuit to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/circuits/<ID>/customer_records
Query Parameters
Parameter | Default | Description |
---|---|---|
index | 0 | The starting index for the list of results. |
count | 1000 | The number of results returned. |
invalid | 0 | Whether to include invalidated laps. |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically.
Classes
Get a List of Classes
curl "https://api.simracing.co.uk/v0.1/classes" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<classes>
<class>
<id>1</id>
<name>Class A</name>
<short_name>A</short_name>
<icon>A</icon>
<description>Class A</description>
<order>1</order>
<default>false</default>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
</class>
<class>
<id>2</id>
<name>Class B</name>
<short_name>B</short_name>
<icon>B</icon>
<description>Class B</description>
<order>2</order>
<default>false</default>
<class_uri>https://api.simracing.co.uk/v0.1/classes/2</class_uri>
</class>
...
</classes>
This endpoint lists all available driver classes, ordered as you have set them in your account.
HTTP Request
GET https://api.simracing.co.uk/v0.1/classes
Notes
- Only driver classes that have not been deleted will be listed. However, it is possible for some drivers to still be assigned to a deleted driver class.
Get a Specific Class
curl "https://api.simracing.co.uk/v0.1/classes/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<class>
<id>1</id>
<name>Class A</name>
<short_name>A</short_name>
<icon>A</icon>
<description>Class A</description>
<order>1</order>
<default>false</default>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
</class>
This endpoint retrieves a specific driver class.
HTTP Request
GET https://api.simracing.co.uk/v0.1/classes/<ID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the class to retrieve |
Customers
Get a List of Customers
curl "https://api.simracing.co.uk/v0.1/customers" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<customers>
<customer_results>1299</customer_results>
<customer>
<id>1</id>
<name>Jim Clark</name>
<tel>0131 496 8182</tel>
<cell/>
<email>jimclark@example.com</email>
<email_optin>true</email_optin>
<source>E-mail Campaign</source>
<source_other/>
<home_venue>Venue One</home_venue>
<class>World Champion</class>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<lap_times_uri>https://api.simracing.co.uk/v0.1/customers/1/lap_times</lap_times_uri>
</customer>
<customer>
<id>2</id>
<name>Graham Hill</name>
<tel>020 7946 0042</tel>
<cell/>
<email>grahamhill@example.com</email>
<email_optin>true</email_optin>
<type>Secondary</type>
<source>E-mail Campaign</source>
<source_other/>
<home_venue>Venue One</home_venue>
<class>World Champion</class>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
<primary_customer_uri>https://api.simracing.co.uk/v0.1/customers/3</primary_customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<lap_times_uri>https://api.simracing.co.uk/v0.1/customers/2/lap_times</lap_times_uri>
</customer>
...
</customers>
This endpoint lists all customers.
HTTP Request
GET https://api.simracing.co.uk/v0.1/customers
Query Parameters
Parameter | Default | Description |
---|---|---|
index | 0 | The starting index for the list of results. |
count | 1000 | The number of results returned. |
Notes
- If this customer is a secondary contact (a contact with an e-mail address owned by another customer), a
type
field will be present that indicates the customer is a secondary contact, and aprimary_customer_uri
field identifies the primary customer with this shared e-mail address.
Search for a Customer
curl "https://api.simracing.co.uk/v0.1/customers?email=grahamhill@example.com" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<customer>
<id>2</id>
<name>Graham Hill</name>
<tel>020 7946 0042</tel>
<cell/>
<email>grahamhill@example.com</email>
<email_optin>true</email_optin>
<source>E-mail Campaign</source>
<source_other/>
<home_venue>Venue One</home_venue>
<class>World Champion</class>
<laps_recorded>35</laps_recorded>
<last_visit>2017-08-07 21:25:15</last_visit>
<last_vehicle>Japanese F3</last_vehicle>
<last_circuit>Red Bull Ring, Spielburg</last_circuit>
<last_group_event>Group Event 1</last_group_event>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<lap_times_uri>https://api.simracing.co.uk/v0.1/customers/2/lap_times</lap_times_uri>
</customer>
This endpoint searches for a customer by name, e-mail address, cell number or telephone number.
HTTP Request
GET https://api.simracing.co.uk/v0.1/customers?email=grahamhill@example.com
Query Parameters
Parameter | Description |
---|---|
name | The full name of the customer. |
The registered email address of the customer. | |
cell | The cellphone number of the customer. |
tel | The telephone number of the customer. |
Notes
- If this customer is a secondary contact (a contact with an e-mail address owned by another customer), a
type
field will be present that indicates the customer is a secondary contact, and aprimary_customer_uri
field identifies the primary customer with this shared e-mail address.
Get a Specific Customer
curl "https://api.simracing.co.uk/v0.1/customers/2" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<customer>
<id>2</id>
<name>Graham Hill</name>
<tel>020 7946 0042</tel>
<cell/>
<email>grahamhill@example.com</email>
<email_optin>true</email_optin>
<source>E-mail Campaign</source>
<source_other/>
<home_venue>Venue One</home_venue>
<class>World Champion</class>
<laps_recorded>35</laps_recorded>
<last_visit>2017-08-07 21:25:15</last_visit>
<last_vehicle>Japanese F3</last_vehicle>
<last_circuit>Red Bull Ring, Spielburg</last_circuit>
<last_group_event>Group Event 1</last_group_event>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<lap_times_uri>https://api.simracing.co.uk/v0.1/customers/2/lap_times</lap_times_uri>
</customer>
This endpoint retrieves a specific customer.
HTTP Request
GET https://api.simracing.co.uk/v0.1/customers/<ID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the customer to retrieve |
Notes
- If this customer is a secondary contact (a contact with an e-mail address owned by another customer), a
type
field will be present that indicates the customer is a secondary contact, and aprimary_customer_uri
field identifies the primary customer with this shared e-mail address.
Get Lap Times for a Customer
curl "https://api.simracing.co.uk/v0.1/customers/2/lap_times" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<customer>
<id>2</id>
<name>Graham Hill</name>
<tel>020 7946 0042</tel>
<cell/>
<email>grahamhill@example.com</email>
<email_optin>true</email_optin>
<source>E-mail Campaign</source>
<source_other/>
<home_venue>Venue One</home_venue>
<class>World Champion</class>
<lap_time_results>1602</lap_time_results>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<results>
<result>
<id>1038431</id>
<lap_time_ms>102557</lap_time_ms>
<lap_time_str>1:42.557</lap_time_str>
<circuit_id>388</circuit_id>
<circuit_name>Brands Hatch</circuit_name>
<vehicle_id>15</vehicle_id>
<vehicle_name>Lotus 49</vehicle_name>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<date>2014-10-03 13:05:06</date>
<transmission>Manual</transmission>
<split1_ms>26802</split1_ms>
<split1_str>0:26.802</split1_str>
<split2_ms>54728</split2_ms>
<split2_str>0:54.728</split2_str>
<split3_ms>21027</split3_ms>
<split3_str>0:21.027</split3_str>
<invalid>0</invalid>
<verified>0</verified>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1038431&hash=abc</telemetry_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1038431</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/15</vehicle_uri>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/388</circuit_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</result>
...
</results>
</customer>
This endpoint retrieves all laptimes for a specific customer, most recent first.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the customer to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/customers/<ID>/lap_times
Query Parameters
Parameter | Default | Description |
---|---|---|
index | 0 | The starting index for the list of results. |
count | 1000 | The number of results returned. |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically. - If this customer is a secondary contact (a contact with an e-mail address owned by another customer), a
type
field will be present that indicates the customer is a secondary contact, and aprimary_customer_uri
field identifies the primary customer with this shared e-mail address.
Group Events
Access to the group event endpoints requires the group events feature to be enabled for your VMS account. If this feature is not enabled, you will receive a 403 error when attempting to access these endpoints.
List Group Events
curl "https://api.simracing.co.uk/v0.1/group_events" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<group_events>
<group_event>
<id>1</id>
<name>Group Event 1</name>
<start_date>2016-04-02 13:57:02</start_date>
<end_date>2016-04-02 15:59:49</end_date>
<venues>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<group_event_uri>https://api.simracing.co.uk/v0.1/group_events/1</group_event_uri>
</group_event>
...
</group_events>
This endpoint lists all available group events.
HTTP Request
GET https://api.simracing.co.uk/v0.1/group_events
Get a Specific Group Event
curl "https://api.simracing.co.uk/v0.1/group_events/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<group_events>
<group_event>
<id>1</id>
<name>Group Event 1</name>
<start_date>2016-04-02 13:57:02</start_date>
<end_date>2016-04-02 15:59:49</end_date>
<venues>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<summary>
<result>
<position>1</position>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<qualification_points>10</qualification_points>
<race_points>16</race_points>
<fastest_practice_lap_id/>
<fastest_practice_lap_time_ms/>
<fastest_practice_lap_time_str/>
<fastest_practice_lap_transmission/>
<fastest_qualification_lap_id>1497564</fastest_qualification_lap_id>
<fastest_qualification_lap_time_ms>137403</fastest_qualification_lap_time_ms>
<fastest_qualification_lap_time_str>2:17.403</fastest_qualification_lap_time_str>
<fastest_qualification_lap_transmission>Auto</fastest_qualification_lap_transmission>
<fastest_race_lap_id>1497965</fastest_race_lap_id>
<fastest_race_lap_time_ms>104642</fastest_race_lap_time_ms>
<fastest_race_lap_time_str>1:44.642</fastest_race_lap_time_str>
<fastest_race_lap_transmission>Manual</fastest_race_lap_transmission>
<class_id>1</class_id>
<class_name>World Champion</class_name>
<race_wins>1</race_wins>
<total_points>26</total_points>
<qualification_telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1497564&hash=abc</qualification_telemetry_uri>
<race_telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1497965&hash=abc</race_telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
<qualification_lap_uri>https://api.simracing.co.uk/v0.1/laps/1497564</qualification_lap_uri>
<race_lap_uri>https://api.simracing.co.uk/v0.1/laps/1497965</race_lap_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
</result>
...
</summary>
<active_session/>
<sessions>
<session>
<id>1201</id>
<name>Qualification 1</name>
<type>Qualification</type>
<start_date>2016-04-02 13:57:02</start_date>
<end_date>2016-04-02 14:54:26</end_date>
<circuit_id>780</circuit_id>
<circuit_name>Monza, Italy</circuit_name>
<circuit_length>5.793</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/780</circuit_uri>
<result>
<position>1</position>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<fastest_lap_id>1497568</fastest_lap_id>
<fastest_lap_time_ms>134117</fastest_lap_time_ms>
<fastest_lap_time_str>2:14.117</fastest_lap_time_str>
<fastest_lap_transmission>Auto</fastest_lap_transmission>
<vehicle_id>39</vehicle_id>
<vehicle_name>Formula Ford</vehicle_name>
<vehicle_engine>1.6L I4</vehicle_engine>
<class_id>1</class_id>
<class_name>World Champion</class_name>
<laps_recorded>17</laps_recorded>
<difference_seconds/>
<difference_laps/>
<points>12</points>
<penalty_points>0</penalty_points>
<total_points>12</total_points>
<telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1497568&hash=abc</telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1497568</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/39</vehicle_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/7</class_uri>
</result>
...
</session>
...
</sessions>
<group_event_uri>https://api.simracing.co.uk/v0.1/group_events/1</group_event_uri>
</group_event>
</group_events>
This endpoint retrieves the details of the specified group event, including the overall event summary and details of each session in the event.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the group event to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/group_events/<ID>
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically. - The
<active_session>
entry will contain a reference to the session that currently has drivers allocated to it in VMS Desktop, if any. - The XML returned for a large group event can be quite big -- it is recommended to use gzip compression to reduce data transit times.
Hot Lapping Events
List Hot Lapping Events
curl "https://api.simracing.co.uk/v0.1/hotlap_events" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>April 2016</name>
<start_date>2016-04-01 00:00:00</start_date>
<end_date>2016-04-30 23:59:59</end_date>
<qualification_percentage>10</qualification_percentage>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
...
</hotlap_events>
This endpoint lists all available hot lapping events. Filtering of events may be done by using query parameters, below.
HTTP Request
GET https://api.simracing.co.uk/v0.1/hotlap_events
Query Parameters
Parameter | Default | Description |
---|---|---|
past | 1 | Include historic hot lapping events. |
current | 1 | Include hot lapping events currently active. |
future | 1 | Include hot lapping events in the future. |
order | dateasc | The order of the results. Valid options are 'dateasc' and 'datedesc'. |
Notes
- When using the 'past', 'current' and 'future' query parameters to filter results, it is highly recommended that you also supply your timezone, to ensure accurate results.
Get a Specific Hot Lapping Event
curl "https://api.simracing.co.uk/v0.1/hotlap_events/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>April 2016</name>
<start_date>2016-04-01 00:00:00</start_date>
<end_date>2016-04-30 23:59:59</end_date>
<qualification_percentage>10</qualification_percentage>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class A Cars</name>
<circuit_id>391</circuit_id>
<circuit_name>Mid-Ohio - Sports Car</circuit_name>
<circuit_length>3.86</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/391</circuit_uri>
<results>
<result>
<date>2016-04-07 14:34:55</date>
<customer_id>2</customer_id>
<customer_name>Graham Hill</customer_name>
<lap_id>1502244</lap_id>
<lap_time_ms>78758</lap_time_ms>
<lap_time_str>1:18.758</lap_time_str>
<transmission>Manual</transmission>
<vehicle_id>136</vehicle_id>
<vehicle_name>BMW M3</vehicle_name>
<vehicle_engine>3600cc</vehicle_engine>
<class_id>1</class_id>
<class_name>Class A</class_name>
<class_icon>A</class_icon>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<invalid>0</invalid>
<verified>0</verified>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1502244&hash=abc</telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1502244</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/136</vehicle_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</result>
...
</results>
</sub_event>
<sub_event>
<sub_event_id>2</sub_event_id>
<name>Class B Cars</name>
<circuit_id>391</circuit_id>
<circuit_name>Mid-Ohio - Sports Car</circuit_name>
<circuit_length>3.86</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/391</circuit_uri>
<results>
<result>
<date>2016-04-11 13:48:21</date>
<customer_id>3</customer_id>
<customer_name>Jody Scheckter</customer_name>
<lap_id>1508281</lap_id>
<lap_time_ms>84424</lap_time_ms>
<lap_time_str>1:24.424</lap_time_str>
<transmission>Manual</transmission>
<vehicle_id>136</vehicle_id>
<vehicle_name>BMW M3</vehicle_name>
<vehicle_engine>3600cc</vehicle_engine>
<class_id>2</class_id>
<class_name>Class B</class_name>
<class_icon>B</class_icon>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<invalid>0</invalid>
<verified>0</verified>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1508281&hash=abc</telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/3</customer_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1508281</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/136</vehicle_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/2</class_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</result>
...
</results>
</sub_event>
...
</hotlap_events>
This endpoint retrieves the details of the specified hot lapping event, including the fastest laps by each driver in each applicable class.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the hot lapping event to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/hotlap_events/<ID>
Query Parameters
Parameter | Default | Description |
---|---|---|
invalid | 1 | Include invalidated laps. |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically. - If a customer has recorded a lap in the event that has been invalidated, both the customer's fastest invalid and fastest valid laps will be returned. Implementations may wish to exclude one of these before displaying the data, or to highlight invalid laps in a different colour. Invalidated laps can also be excluded in the response by use of the query parameter documented above.
Laps
Get a List of Laps
curl "https://api.simracing.co.uk/v0.1/laps" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<laps>
<lap_results>1968451</lap_results>
<lap>
<id>1229486</id>
<customer_id>2</customer_id>
<customer_name>Graham Hill</customer_name>
<time_ms>69763</time_ms>
<time_str>1:09.763</time_str>
<pod>2</pod>
<transmission>Manual</transmission>
<venue_id>1</venue_id>
<circuit_id>1</circuit_id>
<circuit>A1 Ring - GP</circuit>
<vehicle_id>1</vehicle_id>
<vehicle>1991 McLaren MP4/6</vehicle>
<date>2015-05-17 16:27:50</date>
<split1_ms>18048</split1_ms>
<split1_str>0:18.048</split1_str>
<split2_ms>37527</split2_ms>
<split2_str>0:37.527</split2_str>
<split3_ms>14188</split3_ms>
<split3_str>0:14.188</split3_str>
<invalid>0</invalid>
<invalid_reason/>
<verified>0</verified>
<verified_reason/>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1229486&hash=abc</telemetry_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1229486</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
</lap>
<lap>
<id>1229485</id>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<time_ms>71281</time_ms>
<time_str>1:11.281</time_str>
<pod>4</pod>
<transmission>Manual</transmission>
<venue_id>1</venue_id>
<circuit_id>1</circuit_id>
<circuit>A1 Ring - GP</circuit>
<vehicle_id>1</vehicle_id>
<vehicle>1991 McLaren MP4/6</vehicle>
<date>2015-05-17 17:14:27</date>
<split1_ms>19181</split1_ms>
<split1_str>0:19.181</split1_str>
<split2_ms>37961</split2_ms>
<split2_str>0:37.961</split2_str>
<split3_ms>14139</split3_ms>
<split3_str>0:14.139</split3_str>
<invalid>0</invalid>
<invalid_reason/>
<verified>0</verified>
<verified_reason/>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1229485&hash=abc</telemetry_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1229485</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
</lap>
...
</laps>
Query Parameters
Parameter | Default | Description |
---|---|---|
index | 0 | The starting index for the list of results. |
count | 1000 | The number of results returned. |
order | idasc | The order of the results. Valid options are 'idasc', 'iddesc', 'dateasc' and 'datedesc'. |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically.
Get a Specific Lap
curl "https://api.simracing.co.uk/v0.1/laps/1229486" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<lap>
<id>1229486</id>
<customer_id>2</customer_id>
<customer_name>Graham Hill</customer_name>
<time_ms>69763</time_ms>
<time_str>1:09.763</time_str>
<pod>2</pod>
<transmission>Manual</transmission>
<venue_id>1</venue_id>
<circuit_id>1</circuit_id>
<circuit>A1 Ring - GP</circuit>
<vehicle_id>1</vehicle_id>
<vehicle>1991 McLaren MP4/6</vehicle>
<date>2015-05-17 16:27:50</date>
<split1_ms>18048</split1_ms>
<split1_str>0:18.048</split1_str>
<split2_ms>37527</split2_ms>
<split2_str>0:37.527</split2_str>
<split3_ms>14188</split3_ms>
<split3_str>0:14.188</split3_str>
<invalid>0</invalid>
<invalid_reason/>
<verified>0</verified>
<verified_reason/>
<telemetry_uri>http://telemetry.racecentres.com/v0.4/getdata.php?did=1&lid=1229486&hash=abc</telemetry_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1229486</lap_uri>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
</lap>
This endpoint retrieves a specific lap.
HTTP Request
GET https://api.simracing.co.uk/v0.1/laps/<ID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the lap to retrieve |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically.
Vehicles
Get a List of Vehicles
curl "https://api.simracing.co.uk/v0.1/vehicles" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<vehicles>
<vehicle>
<id>1</id>
<name>1991 McLaren MP4/6</name>
<year>1991</year>
<engine>3493cc</engine>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
</vehicle>
<vehicle>
<id>2</id>
<name>BMW CSL</name>
<year>2007</year>
<engine>3153cc</engine>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/2</vehicle_uri>
</vehicle>
...
</vehicles>
This endpoint lists all available vehicles, in alphabetical order.
HTTP Request
GET https://api.simracing.co.uk/v0.1/vehicles
Get a Specific Vehicle
curl "https://api.simracing.co.uk/v0.1/vehicles/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<vehicle>
<id>1</id>
<name>1991 McLaren MP4/6</name>
<year>1991</year>
<engine>3493cc</engine>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/1</vehicle_uri>
</vehicle>
This endpoint retrieves a specific vehicle.
HTTP Request
GET https://api.simracing.co.uk/v0.1/vehicle/<ID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the vehicle to retrieve |
Get Circuit Lap Records for a Vehicle
curl "https://api.simracing.co.uk/v0.1/vehicles/1/circuit_records" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<vehicle>
<id>1</id>
<name>Formula Ford</name>
<engine>1.6L I4</engine>
<circuit_results>143</circuit_results>
<results>
<result>
<date>2017-10-05 16:48:42</date>
<customer_id>1</customer_id>
<customer_name>Jim Clarke</customer_name>
<lap_id>1885523</lap_id>
<lap_time_ms>16503</lap_time_ms>
<lap_time_str>0:16.503</lap_time_str>
<transmission>Manual</transmission>
<circuit_id>467</circuit_id>
<circuit_name>Joesville Speedway</circuit_name>
<circuit_length>0</circuit_length>
<class_id>1</class_id>
<class_name>World Champions</class_name>
<venue_id>1</venue_id>
<venue_name>First Venue</venue_name>
<invalid>0</invalid>
<verified>0</verified>
<telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1885523&hash=abc</telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1885523</lap_uri>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/467</circuit_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</result>
...
</results>
</vehicle>
This endpoint retrieves the fastest lap recorded at each circuit by the specified vehicle.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the vehicle to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/vehicles/<ID>/circuit_records
Query Parameters
Parameter | Default | Description |
---|---|---|
index | 0 | The starting index for the list of results. |
count | 1000 | The number of results returned. |
invalid | 0 | Whether to include invalidated laps. |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically.
Get Customer Lap Records for a Vehicle
curl "https://api.simracing.co.uk/v0.1/vehicles/1/customer_records" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<vehicle>
<id>39</id>
<name>Formula Ford</name>
<engine>1.6L I4</engine>
<customer_results>46217</customer_results>
<results>
<result>
<date>2017-10-05 16:48:42</date>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<lap_id>1885523</lap_id>
<lap_time_ms>16503</lap_time_ms>
<lap_time_str>0:16.503</lap_time_str>
<transmission>Manual</transmission>
<circuit_id>467</circuit_id>
<circuit_name>Joesville Speedway</circuit_name>
<circuit_length>0</circuit_length>
<class_id>1</class_id>
<class_name>World Champions</class_name>
<venue_id>1</venue_id>
<venue_name>First Venue</venue_name>
<invalid>0</invalid>
<verified>0</verified>
<telemetry_uri>https://telemetry.racecentres.com/v0.7/getdata.php?did=1&lid=1885523&hash=abc</telemetry_uri>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
<lap_uri>https://api.simracing.co.uk/v0.1/laps/1885523</lap_uri>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/467</circuit_uri>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</result>
...
</results>
</circuit>
This endpoint retrieves the fastest lap recorded by each customer in the specified vehicle.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the vehicle to retrieve |
HTTP Request
GET https://api.simracing.co.uk/v0.1/vehicles/<ID>/customer_records
Query Parameters
Parameter | Default | Description |
---|---|---|
index | 0 | The starting index for the list of results. |
count | 1000 | The number of results returned. |
invalid | 0 | Whether to include invalidated laps. |
Notes
- The telemetry URI endpoint produces a Javascript graph output of the currently selected lap compared to the fastest lap in this circuit, vehicle and transmission combination (if available). It is recommended to display this URI in an iframe. Not all laps will have telemetry available, the
<telemetry_uri>
entry will only be present in the output if telemetry is available. Telemetry URIs will not be provided if your licence key does not include telemetry support. - Telemetry URIs contain XML-encoded characters which will need to be decoded before the URI is valid, specifically replacing
&
with&
. Many XML parsing libraries have options to allow this decoding to occur automatically.
Venues
Get a List of Venues
curl "https://api.simracing.co.uk/v0.1/venues" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<venues>
<venue>
<id>1</id>
<name>First Venue</name>
<short_name>001</short_name>
<address1>100 Main Street</address1>
<address2 />
<town>Town 1</town>
<county />
<postcode>AB12 3DE</postcode>
<country>United Kingdom</country>
<phone />
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
<venue>
<id>2</id>
<name>Second Venue</name>
<short_name>002</short_name>
<address1>50 The Avenue</address1>
<address2 />
<town>Town 2</town>
<county />
<postcode>FG45 6HJ</postcode>
<country>United Kingdom</country>
<phone />
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
...
</venues>
This endpoint lists all available venues.
HTTP Request
GET https://api.simracing.co.uk/v0.1/venues
Get a Specific Venue
curl "https://api.simracing.co.uk/v0.1/venues/1" \
-H "Authorization: SRL <your-API-key>"
The above command returns XML structured like this:
<?xml version="1.0" encoding="utf-8"?>
<venue>
<id>1</id>
<name>First Venue</name>
<short_name>001</short_name>
<address1>100 Main Street</address1>
<address2 />
<town>Town 1</town>
<county />
<postcode>AB12 3DE</postcode>
<country>United Kingdom</country>
<phone />
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
This endpoint retrieves a specific venue.
HTTP Request
GET https://api.simracing.co.uk/v0.1/venues/<ID>
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the venue to retrieve |
Creating Data
An HTTP POST
request should be made to the appropriate endpoint, documented below, to create a new record in the API. Ensure that you include your API key in all requests, as documented in the authentication instructions. A Content-Type header specifying the type is text/xml
, and the character set is UTF-8
, is recommended. Sending data in a character set other than UTF-8 is not supported.
Your request must include correctly-formatted XML describing the record you wish to create. Only one record may be created in the API per API request.
Only required fields need to be provided in the XML. Any optional fields that are not supplied in the XML will receive default or empty values, as appropriate.
Errors in XML formatting, missing required fields, or invalid data (such as a booking end date that is earlier than a booking start date) will result in a 400 error being returned. A message giving more details about the error will typically be included.
A successful request will return a 200 OK
return code, and the record, including the assigned ID, will be returned in the body of the response.
Bookings
Access to the booking endpoints requires the bookings feature to be enabled for your VMS account. If this feature is not enabled, you will receive a 403 error when attempting to access these endpoints.
Creating a Booking
curl "https://api.simracing.co.uk/v0.1/bookings" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X POST \
-d "
<booking>
<event_name>January Race of Champions</event_name>
<customer_id>1</customer_id>
<start_date>2019-01-31 18:00:00</start_date>
<end_date>2019-01-31 23:00:00</end_date>
<status>Booked</status>
<venue_id>1</venue_id>
<event_activity>Group Event</event_activity>
<group_size>20</group_size>
<specific_pods>1,2,3,4,5,6,7,8,9,10</specific_pods>
<requested_vehicles>
<vehicle_id>15</vehicle_id>
<vehicle_id>2</vehicle_id>
</requested_vehicles>
<requested_circuits>
<circuit_id>1</circuit_id>
<circuit_id>388</circuit_id>
</requested_circuits>
<participants>
<customer_id>2</customer_id>
<customer_id>3</customer_id>
</participants>
<staffing_notes>All hands on deck.</staffing_notes>
<notes>January's Race of Champions event, make sure all the pods are up-to-date and ready to go.</notes>
<payment_notes>Individual payments to be taken on the night.</payment_notes>
</booking>"
The above command creates the booking and returns the new booking's XML (including the unique ID), structured like this:
<?xml version="1.0" encoding="utf-8"?>
<booking>
<id>1</id>
<event_name>January Race of Champions</event_name>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<start_date>2019-01-31 18:00:00</start_date>
<end_date>2019-01-31 23:00:00</end_date>
<status>Booked</status>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<event_activity>Group Event</event_activity>
<group_size>20</group_size>
<specific_pods>1,2,3,4,5,6,7,8,9,10</specific_pods>
<requested_vehicles>
<vehicle>
<vehicle_id>2</vehicle_id>
<vehicle_name>1994 McLaren</vehicle_name>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/2</vehicle_uri>
</vehicle>
<vehicle>
<vehicle_id>15</vehicle_id>
<vehicle_name>Lotus 49</vehicle_name>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/15</vehicle_uri>
</vehicle>
</requested_vehicles>
<requested_circuits>
<circuit>
<circuit_id>388</circuit_id>
<circuit_name>Brands Hatch</circuit_name>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/388</circuit_uri>
</circuit>
<circuit>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
</circuit>
</requested_circuits>
<participants>
<customer>
<customer_id>2</customer_id>
<customer_name>Graham Hill</customer_name>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
</customer>
<customer>
<customer_id>3</customer_id>
<customer_name>Jody Scheckter</customer_name>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/3</customer_uri>
</customer>
</participants>
<staffing_notes>All hands on deck.</staffing_notes>
<notes>January's Race of Champions event, make sure all the pods are up-to-date and ready to go.</notes>
<payment_notes>Individual payments to be taken on the night.</payment_notes>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</booking>
This endpoint creates a new booking in the VMS database.
HTTP Request
POST https://api.simracing.co.uk/v0.1/bookings/
The request body should include correctly-formatted XML containing a booking
root element.
Required Fields
The following fields are required when creating a booking, and an error will be returned if they are not included, or if they are invalid.
XML Tag | Description | Format |
---|---|---|
event_name | The name of the booking. Optional if the customer_id is specified. |
string of at least 3 characters |
customer_id | A valid customer ID in the database. Optional if the event_name is specified. |
unsigned non-zero int |
start_date | The start date and time of the booking. | YYYY-MM-DD HH:MM:SS |
end_date | The end date and time of the booking. | YYYY-MM-DD HH:MM:SS |
status | The status of the booking. | Booked , Holding or Cancelled |
venue_id | A valid venue ID in the database. | unsigned non-zero int |
Optional Fields
The following fields are optional when creating a booking, and need not be included. If they are included, an error will be returned if they are invalid.
XML Tag | Description | Format | Default Value |
---|---|---|---|
event_activity | An event activity defined in the Account Management pages. | string that exists in the Account Management pages. | none |
group_size | The number of people expected to participate in the booking. | unsigned non-zero int | none |
number_of_pods | The number of pods used for the booking. Must not be included if specific_pods is specified. |
unsigned non-zero int. | none |
specific_pods | The specific pods to use for this booking. Must not be included if number_of_pods is specified. |
comma-separated list of unsigned non-zero ints. | none |
requested_vehicles | A list of one or more valid vehicle IDs in the database. | unsigned non-zero int in one or more vehicle_id tags. |
none |
requested_circuits | A list of one or more valid circuit IDs in the database. | unsigned non-zero int in one or more circuit_id tags. |
none |
participants | A list of one or more valid customer IDs in the database. | unsigned non-zero int in one or more customer_id tags. |
none |
staffing_notes | Private staffing notes for the booking. | string | none |
notes | Private notes for the booking. | string | none |
payment_notes | Private payment notes for the booking. | string | none |
Notes
- The customer specified in the
customer_id
field is the booking owner, but is not assumed to be participating in the booking. If the booking owner is participating in the booking, their customer ID should also be included in theparticipants
list. - The start date and end date of the booking should be specified in local venue time, and should not include timezone information.
Classes
Creating a Class
curl "https://api.simracing.co.uk/v0.1/classes" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X POST \
-d "
<class>
<name>World Champion Drivers</name>
<short_name>WCD</short_name>
<icon>Rosette</icon>
<description>Drivers who have won a world championship</description>
<default>false</default>
</class>"
The above command creates the driver class and returns the new driver class XML (including the unique ID), structured like this:
<?xml version="1.0" encoding="utf-8"?>
<class>
<id>1</id>
<name>World Champion Drivers</name>
<short_name>WCD</short_name>
<icon>Rosette</icon>
<description>Drivers who have won a world championship</description>
<order>1</order>
<default>false</default>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
</class>
This endpoint creates a new driver class in the VMS database.
HTTP Request
POST https://api.simracing.co.uk/v0.1/classes/
The request body should include correctly-formatted XML containing a class
root element.
Required Fields
The following fields are required when creating a driver class, and an error will be returned if they are not included, or if they are invalid.
XML Tag | Description | Format |
---|---|---|
name | The name of the driver class. | string of at least 3 characters |
short_name | The short name of the driver class. | string between 1 and 3 characters |
Optional Fields
The following fields are optional when creating a customer, and need not be included. If they are included, an error will be returned if they are invalid.
XML Tag | Description | Format | Default Value |
---|---|---|---|
icon | The icon used to represent this driver class in the SRL SWP. | a letter from A-Z, a number from 0-9, or one of the strings 'Gold', 'Silver', 'Bronze', 'Blue', 'Red', 'Purple', 'Green', 'Star', 'Shield', 'Rosette' | none |
description | A description of this driver class. | string of at most 255 characters | none |
default | Whether this driver class is the default class for newly-registered drivers. | true or false |
false |
apply_to_unclassed_drivers | Whether this driver class should be applied to all existing unclassed drivers in VMS database. Can only be set if default is set to true. |
true or false |
false |
order | Insert this driver class in the specified position in the driver class order. | unsigned non-zero int | none; the new driver class will be inserted after all other driver classes |
Notes
- The driver class name must be unique.
- If a driver class was previously deleted, creating a new driver class with the same name will re-use the previous class ID.
- The
apply_to_unclassed_drivers
field cannot be set totrue
if thedefault
field is not set totrue
.
Customers
Creating a Customer
curl "https://api.simracing.co.uk/v0.1/customers" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X POST \
-d "
<customer>
<name>Juan Manuel Fangio</name>
<tel>123-456-7890</tel>
<cell>123-456-7890</cell>
<email>juan@example.com</email>
<email_optin>false</email_optin>
<source>Google/Web</source>
<source_other></source_other>
<home_venue_id>1</home_venue_id>
<class_id></class_id>
<if_duplicate_email_make_secondary>true</if_duplicate_email_make_secondary>
</customer>"
The above command creates the customer and returns the new customer's XML (including the unique ID), structured like this:
<?xml version="1.0" encoding="utf-8"?>
<customer>
<id>4</id>
<name>Juan Manuel Fangio</name>
<tel>123-456-7890</tel>
<cell>123-456-7890</cell>
<email>juan@example.com</email>
<email_optin>false</email_optin>
<source>Google/Web</source>
<source_other/>
<home_venue>Venue One</home_venue>
<class/>
<laps_recorded/>
<last_visit/>
<last_vehicle/>
<last_circuit/>
<last_group_event/>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/432</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
<lap_times_uri>https://api.simracing.co.uk/v0.1/customers/432/lap_times</lap_times_uri>
</customer>
This endpoint creates a new customer in the VMS database.
HTTP Request
POST https://api.simracing.co.uk/v0.1/customers/
The request body should include correctly-formatted XML containing a customer
root element.
Required Fields
The following fields are required when creating a customer, and an error will be returned if they are not included, or if they are invalid.
XML Tag | Description | Format |
---|---|---|
name | The name of the customer. | string of at least 3 characters |
home_venue_id | A valid venue ID in the database. | unsigned non-zero int |
Optional Fields
The following fields are optional when creating a customer, and need not be included. If they are included, an error will be returned if they are invalid.
XML Tag | Description | Format | Default Value |
---|---|---|---|
tel | The telephone number of the customer. | string of at least 3 characters | none |
cell | The mobile/cell number of the customer. | string of at least 3 characters | none |
The e-mail address of the customer. | string of at least 3 characters with a valid e-mail address format | none | |
email_optin | Whether the customer has opted-in to e-mail marketing messages. | true or false |
false |
source | A valid customer source. | 'Email Campaign', 'Google/Web', 'Leaflet', 'Passing By', 'Phone Directory', 'Printed Publication', 'Radio', 'Referral', 'Reseller/Voucher', 'TV', 'Other' or 'Unknown' | none |
source_other | Additional details on the customer source. | string | none |
class_id | A valid class ID in the database. If the class_id tag is not present, the default class (if defined) will be used. If the class_id tag is present but empty, the customer will have no class assigned. |
unsigned non-zero int | default class |
if_duplicate_email_make_secondary | Whether to set this customer as a secondary contact if the e-mail address already exists in the VMS database. If set to false, or unset, an error will be returned if the e-mail address already exists in the VMS database. | true or false |
false |
Notes
- The
email_optin
field cannot be set totrue
if an e-mail address is not present for the customer. - It is recommended to first search for the customer before creating a new customer, to prevent duplicate customers being present in the database. Leaving
if_duplicate_email_make_secondary
set tofalse
can aid with detecting duplicates, but it will be necessary to handle the error that is returned if a duplicate e-mail address is found. Settingif_duplicate_email_make_secondary
totrue
avoids having to handle this error, but can result in more duplicate contacts being present.
Hot Lapping Events
Creating a Hot Lapping Event
curl "https://api.simracing.co.uk/v0.1/hotlap_events" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X POST \
-d "
<hotlap_event>
<name>June 2022</name>
<start_date>2022-06-01 00:00:00</start_date>
<end_date>2022-06-30 23:59:00</end_date>
<qualification_percentage>10</qualification_percentage>
<venues>
<venue_id>1</venue_id>
<venue_id>2</venue_id>
</venues>
<circuit_id>1</circuit_id>
<sub_event>
<name>Class A</name>
<vehicles>
<vehicle_id>1</vehicle_id>
<vehicle_id>2</vehicle_id>
</vehicles>
<classes>
<class_id>1</class_id>
</classes>
</sub_event>
<sub_event>
<name>Unclassed</name>
<vehicles>
<vehicle_id>3</vehicle_id>
</vehicles>
</sub_event>
</hotlap_event>"
The above command creates the hot lapping event and returns the new event's XML (including the unique ID), structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>June 2022</name>
<start_date>2022-06-01 00:00:00</start_date>
<end_date>2022-06-30 23:59:00</end_date>
<qualification_percentage>10</qualification_percentage>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class A Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>2</sub_event_id>
<name>Unclassed</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
</hotlap_events>
This endpoint creates a new hot lapping event in the VMS database.
HTTP Request
POST https://api.simracing.co.uk/v0.1/hotlap_events/
The request body should include correctly-formatted XML containing a hotlap_event
root element.
Required Fields
The following fields are required when creating a hot lapping event, and an error will be returned if they are not included, or if they are invalid.
XML Tag | Description | Format |
---|---|---|
name | The name of the hot lapping event. | string of at least 3 characters |
start_date | The start date and time of the hot lapping event. | YYYY-MM-DD HH:MM:SS |
end_date | The end date and time of the hot lapping event. | YYYY-MM-DD HH:MM:SS |
venues | A list of one or more valid venue IDs in the database. | unsigned non-zero int in one or more venue_id tags. |
circuit_id | A valid circuit ID in the database. | unsigned non-zero int |
Additionally, at least one sub-event must be defined when creating a hot lapping event, and an error will be returned if no sub-events are defined, or if they are invalid. The following fields are required when creating a sub-event.
XML Tag | Description | Format |
---|---|---|
name | The name of the hot lapping sub-event. | string of at least 3 characters |
Optional Fields
The following fields are optional when creating a hot lapping event, and need not be included. If they are included, an error will be returned if they are invalid.
XML Tag | Description | Format | Default Value |
---|---|---|---|
qualification_percentage | How many percent slower a lap can be while appearing above the qualification line in the SWP results. To disable the qualification line, do not set this value. | unsigned non-zero int between 1 and 100 | none |
Additionally, the following fields are optional in each sub-event that is defined when creating a hot lapping event.
XML Tag | Description | Format | Default Value |
---|---|---|---|
vehicles | A list of one or more valid vehicle IDs in the database. Only laps recorded by these vehicles will be eligible for the hot lapping sub-event. To allow any vehicle, do not set this value. | unsigned non-zero int in one or more vehicle_id tags. |
none |
classes | A list of one or more valid driver class IDs in the database. Only laps recorded by drivers with these classes will be eligible for the hot lapping sub-event. To allow any driver class, do not set this value. | unsigned non-zero int in one or more class_id tags. |
none |
Notes
- The start date and end date of the hot lapping event should be specified in local venue time, and should not include timezone information.
- Lap eligibility for hot lapping events is calculated whenever a hot lapping event is created or updated. For example, hot lapping events created retroactively will automatically pull in all eligible laps in your VMS database.
Updating Data
An HTTP PATCH
request should be made to the appropriate endpoint, documented below, to update a record in the API. Ensure that you include your API key in all requests, as documented in the authentication instructions. A Content-Type header specifying the type is text/xml
, and the character set is UTF-8
, is recommended. Sending data in a character set other than UTF-8 is not supported.
Your request must include correctly-formatted XML to the appropriate endpoint for the record you wish to update, and providing the updated data. Only one record may be updated in the API per API request.
All fields are optional, and any fields that are not supplied in the XML will remain unchanged. To clear the value currently in a field, include an empty XML tag for the field.
Errors in XML formatting or invalid data (such as a booking end date that is earlier than a booking start date) will result in a 400 error being returned. A message giving more details about the error will typically be included.
A successful request will return a 200 OK
return code, and the updated record will be returned in the body of the response.
Bookings
Access to the booking endpoints requires the bookings feature to be enabled for your VMS account. If this feature is not enabled, you will receive a 403 error when attempting to access these endpoints.
Updating a Booking
curl "https://api.simracing.co.uk/v0.1/bookings/1" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<booking>
<event_name>February Race of Champions</event_name>
<start_date>2019-02-28 18:00:00</start_date>
<end_date>2019-02-28 23:00:00</end_date>
<group_size/>
<notes>February's Race of Champions event, make sure all the pods are up-to-date and ready to go. January's booking had to be cancelled.</notes>
</booking>"
The above command updates the
event_name
,start_date
,end_date
andnotes
fields and clears the contents of thegroup_size
field for the booking with ID1
, and returns the updated booking's XML, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<booking>
<id>1</id>
<event_name>February Race of Champions</event_name>
<customer_id>1</customer_id>
<customer_name>Jim Clark</customer_name>
<start_date>2019-02-28 18:00:00</start_date>
<end_date>2019-02-28 23:00:00</end_date>
<status>Booked</status>
<venue_id>1</venue_id>
<venue_name>Venue One</venue_name>
<event_activity>Race Event</event_activity>
<group_size/>
<specific_pods>1,2,3,4,5,6,7,8,9,10</specific_pods>
<requested_vehicles>
<vehicle>
<vehicle_id>2</vehicle_id>
<vehicle_name>1994 McLaren</vehicle_name>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/2</vehicle_uri>
</vehicle>
<vehicle>
<vehicle_id>15</vehicle_id>
<vehicle_name>Lotus 49</vehicle_name>
<vehicle_uri>https://api.simracing.co.uk/v0.1/vehicles/15</vehicle_uri>
</vehicle>
</requested_vehicles>
<requested_circuits>
<circuit>
<circuit_id>388</circuit_id>
<circuit_name>Brands Hatch</circuit_name>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/388</circuit_uri>
</circuit>
<circuit>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
</circuit>
</requested_circuits>
<participants>
<customer>
<customer_id>2</customer_id>
<customer_name>Graham Hill</customer_name>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/2</customer_uri>
</customer>
<customer>
<customer_id>3</customer_id>
<customer_name>Jody Scheckter</customer_name>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/3</customer_uri>
</customer>
</participants>
<staffing_notes>All hands on deck.</staffing_notes>
<notes>February's Race of Champions event, make sure all the pods are up-to-date and ready to go. January's booking had to be cancelled.</notes>
<payment_notes>Individual payments to be taken on the night.</payment_notes>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/1</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</booking>
This endpoint updates a booking in the VMS database.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the booking to update |
HTTP Request
PATCH https://api.simracing.co.uk/v0.1/bookings/<ID>
The request body should include correctly-formatted XML containing a booking
root element.
Optional Fields
The following fields are optional when updating a booking, and need not be included. If they are included, an error will be returned if they are invalid. Fields that are not included will remain as they were prior to the update request. To clear the value currently in a field, include an empty XML tag for the field. Fields required when creating a booking cannot be cleared.
XML Tag | Description | Format | Can Be Cleared |
---|---|---|---|
event_name | The name of the booking. | string of at least 3 characters | Only if a customer_id is present in the booking. |
customer_id | A valid customer ID in the database. | unsigned non-zero int | Only if an event_name is present in the booking. |
start_date | The start date and time of the booking. | YYYY-MM-DD HH:MM:SS |
No |
end_date | The end date and time of the booking. | YYYY-MM-DD HH:MM:SS |
No |
status | The status of the booking. | Booked , Holding or Cancelled |
No |
venue_id | A valid venue ID in the database. | unsigned non-zero int | No |
event_activity | An event activity defined in the Account Management pages. | string that exists in the Account Management pages. | Yes |
group_size | The number of people expected to participate in the booking. | unsigned non-zero int | Yes |
number_of_pods | The number of pods used for the booking. Must not be included if specific_pods is specified. |
unsigned non-zero int | Yes |
specific_pods | The specific pods to use for this booking. Must not be included if number_of_pods is specified. |
comma-separated list of unsigned non-zero ints. | Yes |
requested_vehicles | A list of one or more valid vehicle IDs in the database. | unsigned non-zero int in one or more vehicle_id tags. |
Yes |
requested_circuits | A list of one or more valid circuit IDs in the database. | unsigned non-zero int in one or more circuit_id tags. |
Yes |
participants | A list of one or more valid customer IDs in the database. | unsigned non-zero int in one or more customer_id tags. |
Yes |
staffing_notes | Private staffing notes for the booking. | string | Yes |
notes | Private notes for the booking. | string | Yes |
payment_notes | Private payment notes for the booking. | string | Yes |
Notes
- The customer specified in the
customer_id
field is the booking owner, but is not assumed to be participating in the booking. If the booking owner is participating in the booking, their customer ID should also be included in theparticipants
list. - The start date and end date of the booking should be specified in local venue time, and should not include timezone information.
Classes
Updating a Class
curl "https://api.simracing.co.uk/v0.1/class/1" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<class>
<name>Historic World Champion Drivers</name>
<description/>
</class>"
The above command updates the
name
field and clears the contents of thedescription
field for the driver class with ID1
, and returns the updated driver class XML, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<class>
<id>1</id>
<name>Historic World Champion Drivers</name>
<short_name>WCD</short_name>
<icon>Rosette</icon>
<description/>
<order>1</order>
<default>false</default>
<class_uri>https://api.simracing.co.uk/v0.1/classes/1</class_uri>
</class>
This endpoint updates a driver class in the VMS database.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the driver class to update |
HTTP Request
PATCH https://api.simracing.co.uk/v0.1/classes/<ID>
The request body should include correctly-formatted XML containing a class
root element.
Optional Fields
The following fields are optional when updating a driver class, and need not be included. If they are included, an error will be returned if they are invalid. Fields that are not included will remain as they were prior to the update request. To clear the value currently in a field, include an empty XML tag for the field. Fields required when creating a class cannot be cleared.
XML Tag | Description | Format | Can Be Cleared |
---|---|---|---|
name | The name of the driver class. | string of at least 3 characters | No |
short_name | The short name of the driver class. | string between 1 and 3 characters | No |
icon | The icon used to represent this driver class. | a letter from A-Z, a number from 0-9, or one of the strings 'Gold, 'Silver', 'Bronze', 'Blue', 'Red', 'Purple', 'Green', 'Star', 'Shield', 'Rosette' | Yes |
description | A description of this driver class. | string of at most 255 characters | Yes |
default | Whether this driver class is the default class for newly-registered drivers. | true or false |
No |
apply_to_unclassed_drivers | Whether this driver class should be applied to all existing unclassed drivers in VMS database. Can only be set if default is set to true. |
true or false |
No |
order | Insert this driver class in the specified position in the driver class order. | unsigned non-zero int | No |
Notes
- The driver class name must be unique.
- The
apply_to_unclassed_drivers
field cannot be set totrue
if thedefault
field is not set totrue
.
Customers
Updating a Customer
curl "https://api.simracing.co.uk/v0.1/customers/4" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<customer>
<tel>234-567-8901</tel>
<cell/>
<source_other>Saw Google AdWords advertising campaign</source_other>
</customer>"
The above command updates the
tel
andsource_other
fields and clears the contents of thecell
field for the customer with ID4
, and returns the updated customer's XML, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<customer>
<id>4</id>
<name>Juan Manuel Fangio</name>
<tel>234-567-8901</tel>
<cell/>
<email>juan@example.com</email>
<email_optin>false</email_optin>
<source>Google/Web</source>
<source_other>Saw Google AdWords advertising campaign</source_other>
<home_venue>Venue One</home_venue>
<class/>
<laps_recorded/>
<last_visit/>
<last_vehicle/>
<last_circuit/>
<last_group_event/>
<customer_uri>https://api.simracing.co.uk/v0.1/customers/432</customer_uri>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
<lap_times_uri>https://api.simracing.co.uk/v0.1/customers/432/lap_times</lap_times_uri>
</customer>
This endpoint updates a customer in the VMS database.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the customer to update |
HTTP Request
PATCH https://api.simracing.co.uk/v0.1/customers/<ID>
The request body should include correctly-formatted XML containing a customer
root element.
Optional Fields
The following fields are optional when updating a customer, and need not be included. If they are included, an error will be returned if they are invalid. Fields that are not included will remain as they were prior to the update request. To clear the value currently in a field, include an empty XML tag for the field. Fields required when creating a customer cannot be cleared.
XML Tag | Description | Format | Can Be Cleared |
---|---|---|---|
name | The name of the customer. | string of at least 3 characters | No |
home_venue_id | A valid venue ID in the database. | unsigned non-zero int | No |
tel | The telephone number of the customer. | string of at least 3 characters | Yes |
cell | The mobile/cell number of the customer. | string of at least 3 characters | Yes |
The e-mail address of the customer. | string of at least 3 characters with a valid e-mail address format | Yes | |
email_optin | Whether the customer has opted-in to e-mail marketing messages. | true or false |
Yes |
source | A valid customer source. | 'Email Campaign', 'Google/Web', 'Leaflet', 'Passing By', 'Phone Directory', 'Printed Publication', 'Radio', 'Referral', 'Reseller/Voucher', 'TV', 'Other' or 'Unknown' | Yes |
source_other | Additional details on the customer source. | string | Yes |
class_id | A valid class ID in the database. If the class_id tag is not present, the default class (if defined) will be used. If the class_id tag is present but empty, the customer will have no class assigned. |
unsigned non-zero int | Yes |
if_duplicate_email_make_secondary | Whether to set this customer as a secondary contact if the e-mail address already exists in the VMS database. If set to false, or unset, an error will be returned if the e-mail address already exists in the VMS database. | true or false |
Yes |
Notes
- The
email_optin
field cannot be set totrue
if an e-mail address is not present for the customer.
Hot Lapping Events
Updating a Hot Lapping Event
curl "https://api.simracing.co.uk/v0.1/hotlap_events/1" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<hotlap_event>
<name>July 2022</name>
<start_date>2022-07-01 00:00:00</start_date>
<end_date>2022-07-31 23:59:00</end_date>
<qualification_percentage/>
</hotlap_event>"
The above command updates the
name
,start_date
andend_date
fields and clears the contents of thequalification_percentage
field for the hot lapping event with ID1
, and returns the updated event's XML, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>July 2022</name>
<start_date>2022-07-01 00:00:00</start_date>
<end_date>2022-07-31 23:59:00</end_date>
<qualification_percentage/>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class A Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>2</sub_event_id>
<name>Unclassed</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
</hotlap_events>
This endpoint updates a hot lapping event in the VMS database.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the hot lapping event to update |
HTTP Request
PATCH https://api.simracing.co.uk/v0.1/hotlap_events/<ID>
The request body should include correctly-formatted XML containing a hotlap_event
root element.
Optional Fields
The following fields are optional when updating a hot lapping event, and need not be included. If they are included, an error will be returned if they are invalid. Fields that are not included will remain as they were prior to the update request. To clear the value currently in a field, include an empty XML tag for the field. Fields required when creating a hot lapping event cannot be cleared.
XML Tag | Description | Format | Can Be Cleared |
---|---|---|---|
name | The name of the hot lapping event. | string of at least 3 characters | No |
start_date | The start date and time of the hot lapping event. | YYYY-MM-DD HH:MM:SS |
No |
end_date | The end date and time of the hot lapping event. | YYYY-MM-DD HH:MM:SS |
No |
venues | A list of one or more valid venue IDs in the database. | unsigned non-zero int in one or more venue_id tags. |
No |
circuit_id | A valid circuit ID in the database. | unsigned non-zero int | No |
qualification_percentage | How many percent slower a lap can be while appearing above the qualification line in the SWP results. To disable the qualification line, do not set this value. | unsigned non-zero int between 1 and 100 | Yes |
Notes
- The start date and end date of the hot lapping event should be specified in local venue time, and should not include timezone information.
- Lap eligibility for hot lapping events is calculated whenever a hot lapping event is created or updated. For example, updating a hot lapping event with a different start or end date will automatically pull in all eligible laps in your VMS database.
Adding a Sub-event
curl "https://api.simracing.co.uk/v0.1/hotlap_events/1" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<hotlap_event>
<sub_event>
<name>Class C Cars</name>
<classes>
<class_id>2</class_id>
</classes>
</sub_event>
</hotlap_event>"
The above command adds a new sub-event to the existing hot lapping event, and returns the updated event's XML, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>July 2022</name>
<start_date>2022-07-01 00:00:00</start_date>
<end_date>2022-07-31 23:59:00</end_date>
<qualification_percentage/>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class A Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>2</sub_event_id>
<name>Unclassed</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>3</sub_event_id>
<name>Class C Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
</hotlap_events>
Adding a sub-event to an existing hot lapping event is done by updating the hot lapping event and specifying the new sub-event details.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the hot lapping event to add the sub-event to |
HTTP Request
PATCH https://api.simracing.co.uk/v0.1/hotlap_events/<ID>
The request body should include correctly-formatted XML containing a hotlap_event
root element and one or more sub_event
elements.
Required Fields
The following fields are required when creating a new hot lapping sub-event, and an error will be returned if they are not included, or if they are invalid.
XML Tag | Description | Format |
---|---|---|
name | The name of the hot lapping sub-event. | string of at least 3 characters |
Optional Fields
The following fields are optional when creating a new hot lapping sub-event, and need not be included. If they are included, an error will be returned if they are invalid.
XML Tag | Description | Format | Default Value |
---|---|---|---|
vehicles | A list of one or more valid vehicle IDs in the database. Only laps recorded by these vehicles will be eligible for the hot lapping sub-event. To allow any vehicle, do not set this value. | unsigned non-zero int in one or more vehicle_id tags. |
none |
classes | A list of one or more valid driver class IDs in the database. Only laps recorded by drivers with these classes will be eligible for the hot lapping sub-event. To allow any driver class, do not set this value. | unsigned non-zero int in one or more class_id tags. |
none |
Notes
- Multiple hot lapping sub-events can be added in a single API request.
- It is not currently possible to update the order of hot lapping sub-events. If the order needs to be altered, it is recommended to delete and re-create the hot lapping event.
Updating a Sub-event
curl "https://api.simracing.co.uk/v0.1/hotlap_events/1" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<hotlap_event>
<sub_event>
<sub_event_id>2</sub_event_id>
<vehicles>
<vehicle_id>1</vehicle_id>
<vehicle_id>2</vehicle_id>
<vehicle_id>3</vehicle_id>
</vehicles>
</sub_event>
</hotlap_event>"
The above command updates the existing sub-event with ID
2
in the hot lapping event with ID1
, altering the vehicle IDs that are valid for this sub-event. It returns the updated event's XML, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>July 2022</name>
<start_date>2022-07-01 00:00:00</start_date>
<end_date>2022-07-31 23:59:00</end_date>
<qualification_percentage/>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class A Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>2</sub_event_id>
<name>Unclassed</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>3</sub_event_id>
<name>Class C Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
</hotlap_events>
Updating a sub-event in an existing hot lapping event is done by updating the hot lapping event and specifying the updated sub-event details, and including the sub_event_id
of the sub-event to be updated.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the hot lapping event to update the sub-event in |
HTTP Request
PATCH https://api.simracing.co.uk/v0.1/hotlap_events/<ID>
The request body should include correctly-formatted XML containing a hotlap_event
root element and one or more sub_event
elements, each containing the sub_event_id
to be updated.
Required Fields
The following fields are required when updating a hot lapping sub-event, and an error will be returned if they are not included, or if they are invalid.
XML Tag | Description | Format |
---|---|---|
sub_event_id | The VMS ID of the hot lapping sub-event to update. | unsigned non-zero int |
Optional Fields
The following fields are optional when updating a hot lapping sub-event, and need not be included. If they are included, an error will be returned if they are invalid. Fields that are not included will remain as they were prior to the update request. To clear the value currently in a field, include an empty XML tag for the field. Fields required when adding a hot lapping sub-event cannot be cleared.
XML Tag | Description | Format | Can Be Cleared |
---|---|---|---|
name | The name of the hot lapping sub-event. | string of at least 3 characters | No |
vehicles | A list of one or more valid vehicle IDs in the database. Only laps recorded by these vehicles will be eligible for the hot lapping sub-event. To allow any vehicle, do not set this value. | unsigned non-zero int in one or more vehicle_id tags. |
Yes |
classes | A list of one or more valid driver class IDs in the database. Only laps recorded by drivers with these classes will be eligible for the hot lapping sub-event. To allow any driver class, do not set this value. | unsigned non-zero int in one or more class_id tags. |
Yes |
Notes
- To update a hot lapping sub-event, the
sub_event_id
must be included, otherwise a new sub-event will be created. - Multiple hot lapping sub-events can be updated in a single API request.
- It is not currently possible to update the order of hot lapping sub-events. If the order needs to be altered, it is recommended to delete and re-create the hot lapping event.
Deleting a Sub-event
curl "https://api.simracing.co.uk/v0.1/hotlap_events/1" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<hotlap_event>
<sub_event>
<sub_event_id>2</sub_event_id>
</sub_event>
</hotlap_event>"
The above command deletes the existing sub-event with ID
2
in the hot lapping event with ID1
. It returns the updated event's XML, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>July 2022</name>
<start_date>2022-07-01 00:00:00</start_date>
<end_date>2022-07-31 23:59:00</end_date>
<qualification_percentage/>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class A Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>3</sub_event_id>
<name>Class C Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
</hotlap_events>
Deleting a sub-event in an existing hot lapping event is done by updating the hot lapping event and including the sub_event_id
of the sub-event to be deleted, with no other fields specified for that sub-event.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the hot lapping event to update the sub-event in |
HTTP Request
PATCH https://api.simracing.co.uk/v0.1/hotlap_events/<ID>
The request body should include correctly-formatted XML containing a hotlap_event
root element and one or more sub_event
elements, each containing the sub_event_id
to be deleted.
Required Fields
The following fields are required when updating a hot lapping sub-event, and an error will be returned if they are not included, or if they are invalid.
XML Tag | Description | Format |
---|---|---|
sub_event_id | The VMS ID of the hot lapping sub-event to delete. | unsigned non-zero int |
Notes
- To delete a hot lapping sub-event, only the
sub_event_id
must be specified. Any other fields in the sub-event will cause the specified ID to be updated. - Multiple hot lapping sub-events can be deleted in a single API request.
Combined Updates
curl "https://api.simracing.co.uk/v0.1/hotlap_events/1" \
-H "Authorization: SRL <your-API-key>" \
-H "Content-Type: text/xml;charset=UTF-8" \
-X PATCH \
-d "
<hotlap_event>
<name>July 2022</name>
<start_date>2022-07-01 00:00:00</start_date>
<end_date>2022-07-31 23:59:00</end_date>
<qualification_percentage/>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class X Cars</name>
<vehicles>
<vehicle_id>1</vehicle_id>
<vehicle_id>2</vehicle_id>
<vehicle_id>3</vehicle_id>
</vehicles>
<classes>
<class_id>3</class_id>
</classes>
</sub_event>
<sub_event>
<sub_event_id>2</sub_event_id>
</sub_event>
<sub_event>
<name>Class C Cars</name>
<classes>
<class_id>2</class_id>
</classes>
</sub_event>
</hotlap_event>"
The above command updates the
name
,start_date
andend_date
fields and clears the contents of thequalification_percentage
field for the hot lapping event with ID1
. It modifies the sub-event with ID1
, deletes the sub-event with ID2
, and creates a new sub-event. The updated event's XML is returned, structured like this:
<?xml version="1.0" encoding="utf-8"?>
<hotlap_events>
<hotlap_event>
<id>1</id>
<name>July 2022</name>
<start_date>2022-07-01 00:00:00</start_date>
<end_date>2022-07-31 23:59:00</end_date>
<qualification_percentage/>
<venues>
<venue>
<id>1</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/1</venue_uri>
</venue>
<venue>
<id>2</id>
<venue_uri>https://api.simracing.co.uk/v0.1/venues/2</venue_uri>
</venue>
</venues>
<hotlap_event_uri>https://api.simracing.co.uk/v0.1/hotlap_events/1</hotlap_event_uri>
</hotlap_event>
<sub_event>
<sub_event_id>1</sub_event_id>
<name>Class A Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
<sub_event>
<sub_event_id>3</sub_event_id>
<name>Class C Cars</name>
<circuit_id>1</circuit_id>
<circuit_name>A1 Ring - GP</circuit_name>
<circuit_length>4.326</circuit_length>
<circuit_uri>https://api.simracing.co.uk/v0.1/circuits/1</circuit_uri>
<results/>
</sub_event>
</hotlap_events>
All aspects of a hot lapping event, as documented above, can be updated with a single API request, by combining the required updates as shown in the example.
Notes
- Depending on your application, for complex updates to hot lapping events, it may be simpler to perform smaller updates across multiple API requests, or to delete the hot lapping event and recreate it with the desired changes. If writing an application that performs many alterations in a single call, care must be taken to ensure that you do not have edge-cases that can cause your application to send invalid data to the API.
- It is not currently possible to update the order of hot lapping sub-events. If the order needs to be altered, it is recommended to delete and re-create the hot lapping event.
Deleting Data
An HTTP DELETE
request should be made to the appropriate endpoint, documented below, to delete a record in the API. Ensure that you include your API key in all requests, as documented in the authentication instructions.
A successful request will return a 200 OK
return code.
Caution: Once a record has been deleted, it cannot be restored. Care must be taken to ensure the correct ID is specified when making a delete request. Sim Racing Limited is unable to restore deleted data.
Bookings
Deleting a Booking
curl "https://api.simracing.co.uk/v0.1/bookings/1" \
-H "Authorization: SRL <your-API-key>" \
-X DELETE
The above command deletes the booking with ID
1
and returns a200 OK
code if successful.
This endpoint deletes the specified booking from the database. Customers, circuits, vehicles, etc. which are referenced in the booking will not be deleted.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the booking to delete |
HTTP Request
DELETE https://api.simracing.co.uk/v0.1/bookings/<ID>
Classes
Deleting a Class
curl "https://api.simracing.co.uk/v0.1/classes/1" \
-H "Authorization: SRL <your-API-key>" \
-X DELETE
The above command deletes the driver class with ID
1
and returns a200 OK
code if successful.
This endpoint deletes the specified driver class from the database. Deleting a driver class prevents any additional customers from being assigned to that driver class. Customers who are associated with this driver class will not be deleted and will still be assigned to this driver class.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the driver class to delete |
HTTP Request
DELETE https://api.simracing.co.uk/v0.1/classes/<ID>
Hot Lapping Events
Deleting a Hot Lapping Event
curl "https://api.simracing.co.uk/v0.1/hotlap_events/1" \
-H "Authorization: SRL <your-API-key>" \
-X DELETE
The above command deletes the hot lapping event with ID
1
and returns a200 OK
code if successful.
This endpoint deletes the specified hot lapping event from the database. Customers, circuits, vehicles, laps, etc. which are associated with the hot lapping event will not be deleted.
URL Parameters
Parameter | Description |
---|---|
ID | The ID of the hot lapping event to delete |
HTTP Request
DELETE https://api.simracing.co.uk/v0.1/hotlap_events/<ID>