{"id":3762,"date":"2014-02-25T09:25:21","date_gmt":"2014-02-25T03:55:21","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=3762"},"modified":"2014-11-18T03:34:55","modified_gmt":"2014-11-18T03:34:55","slug":"salesforce-rest-api-playground","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-rest-api-playground\/","title":{"rendered":"Salesforce REST API Playground"},"content":{"rendered":"<p><strong>What is REST API ?<\/strong><\/p>\n<blockquote><p>In my words, Getting data from Other System or Same System using HTTP request is known as REST API.<\/p><\/blockquote>\n<p style=\"text-align: justify;\">If you know, how website works, you know REST API. Before REST API, there was <a title=\"SOAP API\" href=\"https:\/\/jitendrazaa.com\/blog\/java\/create-soap-message-using-java\/\">SOAP <\/a>request which needed lots of configuration and very tightly coupled. If you make any modification , you had to modify client side also by generating stubs \/ proxy classes again. There were many more disadvantages which got address by REST API. However, it doesn&#8217;t mean we don&#8217;t need SOAP.<\/p>\n<p style=\"text-align: justify;\">Back to REST API, It is very simple to setup and almost any programming language can make HTTP request so very easy to get data from other source. Return type of REST API can be XML, Simple HTTP, <a title=\"Why should I use JSON over XML ?\" href=\"https:\/\/jitendrazaa.com\/blog\/salesforce\/why-should-i-use-json-over-xml\/\">JSON <\/a>or any media like image. However, <a title=\"Why should I use JSON over XML ?\" href=\"https:\/\/jitendrazaa.com\/blog\/salesforce\/why-should-i-use-json-over-xml\/\">JSON <\/a>is very popular response type amongst all.<\/p>\n<p>In Past, I have already written one article <a title=\"Getting record from other Salesforce organization OR communication between multiple salesforce organization\" href=\"https:\/\/jitendrazaa.com\/blog\/salesforce\/getting-record-from-one-salesforce-organization-to-other\/\">demonstrating REST API usage<\/a>.<\/p>\n<p><strong>How to use Salesforce REST API using <a title=\"JQuery Tutorials\" href=\"https:\/\/jitendrazaa.com\/blog\/tag\/jquery\/\">JQuery <\/a>in <a title=\"Visualforce\" href=\"https:\/\/jitendrazaa.com\/blog\/tag\/visualforce\/\">Visualforce <\/a>?<\/strong><\/p>\n<p style=\"text-align: justify;\"><span style=\"text-decoration: underline;\"><strong>REST API Playground<\/strong><\/span> : I have created Simple Visualforce page, which demonstrates how to use REST API of Salesforce. It is written in Visualforce with the help of JQuery. You can study this code and play with it in your organization, you just need to copy and paste it.<\/p>\n<p style=\"text-align: justify;\">You also need to add URL &#8220;http:\/\/cdnjs.cloudflare.com&#8221; in <em>Remote Site Settings,<\/em>\u00a0so that salesforce will allow Visualforce page to get JQuery library from CDN.<\/p>\n<p><!--more--><\/p>\n<p><strong>Video Demo :<\/strong><br \/>\n<iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/zSaSu-JRXWc\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<figure id=\"attachment_3767\" aria-describedby=\"caption-attachment-3767\" style=\"width: 625px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/02\/REST-API-playground-in-Salesforce.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-3767\" src=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/02\/REST-API-playground-in-Salesforce.png?resize=625%2C220&#038;ssl=1\" alt=\"REST API playground in Salesforce\" width=\"625\" height=\"220\" srcset=\"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/02\/REST-API-playground-in-Salesforce.png?resize=1024%2C362&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/02\/REST-API-playground-in-Salesforce.png?resize=300%2C106&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/02\/REST-API-playground-in-Salesforce.png?resize=624%2C220&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/02\/REST-API-playground-in-Salesforce.png?w=1321&amp;ssl=1 1321w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><figcaption id=\"caption-attachment-3767\" class=\"wp-caption-text\">REST API playground in Salesforce<\/figcaption><\/figure>\n<p><strong>Complete Visualforce page :<\/strong><\/p>\n<p><script src=\"https:\/\/gist.github.com\/JitendraZaa\/b9d8d23123b6153f4576.js\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is REST API ? In my words, Getting data from Other System or Same System using HTTP request is known as REST API. If you know, how website works, you know REST API. Before REST API, there was SOAP request which needed lots of configuration and very tightly coupled. If you make any modification [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[9],"tags":[120,134,170,331,336],"class_list":["post-3762","post","type-post","status-publish","format-standard","hentry","category-salesforce","tag-integration","tag-jquery","tag-rest-api","tag-salesforce","tag-visualforce"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":4709,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/using-curl-with-salesforce-rest-api\/","url_meta":{"origin":3762,"position":0},"title":"using cURL with Salesforce Rest API","author":"Jitendra","date":"July 16, 2015","format":false,"excerpt":"Workbench is one of widely used tool in Salesforce when it comes to exploring REST API of Salesforce. However\u00a0I wanted to export REST API response\u00a0in Binary format and therefore used cURL. cURL is open source command line library mostly used to test\u00a0http request. It can be downloaded from here\u00a0and official\u2026","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Salesforce visualforce security check using cURL","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Salesforce-visualforce-security-check-using-cURL.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Salesforce-visualforce-security-check-using-cURL.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Salesforce-visualforce-security-check-using-cURL.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2015\/07\/Salesforce-visualforce-security-check-using-cURL.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6152,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/call-salesforce-rest-api-from-apex\/","url_meta":{"origin":3762,"position":1},"title":"Call Salesforce REST API from Apex","author":"Jitendra","date":"February 27, 2014","format":false,"excerpt":"Use Apex to call Salesforce REST API with sample source code","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6975,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-integration-patterns-best-practices-with-video\/","url_meta":{"origin":3762,"position":2},"title":"Salesforce Integration Patterns &#038; Best Practices &#8211; with Video","author":"Jitendra","date":"February 2, 2020","format":false,"excerpt":"When to use which integration patterns in Salesforce along with best practices. Video to show how to use Outbound message to integrate Salesforce without writing code","rel":"","context":"In &quot;Salesforce&quot;","block_context":{"text":"Salesforce","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/"},"img":{"alt_text":"Integration Patterns in Salesforce","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/02\/Integration-Patterns-in-Salesforce.png?fit=1200%2C425&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/02\/Integration-Patterns-in-Salesforce.png?fit=1200%2C425&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/02\/Integration-Patterns-in-Salesforce.png?fit=1200%2C425&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/02\/Integration-Patterns-in-Salesforce.png?fit=1200%2C425&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2020\/02\/Integration-Patterns-in-Salesforce.png?fit=1200%2C425&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3951,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/creating-salesforce-query-builder-in-node-js-and-angularjs-using-salesforce-rest-api-and-oauth2\/","url_meta":{"origin":3762,"position":3},"title":"Creating Salesforce Query Builder in Node.js and AngularJs using Salesforce REST API and OAuth2 with Heroku Button","author":"Jitendra","date":"August 18, 2014","format":false,"excerpt":"In this post, we will be creating a\u00a0Salesforce Query (SOQL) Builder.\u00a0It uses Google's Angularjs MVC Javascript library and REST API provided by Salesforce. For Authentication, it uses OAuth2. Node.js is used as a primary language and hosted on Heroku. If you want to directly deploy to your Heroku Account, You\u2026","rel":"","context":"In &quot;HTML&quot;","block_context":{"text":"HTML","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/webtech\/web\/"},"img":{"alt_text":"SOQL Builder Using Node.js AngularJs Salesforce REST API on Heroku","src":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/08\/SOQL-Builder-Using-Node.js-AngularJs-Salesforce-REST-API-on-Heroku-1024x504.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/08\/SOQL-Builder-Using-Node.js-AngularJs-Salesforce-REST-API-on-Heroku-1024x504.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.jitendrazaa.com\/blog\/wp-content\/uploads\/2014\/08\/SOQL-Builder-Using-Node.js-AngularJs-Salesforce-REST-API-on-Heroku-1024x504.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3773,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/salesforce-faq-part-19\/","url_meta":{"origin":3762,"position":4},"title":"Salesforce interview questions &#8211; Part 19","author":"Jitendra","date":"December 16, 2014","format":false,"excerpt":"Salesforce interview questions for developers and admins around Apex, Visualforce, getting Salesforce object name on basis of Id, Apex API limits","rel":"","context":"In &quot;Apex&quot;","block_context":{"text":"Apex","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/apex\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3851,"url":"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/apex\/send-email-with-generated-pdf-as-attachment-from-trigger\/","url_meta":{"origin":3762,"position":5},"title":"Send Email with Generated PDF as attachment from Trigger &#8211; before Winter 16","author":"Jitendra","date":"April 16, 2014","format":false,"excerpt":"There may be scenario in Salesforce that you need to send a Visualforce page rendered as PDF as a part of Email Attachment. This will be very easy if you want to perform this using Controller or Extension class, we just have to call getContentAsPDF() method of PageReference class and\u2026","rel":"","context":"In &quot;Apex&quot;","block_context":{"text":"Apex","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/salesforce\/apex\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/3762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=3762"}],"version-history":[{"count":4,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/3762\/revisions"}],"predecessor-version":[{"id":4057,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/3762\/revisions\/4057"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=3762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=3762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=3762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}