Retrieves information about a Tag, given its name and category.
Namespace: Microsoft.Tag.CampaignManagementAssembly: Microsoft.Tag.CampaignManagement (in Microsoft.Tag.CampaignManagement.dll) Version: 1.0.7785.0 (1.0.7785.0)
Syntax
| C# |
|---|
Tag GetTagByTagName( UserCredential userCredential, string categoryName, string tagName ) |
| Visual Basic |
|---|
Function GetTagByTagName ( _ userCredential As UserCredential, _ categoryName As String, _ tagName As String _ ) As Tag |
| Visual C++ |
|---|
Tag^ GetTagByTagName( UserCredential^ userCredential, String^ categoryName, String^ tagName ) |
Parameters
- userCredential
- Type: Microsoft.Tag.CampaignManagement..::..UserCredential
A 64-bit encrypted GUID specifying the user credential.
- categoryName
- Type: System..::..String
The name of the Category containing the Tag to retrieve.
- tagName
- Type: System..::..String
The name of the tag to retrieve.
Return Value
A Tag object containing information about the requested tag.
Remarks
GetTagByTagName lets you obtain the tag's name, status, start date, end date, associated payload, and information specific to the tag type, such as a URL or telephone number.
GetTagByTagName fails when any of the following conditions occur:
- The category is not found.
- The tag name is not found.
Examples
using System; using ConsoleApplication1.Tag; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MIBPContractClient OMIBPClient = new MIBPContractClient(); UserCredential oCredential = new UserCredential { AccessToken = "Enter your access token" }; URITag tag = OMIBPClient.GetTagByTagName(oCredential, "Main", "Some existing URL tag") as URITag; Console.WriteLine(tag.Title); Console.WriteLine(tag.MedFiUrl); } } }