2. Step by step guide¶
2.1. API Key generation¶
Register on the Zillin website https://zillin.io/
Go to the ‘API’ tab.
Add key:
The newly generated key will be shown below.
2.2. Choosing API Version¶
To make a request to specific API version, you need to add authentication header with name ‘api-version’ and value of version e.g ‘2.0’
If no header will be present, the request will be sent to the default version. Currently, the default version is 1.0.
Additionally, we have added response headers ‘api-supported-versions’ and ‘api-deprecated-versions’ with information about current supported and deprecated versions.
2.3. First request¶
Descriptions of available methods can be found here: https://api.zillin.io/swagger
Each request requires authorization header with API key: “Authorization: c4dc6d89c92f453d8d67e571120b3bb4”
Requests can be made in many different ways like:
2.3.1. Using our site¶
Click the ‘Authorize’ button.
Paste and confirm API key.
Choose desired method e.g ‘get datasets’
Click ‘try it out’ button
Set required workspaceId parameter (can be obtained by ‘get workspaces’ method) and optionally API version.
Click ‘execute’ button
The response body with response headers will be shown below.
2.3.2. Using Postman¶
2.3.3. Using command line with curl¶
Authorization header: “Authorization: c4dc6d89c92f453d8d67e571120b3bb4”
API version header: “api-version: 1”
Response type header: “accept: text/plain”
Choosen method: GET “https://api.zillin.io/api/Datasets”
Run the whole command:
curl -X GET “https://api.zillin.io/api/Datasets” -H “Authorization: c4dc6d89c92f453d8d67e571120b3bb4” -H “api-version: 1” -H “accept: text/plain”
The response will be shown below:
2.4. Using API in your own application¶
To use API in your application you need to generate a client.
Many developers still hardcode their clients. It might not be a good solution, because it increases the possibilities of bugs in the specification. It is inefficient as well. The better way to generate your clients is to use a swagger editor.
2.4.1. Generating client with the online swagger editor¶
Go to page https://editor.swagger.io/
Select ‘file’ and ‘import URL’
Find the desired URL on our website https://api.zillin.io/swagger
Choose the version and click the link from the left:
Paste URL into the box and click the ‘ok’ button.
Choose the desired language e.g python
Save the zip file. The ‘swagger_client’ folder will display models and APIs: