pi_web_api_cs_helper.PIWebAPIClient.GetTagValueLink C# (CSharp) Method

GetTagValueLink() private method

Get the value link for a specific PI tag.
private GetTagValueLink ( string serverWebId, string tagName ) : Task
serverWebId string WebId of the PI Data Archive.
tagName string Name of the PI tag.
return Task
        private async Task<string> GetTagValueLink(string serverWebId, string tagName)
        {
            string url = _baseUrl + "/dataservers/" + serverWebId + "/points?nameFilter=" + HttpUtility.UrlEncode(tagName);
            dynamic result = await GetAsync(url);
            if (result.Items.Count > 0)
            {
                return result.Items[0].Links.Value;
            }
            else
            {
                throw new InvalidOperationException("Tag is not found.");
            }
        }