user.checkAuthentication

Description

object user.checkAuthentication

This method checks and prolongs user session.

Calling user.checkAuthentication method prolongs user session by default.

Parameters

The method accepts the following parameters.

ParameterTypeDescription
extendbooleanDefault value: “true”. Setting it’s value to “false” allows to check session without extending it’s lifetime. Supported since Zabbix 4.0.
sessionidstringUser session id.

Return values

(object) Returns an object containing information about user.

Examples

Request:

  1. {
  2. "jsonrpc": "2.0",
  3. "method": "user.checkAuthentication",
  4. "params": {
  5. "sessionid": "673b8ba11562a35da902c66cf5c23fa2"
  6. },
  7. "id": 1
  8. }

Response:

  1. {
  2. "jsonrpc": "2.0",
  3. "result": {
  4. "userid": "1",
  5. "username": "Admin",
  6. "name": "Zabbix",
  7. "surname": "Administrator",
  8. "url": "",
  9. "autologin": "1",
  10. "autologout": "0",
  11. "lang": "ru_RU",
  12. "refresh": "0",
  13. "theme": "default",
  14. "attempt_failed": "0",
  15. "attempt_ip": "127.0.0.1",
  16. "attempt_clock": "1355919038",
  17. "rows_per_page": "50",
  18. "timezone": "Europe/Riga",
  19. "roleid": "3",
  20. "type": 3,
  21. "sessionid": "673b8ba11562a35da902c66cf5c23fa2"
  22. "debug_mode": 0,
  23. "userip": "127.0.0.1",
  24. "gui_access": 0
  25. },
  26. "id": 1
  27. }

Response is similar to User.login call response with “userData” parameter set to true (the difference is that user data is retrieved by session id and not by username / password).

Source

CUser::checkAuthentication() in ui/include/classes/api/services/CUser.php.