REST API

 
 
Create your REST API plugin in your tenant to be able to use the VSNCrea Public API and all the available operations. In order to guarantee a proper isolation between different integrations, it's recommended to create an individual REST API plugin for each application.
 
These are the parameters to configure this plugin:
 
 
 
  • Plugin Name. Introduce a name for your plugin.
  • Service URL.. This is the Service URL. This field is automatically filled and cannot be modified.
  • Swagger URL. This URL provides you information about the available API operations. Click on the button to see this list and try all the operations.
 
 
  • Client Id. This is the internal Client Id of the current REST API plugin, you'll need this value to get an access token, required to authenticate all the REST API requests. This field is automatically filled and cannot be modified.
  • Client Secret. This is the internal Client Secret of the current REST API plugin, you'll need this value to get an access token, required to authenticate all the REST API requests. This field is automatically filled and cannot be modified. Click on the button to generate a new Client Secret.
  • Allowed IP Addresses. Introduce the authorized IP/s to use the API. If the field is empty there won't be any limitation. If you want to allow more than one IP, introduce them separated by comas. (For example: 127.0.0.1,::1)
  • API Version. Version of the REST API, latest API version is always enforced to be used when a new REST API plugin is created. This field is automatically filled and cannot be modified.
  • Is active? Check or uncheck to active or deactivate the plugin.
 
 
Once you create the plugin, you will need to get the Access Token before you can perform requests to any REST endpoint. To do so, you will need to make a POST call with this instructions:
 
  • Type: HTTP POST
  • URL: http://service_url/token (For example: "http://vsncrea/token")
  • MIME Type: x-www-form-urlencoded 
     
    In the "Body" of your request, add the following:
  • grant_type = "client_credentials"
  • "client_id" = Paste the one obtained in the plugin configuration
  • "client_secret" = Paste the one obtained in the plugin configuration
     
 
As a result of this call, you should get the Access Token that you will need to authenticate with the API.
 
 
An access token has a limited lifetime, if your token expires please repeat the previous HTTP request to get another token, and discard or remove the expired one.
 
Once you have a valid access token, use it to authenticate your requests. To achieve so, just include the following header in your HTTP requests (replacing "{access_token}" with your real access token):
 
  • Authorization -->  Bearer {access_token}
     
    Also, if you are testing the REST API on swagger, you can put your authentication details in this way to authenticate your testing requests:
 
 

The online help was made with Dr.Explain