CRUD Operations
To execute an HTTP request to the WebApi service and test the parameters to send and the responses obtained, the simplest thing to do is to install the Postman program, which is freely downloadable for all platforms or installable as a browser extension for Chrome. The examples below are based on this program, although it is possible to use any program or utility capable of generating HTTP requests, such as CURL.
Reference Endpoint
The Enterprise WebAPI resources are installed to respond to the server URL in the format webapi_base_url, which is composed of what is indicated below as server+port+rootpath.
Manage Authentication
To test the service, you need to use the Bearer Token obtained during the login phase.
Declare the Scope
You must specify an additional mandatory authentication parameter called Authorization-Scope: this mandatory parameter must be defined as an additional header in the HTTP request, and its value must necessarily match the value of the "environment" parameter specified in the URL.
Customize the Request
It is possible to specify two additional optional parameters in the HTTP request headers, useful for modifying the standard behavior of the service:
Accept: defines the serialization format of the input/output parameters. Possible values are:application/json: the data returned by the service (GET: read) or accepted as input (POST: creation or PUT/PATCH: modification) is serialized in JSON format.
tipThis is the default format, i.e., the format used if the
Acceptheader is not specified.application/xml: the data returned by the service (GET: read) or accepted as input (POST: creation or PUT/PATCH: modification) is serialized in XML format.
Accept-Encoding: if present and containing the valuegzip, compress, the HTTP response is compressed in GZIP format to speed up data transfer.Accept-Language: if present and set with an IETF language code (such asit,en, oren-USamong many others), it sets the system language and therefore the language of error and/or validation messages.tip- The default language, i.e., the one set if the
Accept-Languageheader is not specified, is Italian. - The WebApi service response contains the headers
Content-Type,Content-Language, andContent-Encoding, which can therefore be used to decide how to deserialize the obtained data.
- The default language, i.e., the one set if the