AnsweredAssumed Answered

PI Web API Create Tags

Question asked by halla on May 15, 2018
Latest reply on May 15, 2018 by tramachandran



I'm trying to create PI tags based off of another PI Server using the PI Web API 2017 R2.

The basic syntax from the help documentation seems to work fine:

HTTP POST: https://{server}/piwebapi/dataservers/{PiServerWebId}/points


  "Name": "TEST_TAG",
  "Descriptor": "12 Hour Sine Wave",
  "PointClass": "classic",
  "PointType": "Float32",
  "EngineeringUnits": "",
  "Step": false,
  "Future": false


Response: Success!


However, I need to update many of the PI Tag's attributes (as to properly configure interface parameters).

So I try something like this:

HTTP POST: https://{server}/piwebapi/dataservers/{PiServerWebId}/points


        "Name": "TEST_TAG2",
        "exdesc": "info",
        "future": "0",
        "pointsource": "INT1",
        "PointType": "Float64",
        "PointClass": "classic",
        "sourcetag": "",
        "archiving": "1",
        "compressing": "0",
        "compdevpercent": "0",
        "excdevpercent": "0",
        "scan": "1",
        "shutdown": "1",
        "span": "100",
        "step": "1",
        "typicalvalue": "50",
        "zero": "0",
        "datasecurity": "piadmin: A(r,w) | piadmins: A(r,w)",
        "ptsecurity": "piadmin: A(r,w) | piadmins: A(r,w)",
        "convers": "1",
        "filtercode": "0",
        "instrumenttag": "R.Data Engine 1.Injector Press",
        "location1": "501",
        "location2": "0",
        "location3": "7",
        "location4": "1",
        "location5": "4"

Response: (attributes 'not allowed')

    "Errors": [
        "Properties [exdesc, future, pointsource, sourcetag, archiving, compressing, compdevpercent, excdevpercent, scan, shutdown, span, step, typicalvalue, zero, datasecurity, ptsecurity, convers, filtercode, instrumenttag, location1, location2, location3, location4, location5] are not allowed."


Something else I noticed is that the syntax is different from when you get attributes from a PI Tag (with a GET request) VS attribute naming for creating a PI Tag. (Case seems to matter!)


For instance:

GET PI Tag Attribute Name | POST Create PI Tag Attribute Name

ptclassname | PointClass

pointtype | PointType

future | Future

step | Step



Is there a table of allowable attributes and their syntax somewhere?

I've looked around and can't seem to find one.

Also, is it possible to create Tags with the PI Web API while defining all attributes?