Hi,
I'm using the Web API to create lab points as they arrive in our lims. This is working fine even though not all attributes may be set in the same API call.
Now I like to change some attributes (limits etc) after the point is created. However, I can't use the 'search" controller as it seems to only query the crawled data (https://myserver/search/query?q=mytag) so can't get back the WebId, which I need to issue an UpdateAttributeValue. If I wait a while until the next crawl cycle has finished I can get the WebID but that doesn't seem like a solution.
The question is, how to get the newly created point's WebId shortly after it is created?
Is there any way to bypass the index or use any other means of search?
Thanks!
Hi Ove,
The PI Web API conveniently returns the location of the point after creating it in the responses header. So if you unwrap the 201 response you'll see the below (I've redacted out part of the WebId and the Authentication) and one of the accessible parameters is the URL for accessing the point you just created.
HTTP/1.1 201 Created
Content-Length: 0
Location: https://hostnmame/piwebapi/points/F1DP...
Server: Microsoft-HTTPAPI/2.0
X-Frame-Options: SAMEORIGIN
WWW-Authenticate: [REDACTED]
Date: Tue, 09 Jul 2019 19:31:32 GMT
Cheers,
Rob