Test the API
HandleData -
Version 8.6.0
- To test the API
-
-
You must have ‘Modify’ rights on the API Exhibition.
-
The API must be published (‘Available’ or ‘Unavailable’ status).
-
Testing an published API by Data Producer simulates a call to the API as it might be made by consumers. The results (columns, data) displayed correspond exactly to those seen by a consumer.
General
Simulating an API request for a user, groups or accesses allows you to check that the access parameters of a published API are correctly configured.
The result (available columns and data) takes into account all the parameters of the published access(es) concerned by the test (visible columns, line filters, hashes, etc.).
To test the API, click on Test the API from the API Exhibition details page.
Simulate an API call
As a Data Producer, you can test the API by simulating the call for another user (or group of users).
You can also see the result of configuring a specific access or a combination of several accesses.
It is possible to simulate the API call * for a specific user, entered as a consumer in one or more accesses * for one or more groups entered as consumers * for a specific access or a set of accesses
You can only see users added as consumers: if you have only added groups, you will not be able to test the API as a user. |
- To view the expected results for the simulation you need to
-
-
Choose the type of simulation:
User
Group(s)
Access
. -
Select the user, group(s) or access(es) to be tested.
-
Click on Simulate: The available columns and query parameters are displayed.
-
The open access can only be selected alone as the access to be tested. |
You can display the expected (rows), by clicking on Test next to the URL displayed, or modify the query using the query parameters form.
Modify query parameters
Several fields can be used to customise the query and build a specific URL (which you can share directly with consumers)
-
Column(s): columns to be included in the query
-
If no column is selected, all columns are included (corresponds to an all)
-
The order of the columns can be changed by dragging and dropping each column label to the left or right.
-
-
Row filter: set of rules for refining the result by filtering the rows.
-
The filter must respect the syntax to be valid
-
-
Sort column(s): defines the sort order of the columns
-
The sort direction can be changed by clicking on the label arrow
-
The sort order can be changed by dragging and dropping each column to the left or right.
-
-
Page: defines the page to be displayed
-
Number of rows per page*: sets the maximum number of rows per page to be displayed in the query
The URL is updated as you modify the query parameters.
To display the results based on the new parameters, click on Test.
Query results
The results can be displayed in different formats: table, JSON and XML (for OData only).
If the query is incorrect, an error message displays details of the problem encountered. |
The data displayed corresponds to the expected result for the type of simulation in progress +. The data is identical to that sent directly by the PLC.
The access parameters linked to the current simulation have a direct impact on the results
-
Columns: only unmasked columns accessible for the selected consumer(s), group(s) or access(es) are visible.
-
Rows: only the rows corresponding to the filters defined in the accesses are visible (for example, only the rows where the ‘IsActive’ column is ‘TRUE’). If a column is set as ‘hashed’, the visible data will be hashed.
Dans le cas où plusieurs paramètres d’accès s’appliquent (par exemple un utilisateur fait partie de 2 groupes eux même dans 2 accès différents), seules les colonnes actives dans les 2 accès seront visibles (synthèse restrictive). Les lignes visibles correspondent au cumul de l’ensemble des filtres (synthèse additive). |