Test the API

Logo HandleData 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.

Summary

  • The API test is carried out on the published API (whether it is Available or Unavailable) from the published configuration, it does not affect the API data.

    • If you have just created an access or added a consumer in the publication settings and you have not published these changes, it will not be possible to test it.

  • To see the results of the API, you must define the type of simulation that you wish to perform

    • for a single user referenced as a consumer

    • for one or more groups referenced as consumers

    • for one or more accesses

  • Various Modify query parameters can be used to build and test a specific request.

  • The URL can be displayed in REST or OData format.

  • The Query results can be displayed in tabular, JSON or XML format (OData only).

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
  1. Choose the type of simulation: User Group(s) Access.

  2. Select the user, group(s) or access(es) to be tested.

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

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