{"id":16,"date":"2014-12-22T07:27:30","date_gmt":"2014-12-22T13:27:30","guid":{"rendered":"http:\/\/www.teamdesk.net\/blog\/2014\/12\/teamdesk-rest-api\/"},"modified":"2014-12-22T07:27:30","modified_gmt":"2014-12-22T13:27:30","slug":"teamdesk-rest-api","status":"publish","type":"post","link":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/","title":{"rendered":"TeamDesk REST API"},"content":{"rendered":"<p>Today, we\u2019ve released REST API for <a href=\"http:\/\/www.teamdesk.net\">TeamDesk<\/a>. REST API was designed from the ground up to address SOAP API shortcomings, simplify programming and enable integration with other REST-enabled services.<\/p>\n<p>Web landscape has changed since we released SOAP API for TeamDesk back in 2006. Now, many web sites make heavy use of <a href=\"http:\/\/en.wikipedia.org\/wiki\/REST\">REST<\/a> and <a href=\"http:\/\/en.wikipedia.org\/wiki\/JSON\">JSON<\/a>. <a href=\"http:\/\/en.wikipedia.org\/wiki\/Type_system#Dynamic_typing\">Dynamically typed languages<\/a> rule the web and JSON, being simple to parse and produce, is an ideal data exchange protocol for them. Moreover, strongly typed languages such as C++ also have libraries to deal with the data in JSON format.<\/p>\n<p>So, while designing next version of the API our goals were:<\/p>\n<ul>\n<li>Make JSON first-class output format.<\/li>\n<li>Build an API based solely on HTTP protocol semantics.<\/li>\n<li>Pass credentials together with request to avoid separate login calls.<\/li>\n<li>Allow cross-origin resource sharing (<a href=\"http:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing\">CORS<\/a>).<\/li>\n<li>Make calls require only couple lines of code.<\/li>\n<li>Address certain design shortcomings of SOAP API<\/li>\n<\/ul>\n<p>Is it hard to use new API? Let\u2019s have a short demo.<\/p>\n<p>Using jQuery? Easy! Create authorization token in application\u2019s setup section, set authtoken variable and let jQuery handle the rest.<\/p>\n<pre><code>var authtoken = \"0123456789ABCDEF0123456789ABCDEF\";\n$.getJSON(\n\"https:\/\/www.teamdesk.net\/secure\/api\/v2\/21995\/\" + authtoken +\n\"\/Test\/Default%20View\/select.json\",\nfunction(data) {\n\/* here we have data *\/\n}\n);\n<\/code><\/pre>\n<p>In PHP? Still easy!<\/p>\n<pre><code>$authtoken = \"0123456789ABCDEF0123456789ABCDEF\";\n$data = json_decode(\nfile_get_contents(\n\"https:\/\/www.teamdesk.net\/secure\/api\/v2\/21995\/\" . $authtoken .\n\"\/Test\/Default%20View\/select.json\"\n));\n<\/code><\/pre>\n<p>In C#?<\/p>\n<pre><code>string authtoken = \"0123456789ABCDEF0123456789ABCDEF\";\nobject data = new JavaScriptSerializer().DeserializeObject(\nnew WebClient().DownloadString(\n\"https:\/\/www.teamdesk.net\/secure\/api\/v2\/21995\/\" + authtoken +\n\"\/Test\/Default%20View\/select.json\"\n));\n<\/code><\/pre>\n<p>Please note that simplicity does not mean efficiency. Samples above are dead simple but in order to make API operations more effective you may want to enable compression and caching that will require few extra lines to set up web client properly.<\/p>\n<p>REST API documentation and resources are available <a href=\"http:\/\/teamdesk.crmdesk.com\/answer.aspx?aid=21930\">here<\/a>.<\/p>\n<p><strong>Note for SOAP API users<\/strong><\/p>\n<p>SOAP API is now obsolete. We will maintain it in operational state but we won\u2019t develop it further any longer. When planning upgrade to REST API please consider that while new API\u2019s method names are the same, in many cases they perform differently.<\/p>\n<ul>\n<li>Select method does not require building SQL-like statements rather receive parameters via URL to query for raw table data. Aggregated results (Min\/Max\/Sum etc.) can be queried via corresponding view.<\/li>\n<li>Create, Update and Upsert methods run record change workflow triggers and email notifications by default. In order to disable triggers the user should have Manage Data administrative privilege (this behavior matches record change via UI vs Setup\u2019s Table Import)<\/li>\n<li>Unlike SOAP API that processes rows in a batch, REST API processes rows to create, update or delete individually \u2013 on a way back you\u2019ll receive the status code for each row.<\/li>\n<li>There is no SetAttachment method \u2013 files\u2019 data should be sent together with the rows to create or update.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Today, we\u2019ve released REST API for TeamDesk. REST API was designed from the ground up to address SOAP API shortcomings, simplify programming and enable integration with other REST-enabled services. Web landscape has changed since we released SOAP API for TeamDesk back in 2006. Now, many web sites make heavy use of REST and JSON. Dynamically [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[6,12,5,13],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-whats-new","tag-api","tag-http","tag-rest","tag-soap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>TeamDesk REST API - TeamDesk Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TeamDesk REST API - TeamDesk Blog\" \/>\n<meta property=\"og:description\" content=\"Today, we\u2019ve released REST API for TeamDesk. REST API was designed from the ground up to address SOAP API shortcomings, simplify programming and enable integration with other REST-enabled services. Web landscape has changed since we released SOAP API for TeamDesk back in 2006. Now, many web sites make heavy use of REST and JSON. Dynamically [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/\" \/>\n<meta property=\"og:site_name\" content=\"TeamDesk Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-22T13:27:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2024\/01\/logo_og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kirill Bondar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirill Bondar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/\"},\"author\":{\"name\":\"Kirill Bondar\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/22c4c05bd657513c8b00122fa364c8d2\"},\"headline\":\"TeamDesk REST API\",\"datePublished\":\"2014-12-22T13:27:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/\"},\"wordCount\":412,\"commentCount\":1,\"keywords\":[\"API\",\"HTTP\",\"REST\",\"SOAP\"],\"articleSection\":[\"What's New\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/\",\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/\",\"name\":\"TeamDesk REST API - TeamDesk Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#website\"},\"datePublished\":\"2014-12-22T13:27:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/22c4c05bd657513c8b00122fa364c8d2\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/teamdesk-rest-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TeamDesk REST API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/\",\"name\":\"TeamDesk Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/22c4c05bd657513c8b00122fa364c8d2\",\"name\":\"Kirill Bondar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g\",\"caption\":\"Kirill Bondar\"},\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/author\\\/kirill-bondar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TeamDesk REST API - TeamDesk Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/","og_locale":"en_US","og_type":"article","og_title":"TeamDesk REST API - TeamDesk Blog","og_description":"Today, we\u2019ve released REST API for TeamDesk. REST API was designed from the ground up to address SOAP API shortcomings, simplify programming and enable integration with other REST-enabled services. Web landscape has changed since we released SOAP API for TeamDesk back in 2006. Now, many web sites make heavy use of REST and JSON. Dynamically [&hellip;]","og_url":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/","og_site_name":"TeamDesk Blog","article_published_time":"2014-12-22T13:27:30+00:00","og_image":[{"width":600,"height":315,"url":"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2024\/01\/logo_og.png","type":"image\/png"}],"author":"Kirill Bondar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirill Bondar","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/#article","isPartOf":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/"},"author":{"name":"Kirill Bondar","@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/22c4c05bd657513c8b00122fa364c8d2"},"headline":"TeamDesk REST API","datePublished":"2014-12-22T13:27:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/"},"wordCount":412,"commentCount":1,"keywords":["API","HTTP","REST","SOAP"],"articleSection":["What's New"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/","url":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/","name":"TeamDesk REST API - TeamDesk Blog","isPartOf":{"@id":"https:\/\/www.teamdesk.net\/blog\/#website"},"datePublished":"2014-12-22T13:27:30+00:00","author":{"@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/22c4c05bd657513c8b00122fa364c8d2"},"breadcrumb":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/teamdesk-rest-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.teamdesk.net\/blog\/"},{"@type":"ListItem","position":2,"name":"TeamDesk REST API"}]},{"@type":"WebSite","@id":"https:\/\/www.teamdesk.net\/blog\/#website","url":"https:\/\/www.teamdesk.net\/blog\/","name":"TeamDesk Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.teamdesk.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/22c4c05bd657513c8b00122fa364c8d2","name":"Kirill Bondar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc5bc844095b5753ccc73c589c028bf16615674f289668146bbd59205a08a52d?s=96&d=mm&r=g","caption":"Kirill Bondar"},"url":"https:\/\/www.teamdesk.net\/blog\/author\/kirill-bondar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":0,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}