browse

| PointWrite  

The Pointwrite API is used to write a value to a particular data point. 

The Pointwrite Operation in the spirit of the Project Haystack pointWrite op, documented here: https://www.project-haystack.org/doc/docHaystack/Ops#pointWrite. It is assumed that users have a working understanding of writable points. See here: https://www.project-haystack.org/doc/lib-phIoT/writable-point.

The 75F pointWrite deviates from the PH spec as follows: HTTP response codes used to indicate the success or failure of pointWrite operations, but not limited to errors only at the HTTP layer.

Duration is not limited to level 8. The state of the priority array returns in the response (as opposed to an empty grid).

| Request

https://api-management-75f-dev.azure-api.net/staging/ph/rw/pointWrite

Request Headers

Parameter Name Required Type Description
Content-Type
 
true   String array
Accept False   Contains the JWT provided by the auth endpoint. The format of the header value is Bearer JWT_TOKEN
Authorization True    
Ocp-Apim-Subscription-Key true   Product-scoped subscription key

 

| Response

ver:"3.0"
duration,level,val,who
0,8,0,"ccu_@236fea0f-d6ba-4372-a53d-9e16c8ba5d5d"
0,9,1,"api_BGS"

| Procedure to Send a Pointwrite API request

Note: Only as a Secondary Manager of a site, one can sample points data or write to points data of the sites. 

 From the Developer portal home page

  • Click the Profile option.

mceclip0.png

The user profile screen displays the user and subscription details.

Under the products subscribed for, locate the subscription key for the relevant product.

For this example, we use the product Staging Readwrite subscription.

  • Click the option shown to view the subscription keys or simply copy the subscription key to be used to generate the Bearer token.

mceclip10.png

  • Click the API's option on the top.

The API's screen displays the list of authorized API's.

For this demo, we use the Haystack Write(Staging).

  • Click the API Haystack (Staging).

mceclip1.png

The Haystack Write (Staging) API screen displays API details.

Note: To start sampling data using this Haystack write (Staging) API, the user needs to generate a bearer token using the API 75Auth {Staging), as shown above, using the information shown in Oauth API

  • Click Try it to access the API.

mceclip3.png

The Try it window, to try the API displays.

  • Select the Primary: Staging Readwrite under the subscription key field.

mceclip2.png

  • Access the site explorer in the Facilisight to locate a point and its value to be changed.

From the site explorer in Facilisight:

  • Locate a point in the site for which you would like to write a point also locate the level at which the value is written.

mceclip1.png

  • Scroll further to locate the Header section.

The header section should have the following headers.

mceclip0.png

  • Enter the write query required for this API in the format specified in the body section.
  • Paste the subscription key copied from the profile screen into the header option Ocp-Apim-Subscription-Key.
  • Paste the bearer token generated into the header option Authorization, with a "Bearer" and followed by the token generated.

 "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyRGF0YSI6eyJ1c2VySWQiOiI0M2JjNGRlZC01YWQxLTRkZTUtOGU1OC1mYTg1YTM4ODRhNzIiLCJlbWFpbElkIjoibWNoYW5kcmFzZWthckA3NWYuaW8iLCJzdHJhdGVneSI6InBhc3MiLCJpc1N1cHBvcnQiOjF9LCJhY2Nlc3NBbGxvd2VkIjp0cnVlLCJyb2xlIjoiYXBwIiwiZ2xvYmFsU2Vzc2lvbklEIjoicm5iTlpiMUZIelI0RXd4eHJuOFNrT3Z6MkFIX19zbVQiLCJhcHBOYW1lIjoiZ2F0ZWtlZXBlcjc1ZiIsImVudiI6InN0YWdpbmciLCJpYXQiOjE2NTE3MzYzMTQsImV4cCI6MTY1MTgyMjcxNCwiaXNzIjoiNzVmIn0.dLZIMK2R6B0JgFjDjkfR3GY1dDEzuiB82Wrvwha8bcaLH4_sUxM4Pe_cWNGES3Jth7xP4ug8_cKe-8lpNezXD-B43KxbXy9t8ng9RXkUfvrPvDAua_xEKaw3eep1MdzGtZCwau2gCJp12zq33JM8oi8RqAd-3u6b6u5DwEO6pz1HlHn1JMKcUkLXAlo61WtTcePmBR1SDky0vWQnh-clHORjKFrpJB2a-jewB7raYBrMOFUNperC-dPZViqX3dC6SdGPSgAOD14e-XfrGHj6a1jSYOh4wtsG89mz5h03VC78QJ7JcPoyqgNVKP30QlmqO0tyCrKhwkzNnS39z-xTNA"

 

With the below request format and the query:

mceclip2.png

mceclip3.png

  • Click Send to write the data change.

This generates a response as follows.

| HTTP Response

HTTP/1.1 200 OK

content-encoding: gzip
content-type: application/JSON
date: Wed, 08 Jun 2022 03:14:09 GMT
transfer-encoding: chunked
vary: origin,access-control-request-method,access-control-request-headers,accept-encoding

{
    "metadata": {
        "ver": "3.0"
    },
    "cols": [{
        "name": "id"
    }, {
        "name": "co2"
    }, {
        "name": "data"
    }, {
        "name": "dis"
    }, {
        "name": "equipRef"
    }, {
        "name": "floorRef"
    }, {
        "name": "his"
    }, {
        "name": "hisInterpolate"
    }, {
        "name": "incrementVal"
    }, {
        "name": "kind"
    }, {
        "name": "maxVal"
    }, {
        "name": "minVal"
    }, {
        "name": "point"
    }, {
        "name": "roomRef"
    }, {
        "name": "siteRef"
    }, {
        "name": "sp"
    }, {
        "name": "threshold"
    }, {
        "name": "tuner"
    }, {
        "name": "tunerGroup"
    }, {
        "name": "tz"
    }, {
        "name": "unit"
    }, {
        "name": "vav"
    }, {
        "name": "writable"
    }, {
        "name": "zone"
    }],
    "rows": [{
        "id": "r:8d0e0629-7d27-40b3-a835-6e3553e33dd3",
        "co2": "m:",
        "data": [{
            "id": "r:8d0e0629-7d27-40b3-a835-6e3553e33dd3",
            "level": "n:8",
            "val": "n:600",
            "duration": "n:0",
            "who": "api_BGS"
        }, {
            "level": "n:17",
            "val": "n:800",
            "duration": "n:0",
            "who": "ccu"
        }],
        "dis": "Product Home-VAV-1000-zoneCO2Threshold",
        "equipRef": "r:cc6de852-d8d6-4f27-9599-53b727f24d01",
        "floorRef": "r:244d7dc0-8021-4108-ac7c-12c9e9d9021d",
        "his": "m:",
        "hisInterpolate": "cov",
        "incrementVal": "n:10",
        "kind": "Number",
        "maxVal": "n:2000",
        "minVal": "n:0",
        "point": "m:",
        "roomRef": "r:e82ce61e-90b9-4d5d-ab99-729da22cd38e",
        "siteRef": "r:f14645d9-7e54-46d1-9e23-3924c83a599a",
        "sp": "m:",
        "threshold": "m:",
        "tuner": "m:",
        "tunerGroup": "VAV",
        "tz": "Colombo",
        "unit": "ppm",
        "vav": "m:",
        "writable": "m:",
        "zone": "m:"
    }]
}

The value is written in the historized data. (Confirmed below from site explorer, value change at the priority array level.

 

mceclip4.png

 

 

Previous
Next

Comments

0 comments

Please sign in to leave a comment.

Was this article helpful?

0 out of 0 found this helpful
Powered by Zendesk