Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:mervis-scada:50-api [2020/04/07 09:36] m.chlupac [Example] |
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/ | ||
^api/ | ^api/ | ||
^api/ | ^api/ | ||
Line 15: | Line 16: | ||
^api/ | ^api/ | ||
^api/ | ^api/ | ||
+ | ^api/ | ||
^api/ | ^api/ | ||
^api/ | ^api/ | ||
Line 34: | Line 36: | ||
===== Examples ===== | ===== Examples ===== | ||
- | ====api/checkCredentials==== | + | ====api/v2/ |
**Request** | **Request** | ||
- | * URL: /api/checkCredentials?format=xml | + | * URL: /api/v2/ |
* Method: POST | * Method: POST | ||
+ | |||
+ | <code javascript> | ||
+ | {" | ||
+ | </ | ||
+ | |||
+ | or with the full name (with the domain and login name) | ||
+ | |||
+ | <code javascript> | ||
+ | {" | ||
+ | </ | ||
+ | |||
+ | **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: " | ||
+ | * 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' | ||
+ | * 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: " | ||
+ | |||
+ | |||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }</ | ||
+ | ====[Deprecated] api/ | ||
+ | |||
+ | This is deprecated API method. Use api/ | ||
**Request** | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | |||
<code javascript> | <code javascript> | ||
{" | {" | ||
+ | </ | ||
+ | |||
+ | or with the full name (with an escaped backslash between the domain and login name) | ||
+ | |||
+ | <code javascript> | ||
+ | {" | ||
</ | </ | ||
Line 56: | Line 113: | ||
* You **should** use the received token **t** in subsequent API calls. | * You **should** use the received token **t** in subsequent API calls. | ||
- | ====api/ | + | |
+ | |||
+ | ==== api/ | ||
+ | |||
+ | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | * Downloading of one or multiple trends with single API call | ||
+ | * You should always use " | ||
+ | * " | ||
+ | * " | ||
+ | * Items: " | ||
+ | |||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **Response** | ||
+ | |||
+ | * Empty " | ||
+ | * " | ||
+ | * Values | ||
+ | * v - value | ||
+ | * ts - timestamp - start of the value validity period | ||
+ | * gt - goodthrough - end of the value validity period | ||
+ | * i - interval, only present if it differs from the interval in Meta section | ||
+ | * Meta | ||
+ | * type - value type - double, string, datetime | ||
+ | * unit - unit | ||
+ | * interval - expected interval between the stored records. Useful to identify missing data. | ||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | **Demo** | ||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== api/ | ||
+ | |||
+ | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | * You should always use token (" | ||
+ | * " | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * " | ||
+ | |||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **Response** | ||
+ | |||
+ | * Values | ||
+ | * v - value | ||
+ | * ts - timestamp - start of the value validity period | ||
+ | * gt - goodthrough - end of the value validity period | ||
+ | * i - interval | ||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== [Deprecated] | ||
**Request** | **Request** | ||
Line 146: | Line 543: | ||
* URL: / | * URL: / | ||
* Method: POST | * Method: POST | ||
+ | * Content-Type: | ||
Attribute **i** sets **interval** ([[https:// | Attribute **i** sets **interval** ([[https:// | ||
Line 176: | Line 574: | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | **Response** | ||
+ | |||
+ | * 200 OK | ||
+ | |||
+ | ====api/ | ||
+ | |||
+ | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | * Content-Type: | ||
+ | |||
+ | Attribute **i** sets **interval** ([[https:// | ||
+ | |||
+ | Even though there could be used name and password in **cred** - you should always use **token** to get the best performance. | ||
+ | |||
+ | All date and time values are supposed to be in UTC. | ||
+ | |||
+ | <code xml> | ||
+ | <?xml version=" | ||
+ | < | ||
+ | xmlns: | ||
+ | xmlns: | ||
+ | projId=" | ||
+ | dpId=" | ||
+ | from=" | ||
+ | to=" | ||
+ | <n2:cred t=" | ||
+ | < | ||
+ | <hv ts=" | ||
+ | < | ||
+ | </hv> | ||
+ | <hv ts=" | ||
+ | < | ||
+ | </hv> | ||
+ | <hv ts=" | ||
+ | < | ||
+ | </hv> | ||
+ | <hv ts=" | ||
+ | < | ||
+ | </hv> | ||
+ | </ | ||
+ | </ | ||
**Response** | **Response** | ||
Line 187: | Line 629: | ||
* URL: / | * URL: / | ||
* Method: POST | * Method: POST | ||
+ | * Content-Type: | ||
<code xml> | <code xml> | ||
Line 213: | Line 656: | ||
< | < | ||
+ | ====api/ | ||
+ | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | * Content-Type: | ||
+ | |||
+ | <code xml> | ||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | <values projId=" | ||
+ | <dps> | ||
+ | <d id=" | ||
+ | < | ||
+ | <p n=" | ||
+ | < | ||
+ | </p> | ||
+ | </ | ||
+ | </d> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | **Response** | ||
+ | |||
+ | <code xml><? | ||
+ | < | ||
+ | |||
+ | ====api/ | ||
+ | |||
+ | The right way how to retrieve current values of data points (property " | ||
+ | |||
+ | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | **Response** | ||
+ | |||
+ | <code xml><? | ||
+ | <values xmlns: | ||
+ | < | ||
+ | <v projId=" | ||
+ | < | ||
+ | <d id=" | ||
+ | < | ||
+ | <p n=" | ||
+ | < | ||
+ | </p> | ||
+ | </ | ||
+ | </d> | ||
+ | <d id=" | ||
+ | < | ||
+ | <p n=" | ||
+ | < | ||
+ | </p> | ||
+ | </ | ||
+ | </d> | ||
+ | </ | ||
+ | </v> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====api/ | ||
+ | |||
+ | To get the list of datapoints. | ||
+ | |||
+ | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **Response** | ||
+ | |||
+ | <code xml><? | ||
+ | < | ||
+ | < | ||
+ | <dp id=" | ||
+ | < | ||
+ | < | ||
+ | <p n=" | ||
+ | <n1:r n2: | ||
+ | < | ||
+ | </ | ||
+ | <n1:w r: | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | <p n=" | ||
+ | < | ||
+ | </ | ||
+ | <p n=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <n3:p r: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | </dp> | ||
+ | <dp id=" | ||
+ | < | ||
+ | < | ||
+ | <p n=" | ||
+ | <n1:r n2: | ||
+ | < | ||
+ | </ | ||
+ | <n1:w r: | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | <p n=" | ||
+ | < | ||
+ | </ | ||
+ | <p n=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <n3:p r: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <def enabled=" | ||
+ | < | ||
+ | <status user=" | ||
+ | </ | ||
+ | </dp> | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====api/ | ||
+ | |||
+ | To get the list of projects. | ||
+ | |||
+ | **Request** | ||
+ | |||
+ | * URL: / | ||
+ | * Method: POST | ||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **Response** | ||
+ | |||
+ | <code xml><? | ||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | <project id=" | ||
+ | <loc> | ||
+ | <n1:gps lat=" | ||
+ | </ | ||
+ | <mdi> | ||
+ | <mi n2: | ||
+ | <mi n3: | ||
+ | </ | ||
+ | </ | ||
+ | <project id=" | ||
+ | <mdi> | ||
+ | <mi r: | ||
+ | <mi r: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </mi> | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
===== Matlab Client ===== | ===== Matlab Client ===== | ||
==== General notes client function parameters ==== | ==== General notes client function parameters ==== |