Facilities¶
The facility contains the information about location, timezone ect. The facilities endpoint can be used get a list of available facilities and to do all the CRUD operation. It's also possible to get all connected resources connected to a facility by calling the endpoints described in this section.
Note
This requires a authenticated user with the right authorization token. If the token is not valid the endpoit will return status code 403 - Unauthorized to perform the specified action.
Single facility¶
To get a single facility the facility id is needed.
GET /api/facilities/{id}
Host: https://api.trackmanrange.com
If the request is successful, you'll get back an http 200 response from the server together with a json document with the following structure:
{
"id": "2d3e5ca5-771e-4cc2-8e61-8874edbdd33b",
"name": "Trackman A/S.",
"facilityKey": "ta1-dk",
"description": "",
"timezone": "Europe/Copenhagen",
"address": {
"street": "Stubbeled 2",
"city": "Vedbæk",
"zipCode": "2950",
"countryCode": "DK"
},
"phoneNumber": "+45 45 74 47 42",
"email": "nih@trackman.com",
"logoUrl": "https://cdn.trackmangolf.com/facility-demo/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b_logo_529d1ba0-7788-4b75-8890-15e92c900fcb",
"worldLocation": {
"lat": 55.83676,
"lon": 12.53196
},
"drivingRangeAppNotUsed": false,
"installations": [
{
"name": "Caven",
"type": "sim.bays",
"installation": {
"id": "21068d4f-e41d-4833-9d38-895d0fe20afb",
"name": "Caven"
},
"facility": {
"id": "2d3e5ca5-771e-4cc2-8e61-8874edbdd33b",
"name": "Trackman A/S"
},
"id": "af5c7639-67bd-4275-9cba-f78afac467fc",
"createdAt": "2019-01-31T12:35:37.0711925Z",
"lastUpdatedAt": "2019-01-31T12:35:37.0746259Z"
}
],
"createdAt": "2018-11-16T08:20:23.5231602Z",
"lastUpdatedAt": "2019-08-01T11:52:34.8825837Z",
"_links": {
"self": {
"method": "GET",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b"
},
"edit": {
"method": "PUT",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b"
},
"delete": {
"method": "DELETE",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b"
},
"get_installations": {
"method": "GET",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b/installations"
},
"create_installation": {
"method": "POST",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b/installations"
},
"get_tournaments": {
"method": "GET",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b/tournaments"
}
}
}
List facilities¶
To get a list of available facility, make a get to the facility endpoint. That will return all facilities available to the used access token used.
GET /api/facilities
Host: https://api.trackmanrange.com
If the request is successful, you'll get back an http 200 response from the server together with a json document with the following structure:
{
"items": [
{
"id": "2d3e5ca5-771e-4cc2-8e61-8874edbdd33b",
"name": "Trackman A/S.",
"facilityKey": "ta1-dk",
"description": "",
"timezone": "Europe/Copenhagen",
"address": {
"street": "Stubbeled 2",
"city": "Vedbæk",
"zipCode": "2950",
"countryCode": "DK"
},
"phoneNumber": "+45 45 74 47 42",
"email": "nih@trackman.com",
"logoUrl": "https://cdn.trackmangolf.com/facility-demo/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b_logo_529d1ba0-7788-4b75-8890-15e92c900fcb",
"worldLocation": {
"lat": 55.83676,
"lon": 12.53196
},
"drivingRangeAppNotUsed": false,
"installations": [
{
"name": "Caven",
"type": "sim.bays",
"installation": {
"id": "21068d4f-e41d-4833-9d38-895d0fe20afb",
"name": "Caven"
},
"facility": {
"id": "2d3e5ca5-771e-4cc2-8e61-8874edbdd33b",
"name": "Trackman A/S"
},
"id": "af5c7639-67bd-4275-9cba-f78afac467fc",
"createdAt": "2019-01-31T12:35:37.0711925Z",
"lastUpdatedAt": "2019-01-31T12:35:37.0746259Z"
}
],
"createdAt": "2018-11-16T08:20:23.5231602Z",
"lastUpdatedAt": "2019-08-01T11:52:34.8825837Z",
"_links": {
"self": {
"method": "GET",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b"
},
"edit": {
"method": "PUT",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b"
},
"delete": {
"method": "DELETE",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b"
},
"get_installations": {
"method": "GET",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b/installations"
},
"create_installation": {
"method": "POST",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b/installations"
},
"get_tournaments": {
"method": "GET",
"href": "https://api.trackmanrange.com/api/facilities/2d3e5ca5-771e-4cc2-8e61-8874edbdd33b/tournaments"
}
}
}
],
"_links": {
"self": {
"method": "GET",
"href": "https://dr-cloud-api-dev.trackmangolfdev.com/api/facilities"
}
}
}