an example url to update a pi tag value using pi web api.

I can get the current pi tag value using:

https://myServer/PIwebapi/streams/F1DPWSsCzW3Cw0md_RkC0NqizgnYABAARVJJMzFPUEkyMDAxXENWRC43NTBCLlIxLlJVTklERlJPTUJBVENILlBW/value?selectedFields=Timestamp;Value

{ "Timestamp": "2023-10-06T17:16:00Z", "Value": "750B" }

What would be the structure of the url to update the value to say "888"?

I tried

POST https://myServer/PIwebapi/streams/F1DPWSsCzW3Cw0md_RkC0NqizgnYABAARVJJMzFPUEkyMDAxXENWRC43NTBCLlIxLlJVTklERlJPTUJBVENILlBW/updatevalue?Value=888

POST https//myServer/PIwebapi/streams/F1DPWSsCzW3Cw0md_RkC0NqizgnYABAARVJJMzFPUEkyMDAxXENWRC43NTBCLlIxLlJVTklERlJPTUJBVENILlBW/Value/888

I tried many variations with and without the leading POST/

Any suggestions or help would be greatly appreciated.

Thank you.

Parents
  • Hi ​,

    To update values via PI WebAPI, you will need to send the POST request with a body. This is easier via web client tools such as Postman or ThunderClient than via browser.

    The request URL will be just ending with value.

    Request Method and URL

    POST https//myServer/PIwebapi/streams/F1DPWSsCzW3Cw0md_RkC0NqizgnYABAARVJJMzFPUEkyMDAxXENWRC43NTBCLlIxLlJVTklERlJPTUJBVENILlBW/Value

     

    Body (or only include value to insert value at the current time)

    { "Timestamp": "2023-10-06THH:MM:SSZ", "Value": 888 }

Reply
  • Hi ​,

    To update values via PI WebAPI, you will need to send the POST request with a body. This is easier via web client tools such as Postman or ThunderClient than via browser.

    The request URL will be just ending with value.

    Request Method and URL

    POST https//myServer/PIwebapi/streams/F1DPWSsCzW3Cw0md_RkC0NqizgnYABAARVJJMzFPUEkyMDAxXENWRC43NTBCLlIxLlJVTklERlJPTUJBVENILlBW/Value

     

    Body (or only include value to insert value at the current time)

    { "Timestamp": "2023-10-06THH:MM:SSZ", "Value": 888 }

Children
No Data