Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The Greenspector Studio API is available using the swagger page when connecting to studio web interface or by using API token with tools like curl, postman …

Use swagger

When connecting to the Studio Web Interface, the swagger is available by going to the menu Help (question) / Documentation page and clicking on Greenspector Studio API link.

doc_en.pngswaggerapi.png

Use API Token with curl or postman

Prerequisites

You need to generate a new API token or use an existing API token shared by an admin. You can go to menu Account / API Tokens and then copy to your clipboard the API token by clicking on the first action button.

apitokens_listflou.png

Then, if you want to call API which concerns your analysis (or application), you need to add this API token as a member of the analysis. The API token is seen like an user.

token2.png

Example with curl

curl -X 'GET' \                                           
  'http://saas.greenspector.com/applications/{applicationId}/evolution' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer {XXXX}'
  • Replace {applicationId} with the applicationId of your analysis. When you open an analysis on the interface, you can find the applicationId on the url. For example:

https://saas.greenspector.com/applications/670777777777/versions/6710fb777777/synthesis

  • Replace {XXXX} with an API token.

Be careful, do not keep {} when replacing.

Example with postman

  • Add a new request in postman

  • Set a new GET request with url http://saas.greenspector.com/applications/{applicationId}/evolution

  • Replace {applicationId} with the applicationId of your analysis. When you open an analysis on the interface, you can find the applicationId on the url. For example:

https://saas.greenspector.com/applications/670777777777/versions/6710fb777777/synthesis

  • Add an authorization of type Bearer Token and put your API Token.

  • Then press the button Send.

  • You should see the json results

evolution.png

  • No labels