{"id":603,"date":"2013-03-27T19:11:31","date_gmt":"2013-03-27T11:11:31","guid":{"rendered":"http:\/\/passkit.com\/blog\/?p=603"},"modified":"2024-10-15T10:57:02","modified_gmt":"2024-10-15T10:57:02","slug":"the-official-passkit-c-wrapper-class-released","status":"publish","type":"post","link":"https:\/\/passkit.com\/blog\/the-official-passkit-c-wrapper-class-released\/","title":{"rendered":"The Official PassKit C# wrapper class released"},"content":{"rendered":"<h3>Important Note: This article is now superseded<\/h3>\n<p>PassKit released the <a href=\"https:\/\/app.passkit.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">all new PassKit Platform<\/a> in early 2020. This platform incorporates decades of experience designing, developing and implementing world class mobile wallet solutions for some of the biggest international brands. And at the same time, working with small businesses all over the world to help them access the cool capabilities of Apple Wallet and Google Pay passes. We have combined these rich learnings, proven best practices and ever growing knowledge, to deliver you the <a href=\"https:\/\/app.passkit.com\" target=\"_blank\" rel=\"noopener\">very best mobile wallet management platform<\/a>. A platform where you can extend your mobile reach by quickly integrating Apple Wallet and Google Pay Passes into your business. Into your processes. Into your systems. And most importantly into your customer experience.<br \/>\nPassKit now delivers dedicated modules to solve your specific business use cases. No longer do you need to waste time learning about \u2018passes\u2019 language. No longer do you need to study mobile wallet terminology. You now work with Mobile Wallet API\u2019s designed around your business processes; your language. A language you are already familiar with. The latest platform currently covers:<\/p>\n<h4 style=\"text-align: center;\"><a href=\"https:\/\/app.passkit.com\/signup\">TRY THE NEW PASSKIT\u00a0PLATFORM FOR FREE \u2013 UNLIMITED TEST PASSES<\/a><\/h4>\n<p style=\"text-align: center;\"><strong>Click <a href=\"https:\/\/docs.passkit.io\/\" target=\"_blank\" rel=\"noopener\">here<\/a> for\u00a0the latest documentation and details on using Postman with the PassKit API.<\/strong><\/p>\n<p style=\"text-align: center;\">&#8212;<\/p>\n<p>The official PassKit C# wrapper class is now available. This makes it even quicker and easier to access the PassKit API via C#.<br \/>\nFollow the 10 Easy steps to create a new C# Project with PassKit API Wrapper support:<\/p>\n<ol>\n<li>Download &amp; unzip the contents of &#8216;PassKit CSharp API Wrapper v0.2.zip&#8217; into a (new) folder;<\/li>\n<li>Create a new Project in Visual Studio;<\/li>\n<li>Open solution explorer;<\/li>\n<li>Right click &#8216;References&#8217;;<\/li>\n<li>Click &#8216;Add Reference&#8217;;<\/li>\n<li>Click &#8216;Browse&#8217;;<\/li>\n<li>Go to the folder where you unzipped the files in step 1;<\/li>\n<li>Add references to both &#8216;PassKitAPIWrapper.dll&#8217; &amp; &#8216;RestSharp.dll&#8217;;<\/li>\n<li>Make sure you add &#8216;using PassKitAPIWrapper;&#8217; to the top of your CSharp file;<\/li>\n<li>Good to go!;<\/li>\n<\/ol>\n<p>Examples:<br \/>\n<strong><span style=\"text-decoration: underline;\">List templates<\/span><\/strong><\/p>\n<pre>string apiAccount = 'accountname';\nstring apiSecret = 'apisecret';\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.GetTemplates();\n\/\/ Do something with result Dictionary<\/pre>\n<p><strong><span style=\"text-decoration: underline;\">Get passes for template<\/span><\/strong><\/p>\n<pre>string apiAccount = 'accountname';\nstring apiSecret = 'apisecret';\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.GetPasses(\"Lesson package\");\n\/\/ Do something with result Dictionary<\/pre>\n<p><strong><span style=\"text-decoration: underline;\">Update template<\/span><\/strong><\/p>\n<pre>string apiAccount = 'accountname';\nstring apiSecret = 'apisecret';\n\/\/ Create Dictionary with template fields you want to update\nDictionary fields = new Dictionary();\nfields[\"Terms_label\"] = \"Terms &amp; Sausages\";\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.UpdateTemplate(\"Lesson package\", fields);\n\/\/ Do something with result Dictionary<\/pre>\n<p><strong><span style=\"text-decoration: underline;\">Issue pass for template<\/span><\/strong><\/p>\n<pre>string apiAccount = 'accountname';\nstring apiSecret = 'apisecret';\n\/\/ Create Dictionary with pass fields\nDictionary fields = new Dictionary();\nfields[\"Student name\"] = \"Test student\";\nfields[\"Balance\"] = \"10\";\nfields[\"Issue date\"] = \"2013-03-26\";\nfields[\"Expiry date\"] = \"2014-03-26\";\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.IssuePass(\"Lesson package\", fields);\n\/\/ Do something with result Dictionary<\/pre>\n<p><strong><span style=\"text-decoration: underline;\">Get pass details (via template &amp; serial)<\/span><\/strong><\/p>\n<pre>string apiAccount = 'accountname';\nstring apiSecret = 'apisecret';\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.GetPassDetails(\"Lesson package\", \"12345678900000\");\n\/\/ Do something with result Dictionary<\/pre>\n<p><strong><span style=\"text-decoration: underline;\">Get pass details (via unique pass-id)<\/span><\/strong><\/p>\n<pre>string apiAccount = 'accountname';\nstring apiSecret = 'apisecret';\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.GetPassDetails(\"JCecLdsk9mmC\");\n\/\/ Do something with result Dictionary<\/pre>\n<p><strong><span style=\"text-decoration: underline;\">Update pass (via template &amp; serial)<\/span><\/strong><\/p>\n<pre>\/\/ Create Dictionary with pass fields\nDictionary fields = new Dictionary();\nfields[\"Balance\"] = \"5\";\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.UpdatePass(\"Lesson package\", \"12345678900000\", fields);\n\/\/ Do something with result Dictionary<\/pre>\n<p><strong><span style=\"text-decoration: underline;\">Update pass (via unique pass-id)<\/span><\/strong><\/p>\n<pre>\/\/ Create Dictionary with pass fields\nDictionary fields = new Dictionary();\nfields[\"Balance\"] = \"5\";\nPassKit pk = new PassKit(apiAccount, apiSecret);\nPassKitResponse result = pk.UpdatePass(\"JCecLdsk9mmC\", fields);\n\/\/ Do something with result Dictionary<\/pre>\n<p>The C# API Wrapper currently only supports the basic methods. Support for the other API methods will be added on regular basis.<br \/>\nCheck readme.txt in &#8216;PassKit CSharp API Wrapper v0.2.zip&#8217; for a list of supported methods.<br \/>\nFull code repository with example project can be found at our\u00a0<a href=\"https:\/\/code.google.com\/p\/passkit\/source\/browse\/#svn%2Fbranches%2FCSharp-Dev%2FSDK\" target=\"_blank\" rel=\"noopener\">Google\u00a0code-base<\/a>.<br \/>\nWe trust you find this wrapper useful and please leave any feedback or comments below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Important Note: This article is now superseded PassKit released the all new PassKit Platform in early 2020. This platform incorporates decades of experience designing, developing and implementing world class mobile wallet solutions for some of the biggest international brands. And at the same time, working with small businesses all over the world to help them [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":13754,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[57,84,85,275,285,287],"class_list":["post-603","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-apple-passbook","tag-c-sharp","tag-c","tag-passkit-api","tag-passkit-sdk","tag-passkit-wrapper"],"_links":{"self":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts\/603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/comments?post=603"}],"version-history":[{"count":2,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts\/603\/revisions"}],"predecessor-version":[{"id":18324,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/posts\/603\/revisions\/18324"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/media\/13754"}],"wp:attachment":[{"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/media?parent=603"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/categories?post=603"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/passkit.com\/blog\/wp-json\/wp\/v2\/tags?post=603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}