Merhaba Microsoft Tag Severler,
Önceki yazımda Microsoft Tag Manager’daki değişiklikleri ve oluşturulan Tag’leri Download yaparken kullanılan arayüzdeki değişikliklerden bahsettim. Bu yazımda Tag Web Service’indeki değişikliklerden ve oluşturduğumuz bir Tag’i nasıl QR olarak render edebiliriz onu göreceğiz.
Microsoft Tag Web Service (15.01.2012) Güncel Hali
MIBPContractClient Methodları
- Category
- ActivateCategory
- CreateCategory
- PauseCategory
- UpdateCategory
- Tag
- ActivateTag
- CreateTag
- DeleteTag
- PauseTag
- UpdateTag
- Get
- GetBarcode
- GetDirectUrl
- GetNfcUrl
- GetQRCode
- GetQRUrl
- GetTagByTagName
- GetTagId
GetQRCode ile QR Render Etme
Burada öncelikli olarak bir UriTag oluşturuyorum fakat istediğiniz türde Tag oluşturabilirsiniz çalışmasında herhangi bir problem olmayacaktır. Daha sonra GetQRCode ile bu oluşturduğum Tag’i QR Code olarak Render edeceğim. Örnekleri ASP.NET MVC 3 ile geliştirdiğimi belirtmek istiyorum.
public ActionResult GetImage(string url) { MIBPContractClient OMIBPClient = new MIBPContractClient(); UserCredential oCredential = new UserCredential(); oCredential.AccessToken = "your tag creation api"; URITag uriTag = new URITag(); string tagName = String.Format("UriTag_{0}",Guid.NewGuid()); uriTag.Title = tagName; uriTag.MedFiUrl = url; uriTag.UTCStartDate = DateTime.Now; OMIBPClient.CreateTag(oCredential, "Test", uriTag); byte[] oBarcode = OMIBPClient.GetQRCode( oCredential, "Test", tagName, ImageTypes.png, 2f, false); return File(oBarcode,"image/png"); }
GetQRUrl ile Herhangi Bir URL Tag’in URL Bilgisini Alma
public ActionResult GetQRUrl() { MIBPContractClient OMIBPClient = new MIBPContractClient(); UserCredential oCredential = new UserCredential(); oCredential.AccessToken = "your tag creation api"; string url = OMIBPClient.GetQRUrl(oCredential, "Main", "T9a5001ac-c7a6-4186-aa25-9766491ad6ac"); ViewBag.QRUrl = url; //Sonuç: http://tagr.com/t/V3dVzP return View("Index"); }
GetNfcUrl ile Herhangi Bir URL Tag’in URL Bilgisini Alma
public ActionResult GetNfcUrl() { MIBPContractClient OMIBPClient = new MIBPContractClient(); UserCredential oCredential = new UserCredential(); oCredential.AccessToken = "your tag creation api"; string url = OMIBPClient.GetNfcUrl(oCredential, "Main", "T9a5001ac-c7a6-4186-aa25-9766491ad6ac"); ViewBag.NfcUrl = url; //Sonuç: http://tagr.com/t/V3dWBv return View("Index"); }
Sonuç
Microsoft Tag Web Service’i her geçen gün gelişiyor ve değişiyor. Bu yüzden devamlı http://tag.microsoft.com/developer/api.aspx#a1 adresini kontrol edip neler olup neler bitmiş bakmanızı tavsiye ediyorum.
Umarım faydalı bir yazı olmuştur. Microsoft Tag ile ilgili her türlü sorunuzu aşağıdaki formu doldurarak ya da mcs[ at ].mcansozeri.com adresine mail atarak sorabilirsiniz.
Microsoft Tag ile kalın,