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-management-75f-dev.azure-api.net/staging/ph/rw/pointWrite
Request Headers
Parameter Name | Required | Type | Description |
Content-Type
true
|
true | String array | |
Accept | False | Contains the JWT provided by the auth endpoint. 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
ver:"3.0" empty
Procedure to Execute a Hiswrite Many API request
Note: You can only sample points data or write to points data of the sites, to which you been added as secondary facility Manager, and you have access to the site via the Facilisight.
From the Developer portal home page
- Click the Profile option.
The user profile screen is displayed with 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 are trying 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.
- Click the API's option on the top.
The API's screen is displayed with the list of API's the user is authorized to use.
For this demo we will be using the Haystack Write(Staging) API.
- Click the API Haystack (Staging).
The Haystack Write (Staging) API screen is displayed with the details about the API.
Note: In order to start sampling data using this Haystack write (Staging) API, the user needs to generate a bearer token using the API 75Auth {Staging) as show above using the information shown in Oauth API
- Click Try it to access the API.
The Try it window to try the API is displayed.
- Select the Primary: Staging Readwrite under the subscription key field.
- 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.
The point is used in the Query Assist to locate the Historized points, and confirming on the values and timestamps at which a new value had to be posted.
- Scroll further to locate the Header section.
The header section should have the following headers.
- Enter the write query required for this API in the format 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 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 query on:
- Click Send to post the value change.
The response is generated as follows and the values are posted in the historized data.
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
Below is a confirmation that the values are changed post the API call.
You can see above, the values are changed to 71.5 and 72 as per the API call.
Comments
0 comments
Please sign in to leave a comment.