Update API documentation (4/4) authored by ZZZ[GONE] Paul Bouchillou's avatar ZZZ[GONE] Paul Bouchillou
...@@ -16,7 +16,7 @@ The token must be set to the "X-API-Key" parameter in the HTTP header. ...@@ -16,7 +16,7 @@ The token must be set to the "X-API-Key" parameter in the HTTP header.
# How to use the API UI page ? # How to use the API UI page ?
If you have a valid token, you can request the API from anywhere, including it's [start page]( https://operations-portal.egi.eu/api-documentation), which provides an user interface, and demo features. If you have a valid token, you can request the API from anywhere, including it's [start page]( https://operations-portal.egi.eu/api-documentation), which comes with an user interface implementing [Swagger UI](https://swagger.io/tools/swagger-ui/).
To do this, click the ![authorize](uploads/7fb174f05f8772668c180eeaf3a8b57f/authorize.png) button, and set your token value in the prompt. In this way your token will be automatically set in the header (X-API-Key) for all your requests on this page. To do this, click the ![authorize](uploads/7fb174f05f8772668c180eeaf3a8b57f/authorize.png) button, and set your token value in the prompt. In this way your token will be automatically set in the header (X-API-Key) for all your requests on this page.
You can now request every endpoint of the API with a friendly user interface. You can now request every endpoint of the API with a friendly user interface.
...@@ -25,10 +25,10 @@ The image below shows an example of one endpoint. ...@@ -25,10 +25,10 @@ The image below shows an example of one endpoint.
![example-ui](uploads/0fbff7a75c14f61ea43a34c3e7d1be19/example-ui.png) ![example-ui](uploads/0fbff7a75c14f61ea43a34c3e7d1be19/example-ui.png)
Send your request by clicking "Try it" on the route you want to request, set the appropriate parameters, and click "Execute". Send your request by clicking ![try-it-out](uploads/c6b2b1fda5127571f4c174c1ee6d93e2/try-it-out.png) on the route you want to request, set the appropriate parameters, and click "Execute".
As soon as the response is back, the API user interface will display : As soon as the response is back, the API user interface will display :
- The response's HTTP status and content (in case of error the API usually returns a helper message specifying whether it's a request problem or a server failure). - The response's HTTP status and content (in case of error the API usually returns a helper message specifying whether it's a request problem or a server failure).
- TODO img - ![exampl-respcode](uploads/030138b2fd12a5e35a06e2b79901c117/exampl-respcode.png)
- The request URL matching your parameters and an re-usable Curl command line to request this URL from anywhere (see below). - The request URL matching your parameters and an re-usable Curl command line to request this URL from anywhere (see below).
- ![example-response](uploads/877c86c1a66a0d5921ce2c70d44ffabe/example-response.png) - ![example-response](uploads/877c86c1a66a0d5921ce2c70d44ffabe/example-response.png)
\ No newline at end of file