Examples of using Open API

April 19, 2024

ID 242748

Example 1

The method returns an error or a link for the user to access the user portal if the user previously started training.

If a link is returned, it should be displayed to the user, and no further method calls are made.

In all other cases, an error is returned with various codes. The list of available codes is described in Swagger as in the online documentation.

If a "404 user-not-found" error is received, method #2 is called.

Any error with code 422 means that the training plan is currently being calculated and the link will arrive soon. If this doesn't happen, you should contact the administrator of the account for which ASAP issued the API token.

Example 2

At this stage, we get the list of groups that the user can add himself or herself to. After the method receives the list, it needs to be filtered to display only those groups for which the isStarted parameter has the value "true".

Only in these groups has training begun, and the user can join only these groups.

If there are no such groups, the "404 groups-not-found" error is returned. In this case, you should contact the administrator of the account for which ASAP issued the API token.

Example 3

After a group is selected, personal data and a group identifier are passed to method #3. The result is either an error or a 201 response with the identifier of the added user. In this event of an error, you should contact the administrator of the account for which ASAP issued the API token.

Example 4

To receive report data on employee training:

  1. Email address used to register the user.
  2. User's registered short name.
  3. User's registered full name.
  4. User's current training group.
  5. Length of training in seconds.
  6. Performance category for the main course.
  7. Performance category for the express course.
  8. Current training status.
  9. Training progress on the main course as a percentage in the format xx.xx.
  10. Training progress on the express course as a percentage in the format xx.xx.
  11. Expected date of completion of the main course.
  12. Expected date of completion of the express course.
  13. Date of completion of main course.
  14. Date of completion of main course.
  15. Training courses and training status for the main course.
  16. Training courses and training status for the express course.
  17. Date of last activity, in a format that depends on the input localization language.
  18. The total number of certificates received by the user during training.

Example 5

To move users between groups and create training group data for each employee of the company:

  1. Current training group.
  2. Previous training group.

Example 6

Deleting an employee from the ASAP system.

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.