| Both sides previous revision
Previous revision
|
|
en:mervis-scada:50-api [2026/07/17 11:45] z.moustis |
en:mervis-scada:50-api [2026/07/17 12:41] (current) z.moustis |
| ===== Supported API Methods ===== | ===== Supported API Methods ===== |
| |
| Below is the consolidated list of recommended, fully-documented API endpoints. | Below is the consolidated list of recommended API endpoints. Note: Only methods with fully documented and verified examples are listed below. |
| |
| ^ Function ^ Description | | ^ Function ^ Description | |
| | ''api/replace/history'' | Completely replaces existing historical data within a specified time range. | | | ''api/replace/history'' | Completely replaces existing historical data within a specified time range. | |
| |
| **Note on Credentials:** To test these calls in Postman, you can use the credentials `n: demo` and `p: demo`. However, for production applications, it is highly recommended to exchange these credentials for a token using `api/v2/get/authenticate` and use the resulting token (`t: [token_string]`) in subsequent calls for better performance. | **Note on Credentials:** You can test these API calls using the credentials `n: demo` and `p: demo`. For production applications, it is required to exchange these credentials for a token using `api/v2/get/authenticate` and use the resulting token (`t: [token_string]`) in subsequent calls to ensure optimal performance. |
| |
| ===== Authentication ===== | ===== Authentication ===== |
| "Login": "demo", | "Login": "demo", |
| "NotifyNearingPwdExpirationIn": null, | "NotifyNearingPwdExpirationIn": null, |
| "Token": "3:93d3c832-0f1b-4cde-a0eb-1fd346f5a9c0", | "Token": "3:b83d56f8-2e25-4745-a4e5-1a259c286c5f", |
| "TokenValidFor": "P1D", | "TokenValidFor": "P1D", |
| "User": "48141739-5d16-4ca3-8ae1-33e27d9eb22e", | "User": "48141739-5d16-4ca3-8ae1-33e27d9eb22e", |
| |
| ==== api/get/values ==== | ==== api/get/values ==== |
| The right way to retrieve current values of data points (property "Output") from one or multiple projects. | Retrieves current values of data points (property "Output") from one or multiple projects. |
| |
| **Request:** | **Request:** |
| "serverState": null, | "serverState": null, |
| "dps": [{ | "dps": [{ |
| "projId": "ba1a92f7-f213-4a72-90e4-f7142b50274b", | "projId": "5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0", |
| "dpIds": ["e089dde2-a097-4e0d-8012-c8cf3dc62694", "1089dde2-a097-4e0d-8012-c8cf3dc62696"] | "dpIds": ["62cf4083-31ed-4bc1-be25-044ba837a9f0"] |
| }] | }] |
| } | } |
| <code xml> | <code xml> |
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> |
| <values xmlns:r="http://dev.rcware.eu/serialization/references" nextOffset="-1" serverTime="2020-04-07T07:46:34.850422Z" xmlns:n1="http://dev.rcware.eu/scada/basic-props" xmlns="http://dev.rcware.eu/scada/datapoints"> | <values xmlns:r="http://dev.rcware.eu/serialization/references" nextOffset="-1" serverTime="2026-07-17T10:29:17Z" xmlns:n1="http://dev.rcware.eu/scada/basic-props" xmlns="http://dev.rcware.eu/scada/datapoints"> |
| <vals> | <vals> |
| <v projId="ba1a92f7-f213-4a72-90e4-f7142b50274b" dataVersion="637217783110000000" serverTime="2020-04-07T07:46:34.850422Z"> | <v projId="5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0" serverTime="2026-07-17T10:29:17Z"> |
| <dps> | <dps> |
| <d id="e089dde2-a097-4e0d-8012-c8cf3dc62694" serAlr="true"> | <d id="62cf4083-31ed-4bc1-be25-044ba837a9f0" serAlr="true"> |
| <props> | <props> |
| <p n="Output" t="2020-04-07T07:43:42.1000676Z" q="Bad" r:type="177e726a-3180-4152-bef2-6254e7055e1f"> | <p n="Output" t="2026-07-17T10:29:17Z" q="Good" r:type="b133774d-21ce-42b6-add3-57c012079c55"> |
| <n1:v>ON</n1:v> | <n1:v>13851.42</n1:v> |
| </p> | </p> |
| </props> | </props> |
| "request": { | "request": { |
| "commonSeriesParameters": { | "commonSeriesParameters": { |
| "from": "2018-12-01T00:00:00Z", | "from": "2026-06-20T00:00:00Z", |
| "to": "2018-12-01T10:00:00Z" | "to": "2026-07-17T00:00:00Z" |
| }, | }, |
| "series": [ | "series": [ |
| { | { |
| "clientReference": "myId1a", | "clientReference": "test1", |
| "provider": { | "provider": { |
| "parameters": { | "parameters": { |
| * **gt** - goodthrough (end of validity period) | * **gt** - goodthrough (end of validity period) |
| * **meta.interval** - expected interval between stored records. Useful to identify missing data. | * **meta.interval** - expected interval between stored records. Useful to identify missing data. |
| | |
| | <code javascript> |
| | { |
| | "result": { "code": 0, "subCode": 0, "message": "" }, |
| | "data": { |
| | "count": 1, |
| | "historyData": [ |
| | { |
| | "clientReference": "test1", |
| | "provider": { |
| | "id": "689e32fa-24a2-448e-9374-6158e6e6cb15", |
| | "parameters": { |
| | "projectId": "5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0", |
| | "dataPointId": "62cf4083-31ed-4bc1-be25-044ba837a9f0" |
| | } |
| | }, |
| | "meta": { "type": "double", "unit": "h", "interval": "PT3M" }, |
| | "values": [ |
| | { "v": 13851.4, "ts": "2026-06-25T12:00:00.000Z" } |
| | ] |
| | } |
| | ] |
| | }, |
| | "segmentation": { "requestState": "", "serverState": "" } |
| | } |
| | </code> |
| |
| ==== api/get/history/specific ==== | ==== api/get/history/specific ==== |
| "p": "demo" | "p": "demo" |
| }, | }, |
| "projId": "b4d96a6d-2b3d-48eb-af30-d11e875ba7ed", | "projId": "5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0", |
| "offset": 0, | "offset": 0, |
| "count": 1000, | "count": 1000, |
| "dataSpec": 2, | "dataSpec": 2, |
| "refTime": "\/Date(1692788459000)\/", | "refTime": "\/Date(1692788459000)\/", |
| "dpIds": ["58426e69-46ba-4925-9a5c-d7d65efb9886"] | "dpIds": ["62cf4083-31ed-4bc1-be25-044ba837a9f0"] |
| } | } |
| </code> | </code> |
| "count": 250 | "count": 250 |
| } | } |
| | </code> |
| | |
| | **Response:** |
| | <code xml> |
| | <?xml version="1.0" encoding="utf-8"?> |
| | <getProjectsResult xmlns:r="http://dev.rcware.eu/serialization/references" xmlns="http://dev.rcware.eu/scada/projects"> |
| | <projects> |
| | <project id="2a7f1615-..." name="Weather" /> |
| | <project id="1b2623be-eaa4-4e29-8596-c66dd85d5643" name="SIMPLE_DEMO" /> |
| | <project id="5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0" name="PLYNOVA_KOTELNA" /> |
| | <project id="b9ad5380-..." name="CVUT_HERBERTOV" /> |
| | <project id="843855a2-..." name="PRVNI_KROKY" /> |
| | </projects> |
| | </getProjectsResult> |
| </code> | </code> |
| |