browse

3 Minute Read

| HisWrite Many 

The HisWrite many  API is used to write more than one value at a time to any particular historized data point. 

The hisWriteMany is an operation in the spirit of the Project Haystack hisWrite Op. This operation, however, lets a client write timestamped data for multiple points within the same request.

This API provides operations for writing operational data to writable points as well as historizing data for any point type.

| Request

https://api.75f.io/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

200 OK

Empty Haystack Grid

text/zinc
DEFAULT Copy
ver:"3.0"
empty

 

| Procedure to Execute a Hiswrite Many API requests

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 details, and the details related to the subscriptions subscribed for.

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) API.

  • Click the API Haystack (Staging).

mceclip1.png

The Haystack Write (Staging) API screen displays the 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.

mceclip12.png

The Try it window to try the API, displays.

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

mceclip5.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 value.

mceclip6.png

  • Locate the point values and Timestamps in Query Assist, at which a new value had to be posted.

mceclip9.png

  • Scroll further to locate the Header section.

The header section should have the following headers.

mceclip8.png

  • Enter the write query required for this API in the format specified in the body section, as shown above.
  • 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, in the format shown above, with "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 quern:

mceclip10.png

  • Click Send to post the value change.

The portal generates the response as follows.

| HTTP response

HTTP/1.1 200 OK

content-encoding: gzip
content-type: text/zinc
date: Thu, 05 May 2022 10:43:29 GMT
transfer-encoding: chunked
vary: origin,access-control-request-method,access-control-request-headers,accept-encoding

ver:"3.0"
empty

The values posted in the historized data. (Confirmed below from the Query Assist)

mceclip11.png

You can see above; The changed values 71.5 and 72 for the API call.

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