Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Programmatically access Web Data.

ReferenceCodeExtensions API Connector | WebAccess API Reference


We provide an API via Web-Service that can read and write tag values. To access the tags, a login is required for solution users. You can directly access this API through HTTP (REST API) connecting with a runtime system. 

This page presents information about how to use the WebAccess REST API.

Table of Contents
maxLevel3
stylenone


Contract Methods Using Rest API

SetServer

Defines the Server for following requests. 

Method: GET

URL Example:  http://localhost:3101/rtServices/api/SetServer

Code Block
titleRequest
Request/Headers
     . Content-Type: application/json
   . Request/Body
     . { "ModuleName": "Test", "UserName": "guest", "Password": "" }


Code Block
titleResponse
Response/Headers
     . Access-Control-Allow-Origin: *
     . Access-Control-Allow-Headers: Content-Type, Content-Length, Authorization
     . Access-Control-Expose-Headers: Content-Type, Content-Length, Authorization
     . Access-Control-Allow-Methods: *
     . Content-Length: 0
     . Content-Type: application/octet-stream
     . Access-Control-Max-Age: 1728000
     . Authorization: Bearer c30730a4-e2ee-4595-9131-d64769c5afbe
     . Date: Tue, 28 Nov 2023 13:47:35 GMT
     . Server: TServer WebServer
   . Response/Headers
     . Nothing

ReadObject

Reads value from specified object.

Method: GET

URL Example: http://localhost:3101/rtServices/api/SyncObjects/ReadObject

Code Block
titleRequest
Request/Headers
     . Content-Type: application/json
     . Authorization: Bearer c30730a4-e2ee-4595-9131-d64769c5afbe
     . content-length: 25
   . Ex: .../api/SyncObjects/ReadObject?ObjectName=Tag1


Code Block
titleResponse
Response/Headers
     . Content-Length: 89
     . Content-Type: application/json
     . Content-Encoding: utf8
     . Date: Tue, 28 Nov 2023 13:56:03 GMT
     . Server: TServer WebServer
   . Response/Body
     . { "ObjectName":"Tag1","Value":11,"Quality":192,"UtcTimeStamp":"11/28/2023 1:49:28.000 PM" }

ReadObjects

Reads value from multiple specified objects.

Method: GET

URL Example: http://localhost:3101/rtServices/api/SyncObjects/ReadObjects

Code Block
titleRequest
Request/Headers
     . Content-Type: application/json
     . Authorization: Bearer c30730a4-e2ee-4595-9131-d64769c5afbe
     . content-length: 25
   . Request/Body
     . { "ObjectNames": [ "Tag1", "Server.Now" ] }


Code Block
titleResponse
Response/Headers
     . Content-Length: 89
     . Content-Type: application/json
     . Content-Encoding: utf8
     . Date: Tue, 28 Nov 2023 13:56:03 GMT
     . Server: TServer WebServer
   . Response/Body
     . [ {"ObjectName":"Tag1","Value":11,"Quality":192,"UtcTimeStamp":"11/28/2023 10:47:50.581 AM"},{"ObjectName":"Server.Now","Value":"11/28/2023 1:48:26.003 PM"} ]

WriteObject

Write value to a specified object. You can only write values to objects that have their Visibility property set to Public.

Method: POST

URL Example:http://localhost:3101/rtServices/api/SyncObjects/WriteObject

Code Block
titleRequest
Request/Headers
     . Content-Type: application/json
     . Authorization: Bearer c30730a4-e2ee-4595-9131-d64769c5afbe
     . content-length: 25
   . Request/Body
     . { "ObjectName" : "Tag1", "Value" : 11, "Quality": 192, "UtcTimestamp": "2023-11-28T10:18:22.260Z" }


Code Block
titleResponse
Response/Headers
     . Content-Length: 89
     . Content-Type: application/json
     . Content-Encoding: utf8
     . Date: Tue, 28 Nov 2023 13:56:03 GMT
     . Server: TServer WebServer
   . Response/Body
     . true

WriteObjects

Write value to specified objects. You can only write values to objects that have their Visibility property set to Public.

Method: POST

URL Example:http://localhost:3101/rtServices/api/SyncObjects/WriteObjects

Code Block
titleRequest
Request/Headers
     . Content-Type: application/json
     . Authorization: Bearer c30730a4-e2ee-4595-9131-d64769c5afbe
     . content-length: 25
   . Request/Body
     . { "ObjectList": [ {"ObjectName": "Tag1", "Value": 11 }, { "ObjectName": "Tag2", "Value": 2, "Quality": 192, "UtcTimeStamp": "2023-11-28T10:18:22.260Z" } ] }


Code Block
titleResponse
Response/Headers
. Content-Length: 89
. Content-Type: application/json
. Content-Encoding: utf8
. Date: Tue, 28 Nov 2023 13:56:03 GMT
. Server: TServer WebServer
. Response/Body
. [true,true]




In this section...

Page Tree
root@parent