There is more than one URL that will create a tag for you. But this is a stack overflow, here is a short program that uses the Tag API to create any number of tags. For the program to work, you need to:
- add the link to the service in the https://ws.tag.microsoft.com/MIBPService.wsdl tag API
- Be sure to insert your own tag API into creds.AccessToken.
- Increase the value maxArrayLength = "16384" in app.config to something higher. This is necessary to pull ~ 45KB tag images from the web service. I used 100,000.
Full blog post http://flyingpies.wordpress.com/2011/05/25/creating-several-microsoft-tags/ .
using System; using System.IO; using MakeTags.Tag; namespace MakeTags { class Program { static void Main(string[] args) { MIBPContractClient tagService = new MIBPContractClient(); UserCredential creds = new UserCredential(); creds.AccessToken = "your-access-token-here"; int tagsToCreate = 10; string category = "Main"; string tagTitlePrefix = "My Sample Tag "; string tagImageFilePathFormat = "mytag{0}.png"; for (int i = 0; i < tagsToCreate; ++i) { Console.WriteLine("Creating tag " + i); string tagTitle = tagTitlePrefix + i; URITag tag = new URITag(); tag.Title = tagTitle; tag.MedFiUrl = "http://flyingpies.wordpress.com/2011/05/24/creating-several-microsoft-tags"; tag.UTCStartDate = DateTime.UtcNow; tagService.CreateTag(creds, category, tag); string tagImageFilePath = string.Format(tagImageFilePathFormat, i); byte[] tagImageBytes = tagService.GetBarcode( creds, category, tagTitle, ImageTypes.png, 1f, DecorationType.HCCBRP_DECORATION_DOWNLOAD, false); File.WriteAllBytes(tagImageFilePath, tagImageBytes); } } } }
source share