1 of 1 people found this helpful
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.
Thanks again Daphne, switched to Kerberos and made sure the credentials are passed to the web request in my code and all is now good.