APG|SGA
infosnowAPI Type 1API Type 2Divers

API Type 2 - Get objects

This request delivers all objects of a certain resort.

API endpoint

objects/id of resort

Request method

GET

Request headers

If-Modified-Since (recommended)

This header must be used for each subsequent request after the first one. Please make sure that you provide the timestamp of your last successful request as shown in "Response headers" section below.

If-Modified-Since: Sun, 01 Mar 2020 14:25:00 GMT

Accept-encoding (optional)

Accept-encoding: deflate

URL parameters

Optional parameters should not be used with empty values. Just leave them out if empty.

season

This parameter is optional. This lets you filter objects by season.

season=winter|summer

facilities 1)

This parameter is optional. This lets you filter facility type(s). No comma at the beginning or end of this string. Individual groups have a numeric identifier.

facilities=lifts,slopes,505044

You can further restrict facility type(s) by a list of comma separated object ids. Don't forget the brackets.

facilities=lifts[7,9],slopes[83,84,85],505044[1456892]

reports 1)

This parameter is optional. This lets you filter report type(s). No comma at the beginning or end of this string.

reports=dangers

schedule

This parameter is optional. Using this you may activate operation hours (time) and/or the full schedules (plan).

schedule=time,plan

Resonse headers

Last-Modified

Use this timestamp for your subsequent requests as value for your If-Modified-Since header. This header will be missing if nothing has changed according to the If-Modfied-Since header you provided.

Last-Modified: Sun, 01 Mar 2020 14:25:00 GMT

Not Modified

You will get the following http state if nothing has changed. Such responses do not contain any content.

HTTP/1.1 304 Not Modified

Response content: OK

main entities

EntityTypeValuesDescription
facilitiesobjectfacility typeslist of facilities
reportsobjectreport typeslist of reports

facility types

EntityTypeValuesDescription
liftsobjectliftsconveyors
slopesobjectslopesslopes
toboganningobjecttoboganningtoboganning
hikingobjecthikinghiking and biking
funparksobjectfunparksfunparks
cross-countryobjectcross-countrycross-country skiing
restaurantsobjectrestaurantsrestaurants
accommodationobjectaccommodationaccommodation
parkingobjectparkingparking spaces
connectionsobjectconnectionsresort connections
diversobjectdiversdivers objects
routesobjectroutesroutes

report types

EntityTypeValuesDescription
tipobjecttiptip
seasonobjectseasonseason
tickersobjecttickerstickers
dangersobjectdangersavalanche danger
snowobjectsnowsnow
meteoobjectmeteometeo data
weatherobjectweather | weather (SRF)weather prognosis
diversobjectdiversdivers report data

Example

{

	"facilities":{
	
		"lifts":{
			"count":2,
			"items":[{
				"id": 14,
				"name": "Bergbahn 1",
				"state": 1
			},{
				"id": 15,
				"name": "Bergbahn 2",
				"state": 2
			}]
		},
		
		"slopes":{
			"count":2,
			"items":[{
				"id": 31,
				"name": "Piste 1",
				"state": 0
			},{
				"id": 21,
				"name": "Piste 2",
				"state": 0
			}]
			
		}
	
	},
	
	"reports":{
	
		"dangers":{
			"count":2,
			"items":[{
				"id": 40,
				"name": "Lawinengefahr 1",
				"state": 0
			},{
				"id": 41,
				"name": "Lawinengefahr 2",
				"state": 0
			}]
			
		}
	
	}
	
}

1) If you want to use these filters with a total size close to or above 8000 Bytes, you must use POST as method and send both values as body.

Beware: at least one filter must be present in this case or your POST-Request will fail.

Request headers

In this case, we don't provide a Last-Modified date for caching, but an ETag. Therefore you have to use If-None-Match as parameter to check for changes.

Content-Type: application/x-www-form-urlencoded
Content-Length: 32000
If-None-Match: 422b93131f984625869cd922eca7af03

Response headers

ETag: 422b93131f984625869cd922eca7af03

Beware: if nothing has changed, you will not get an 304 Not Modified, but an 412 Precondition Failed.

Response content: Error

{
	"error": 1002
}

Error codes

CodeDescription
1002Access denied