5 Replies Latest reply on Jun 2, 2015 5:39 AM by Jerome Lefebvre

    Pi Web API - Accessing PIPoint

    alasdairlogan

      I am using PI Web API 2015.

      1. Given the webId of an Attribute, how can I get the PiPoint webId ? The only place I can see the PiPoint webId is in the Attribute links, where it is part of a URL.

      2. I tried using the getByPath service. It works fine for Elements and Attributes, but not for Points.  Any Ideas?

       

      Thanks!

        • Re: Pi Web API - Accessing PIPoint
          dng

          Hi Alasdair,

           

          1. You are right, the PIPoint webId is contained in the Links > Point URL. You can obtain the webId by navigating to the link, or parsing the URL. Before going this route, what would you like to achieve by getting the point webId (since you can access all the information about the PI point by navigating to the URL)?

          2. How did you format your GetByPath query? The syntax for PI Web API 2015 should be the following: https://<your PI Web API server>/piwebapi/points?path=\\yourPIServer\tagName

            • Re: Pi Web API - Accessing PIPoint
              alasdairlogan

              Hi Daphne,

               

              Thanks for the response.

               

              1)   I wanted the PIPoint webid so that I could get the attributes (points/{webid}/attributes) with only one call to the api.

               

              2) That worked. I made the mistake of using the AF path rather than the tag name...

                • Re: Pi Web API - Accessing PIPoint
                  dng

                  Hi Alasdair,


                  From my understanding, given the webId for the AF Attribute using a PI Point Data Reference, you are trying to get all the attributes (e.g. location 1, exception max, etc.) for the PI tag. Is this correct? 

                   

                  If so, after you obtained the AF Attribute, you can get the PIPoint attributes by appending /attributes to the URL provided in Links > Point and make a single call to that URL. Will that work for your application?

                    • Re: Pi Web API - Accessing PIPoint
                      alasdairlogan

                      I see that as 2 calls as I have to call the API first to obtain the AF Attribute and then use the URL in Links > Point and make the second call. It is not a huge deal as can either call twice or cache the point webid in my application and call once...

                        • Re: Pi Web API - Accessing PIPoint
                          Jerome Lefebvre

                          I see what you mean by two calls and I tired to see if it be possible to do it in one. But, that does not seem to be possible. The (piwebapi/points/) does not know anything about attributes that makes use of PI point, so this would not work to make a single call. In the other direction an AF attribute does not seem to expose much of anything of a PI point that it uses. So, two calls are forced on us in this case.