After EcoSys is configured, you can use any API tool to access EcoSys REST APIs. The following steps describe how to make a request to get a Token and then use the Token to make a request for data from EcoSys.
The following calls can be made in any API tool such as Postman, Swagger, and so on.
Getting a Token from the OAuth Provider
-
Create a request using the HTTP method POST.
-
Set the URL to the token provider’s Token URL.
-
The content type of the body should be x-www-form-urlencoded.
-
The body should have the following attributes
-
grant_type - Set to ‘client_credentials’
-
client_id - Enter the Client ID as it is set in the OAuth provider
-
client_secret - Enter the Client Secret as it is set in the OAuth provider
-
Scope - Enter the Scope as it is set in the OAuth provider.
-
-
Execute the request to retrieve a token.
The access token will be displayed in the response body. For example, "accesss_token": " __access_token_string__ "
The "__access_token_string__" is a long token which will be used in the API request to EcoSys.
Calling EcoSys Smart API
-
Create a request using the HTTP method GET.
-
Set the URL to the EcoSys REST API endpoint https://<server name>/ecosys/api/….
-
The body should have the following attributes:
-
Authorization – Set to Bearer <__access_token_string__ >
For example: Bearer eyJraWQi…
-
-
Execute the request to retrieve data from EcoSys.