2 Replies Latest reply on May 11, 2015 5:14 PM by MikeRay

    Write To Attribute Returns "403 Forbidden"

    MikeRay

      Hi There,

       

      I am trying to use the PI Web API to write data to an attribute in my application. I am able to search for and write to tags on their own by doing a post to a 'streams' URL but when I do the same thing for an attribute I am getting a "403 Forbidden" result. I presume this is a security problem, but I am not sure how to change / manage security settings on attributes? What specifically causes this error?

       

      Thanks,

       

      Mike.

        • Re: Write To Attribute Returns "403 Forbidden"
          dng

          Hi Michael,

           

          You are right: you are probably experiencing a security issue. Specifically, you might not have write access to the AF Element that the attribute belongs to. To check the security of the element, you can use PSE, right-click on the element, and check for the security. Before you do that, make sure to determine what user PI Web API is connecting to the AF Server with.

           

          First, check for the authentication method at https://<your web api server>/piwebapi/system/configuration. If it is Kerberos or Basic, you are likely to be connected to the AF server with your credential (or the credential you used to write data). If it is anonymous ,you are using the PI Web API service account to connect to AF. To further confirm, you can check the user name at https://<your web api server>/piwebapi/system/userinfo.

           

          After you obtain the information, check the AF security to make sure the account/user has write access to the element. If not, add write access to the element for the user and try writing again.

          1 of 1 people found this helpful