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 [2024/06/13 10:44]
v.kohout [api/set/executeActions]
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**
Line 799: Line 857:
  </dps>  </dps>
 </getProjectByPartsResult></code> </getProjectByPartsResult></code>
 +
 +====api/get/projects====
 +
 +To get the list of projects.
 +
 +**Request**
 +
 +   * URL: /api/get/projects?format=xml
 +   * Method: POST
 +
 +<code javascript>
 +{
 + "cred":
 + {
 + "n":"xxx",
 + "p":"xxx"
 + },
 + "offset":0,
 + "count":250
 +}
 +</code>
 +
 +**Response**
 +
 +<code xml><?xml version="1.0" encoding="utf-8"?>
 +<?xml version="1.0" encoding="utf-8"?>
 +<getProjectsResult xmlns:r="http://dev.rcware.eu/serialization/references" xmlns:n1="http://dev.rcware.eu/loc" xmlns:n2="http://dev.rcware.eu/scada/notifications" xmlns:n3="http://dev.rcware.eu/scada/schemas" xmlns:n4="http://dev.rcware.eu/projectMetadata" dataVersion="638761649652581521" xmlns="http://dev.rcware.eu/scada/projects">
 +    <projects>
 +        <project id="00000000-3333-0000-0000-000001000001" name="P0001" domain="PP_Domain_0001" tz="Europe/Prague">
 +            <loc>
 +                <n1:gps lat="0" lon="0" />
 +            </loc>
 +            <mdi>
 +                <mi n2:moduleInstantiated="true" r:type="073d1b6c-24f5-435a-a5bd-1d54e04b0d06" r:def="1" />
 +                <mi n3:totalAllowedSchemasCount="1" n3:totalSchemasCount="1" r:type="aa8818ce-d47d-41ff-9be5-3de9f34d7ebf" />
 +            </mdi>
 +        </project>
 +        <project id="03cd3dd9-e170-4799-bc26-17ac0eccf780" name="aaa" domain="DomainTes1" tz="Europe/Prague">
 +            <mdi>
 +                <mi r:ref="1" r:type="073d1b6c-24f5-435a-a5bd-1d54e04b0d06" />
 +                <mi r:type="1fe100d2-2dbe-4737-bb10-7cf2a19123b2">
 +                    <n3:schemas />
 +                    <n3:schemaGroups />
 +                    <n3:slideShow />
 +                </mi>
 +            </mdi>
 +        </project>
 +    </projects>
 +</getProjectsResult>
 +</code>
 ===== Matlab Client ===== ===== Matlab Client =====
 ==== General notes client function parameters ==== ==== General notes client function parameters ====
  • © Energocentrum Plus, s.r.o. 2017 - 2025