Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:mervis-scada:50-api [2025/02/27 11:43]
v.kohout [api/get/projectByParts]
en:mervis-scada:50-api [2025/07/24 08:46] (current)
m.skrivanek [api/v2/get/authenticate]
Line 7: Line 7:
  
 ^Function^Description| ^Function^Description|
 +^api/v2/get/authenticate||
 ^api/checkCredentials|| ^api/checkCredentials||
 ^api/logout|| ^api/logout||
Line 35: Line 36:
 ===== Examples ===== ===== Examples =====
  
-====api/checkCredentials====+====api/v2/get/authenticate==== 
 + 
 +**Request** 
 + 
 +   * URL: /api/v2/get/authenticate?format=json 
 +   * Method: POST 
 + 
 +<code javascript> 
 +{"data":{"cred":{"n":"demo","p":"demo"}}} 
 +</code> 
 + 
 +or with the full name (with the domain and login name) 
 + 
 +<code javascript> 
 +{"data":{"cred":{"d":"GlobalDomain","n":"demo","p":"demo"}}} 
 +</code> 
 + 
 +**Response** 
 + 
 +     * token (string) - Authentication token for calling other API methods. 
 +     * tokenValidFor (TimeSpan) - The duration for which the provided token is valid. This value is not returned if a token wasn't provided or if its validity period isn't configured. Example: "P1D" indicates a validity of 1 day. 
 +     * changePwdBefore (DateTime or null) - If present, this specifies the date and time by which the current password must be changed. This period is determined by the domain's password policies, starting from the last password change. Example: "2026-12-21T13:26:42Z"
 +     * notifyNearingPwdExpirationIn (TimeSpan or null) - If present, this indicates how long before the password expires (refer to changePwdBefore) a notification should be displayed to the user. Example: "P8DT22H16M12S" (meaning just over 8 days). 
 + 
 + 
 + 
 +<code javascript> 
 +
 +    "data":
 +        "ChangePwdBefore": null, 
 +        "ClientType": 2, 
 +        "Domain": "3c73477a-6c95-4939-b047-7bbf902bcef1", 
 +        "DomainName": "GlobalDomain", 
 +        "FullName": "GlobalDomain\\demo", 
 +        "Login": "demo", 
 +        "NotifyNearingPwdExpirationIn": null, 
 +        "Token": "3:93d3c832-0f1b-4cde-a0eb-1fd346f5a9c0", 
 +        "TokenValidFor": "P1D", 
 +        "User": "48141739-5d16-4ca3-8ae1-33e27d9eb22e", 
 +        "Username": "" 
 +    }, 
 +    "result":
 +        "code": 0, 
 +        "codeTxt": null, 
 +        "dataType": null, 
 +        "desc": null 
 +    } 
 +}</code> 
 +====[Deprecated] api/checkCredentials==== 
 + 
 +This is deprecated API method. Use api/v2/get/authenticate instead!
  
 **Request** **Request**
Line 41: Line 92:
    * URL: /api/checkCredentials?format=xml    * URL: /api/checkCredentials?format=xml
    * Method: POST    * Method: POST
 +
  
 <code javascript> <code javascript>
 {"cred":{"n":"demo","p":"demo"}} {"cred":{"n":"demo","p":"demo"}}
 +</code>
 +
 +or with the full name (with an escaped backslash between the domain and login name)
 +
 +<code javascript>
 +{"cred":{"n":"GlobalDomain\\demo","p":"demo"}}
 </code> </code>
  
Line 395: Line 453:
 </code> </code>
  
-==== [Depricated] api/get/history====+==== [Deprecated] api/get/history====
  
 **Request** **Request**
  • © Energocentrum Plus, s.r.o. 2017 - 2025