Some basic rules that apply for all requests to our API.
Blanks for illustration purposes only
https://infosnow.ch/api/ API endpoint / URL parameters
We have several API endpoints you can communicate with. Watch out that you are using the correct one as documented.
API endpoint names are case sensitive.
Please note the slash after the endpoint.
To control your result you may/must use parameters.
Do not use any parameter more than once in the same URL.
URL parameter names and values are case sensitive.
Do not forget to properly URL-encode your URL parameters.
Make sure you are using the correct HTTP request method as documented.
GET | POST | PUT | DELETE
There is one HTTP header required in all requests to get authorization by the server.
Additional HTTP headers may be optionally available or even required.
GET /api/resorts/ HTTP/1.1 Host: infosnow.ch APG-Authorization: Signature
You will receive a public and a private key by APG|SGA. These are both needed to calculate the signature for your requests as follows (blanks for illustration purposes only):
BASE64( PUBLIC KEY : SHA256( https://infosnow.ch/api/ API endpoint / PRIVATE KEY ) )
Please note the slash after the endpoint.
We support the following HTTP-compression formats: gzip, deflate and compress.
You need to set one of the following HTTP-Headers:
Accept-Encoding: deflate
If you are using this, you must encode your data too, of course.
Content-encoding: deflate
You should receive the following response code if you are addressing our API correctly.
HTTP/1.1 200 OK
If you are receiving the following code, there probably is something wrong with your hash calculation or you are trying to access something you are not allowed to. Ask APG|SGA for help if you cannot figure out the problem by yourself.
HTTP/1.1 401 Unauthorized
Content format is JSON and data must be properly JSON-encoded.
Charset of content of requests and responses must be UTF-8.
URL-Parameter values must be URL-encoded.
Date format is ISO (YYYY-MM-DD) if not declared otherwise.
Dates are local time if not stated/requested otherwise.