AnsweredAssumed Answered

PI WEB API - How to decode/encode WebId

Question asked by MBanchuzhnyy on Dec 26, 2018
Latest reply on Apr 3, 2019 by Roger Palmen

Hi community!


We have a project where we use web api data access layer which talks to PI/AF directly through af sdk. Now we'd like to switch to Pi Web Api. The only problem is PI Web Api uses WebId to located elements, and our home made web api uses AF Ids (guids). As we know WebId is encoded string that contains AF Id, element path and other metadata. I found this article PI Web API - Using Web ID 2.0 to Optimize your Applications  that shows process of manual encoding/decoding - but the problem is this article seems to contain errors and I was not able to reproduce all steps, so that I still don't know how to encode/decode webids. Ultimately I need to convert AF id to Web id manually.


@OSI developers - can you please share your code that encodes\decodes web id if it's possible, I think it's the best way to have the same encoding/decoding results on both ends.

@Anybody from community -  have you done anything related to the similar problem - if so, please share your experience.


Thank you in advance!