Greenspector Studio API

The Greenspector Studio API is available by using the swagger page or by using an API token with tools like curl, postman …

Use swagger

When you are connected to the Studio Web Interface, the swagger is available by going to the menu Help / Documentation and by clicking on Greenspector Studio API link.

doc_en.png

 

swaggerapi.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.

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.

Take the opportunity to retrieve the “applicationId” identifier of your analysis. You can find it in the url bar when you open an analysis. For example:

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

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.

  • 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.

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

  • Then press the button Send.

  • You should see the json results