{"id":1676,"date":"2018-06-06T11:52:50","date_gmt":"2018-06-06T11:52:50","guid":{"rendered":"https:\/\/gosqeng.test\/?p=1676"},"modified":"2022-07-20T18:48:48","modified_gmt":"2022-07-20T18:48:48","slug":"salesforce-rest-api-integration","status":"publish","type":"post","link":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration","title":{"rendered":"How to build a basic Salesforce REST API Integration"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/static.gosquared.com\/images\/liquidicity\/18_06_06_salesforce_01\/18_06_06_salesforce_01@2x.jpg\" alt=\"Building a Salesforce REST API integration\" \/><\/p>\n<p>Want to know How to build a basic Salesforce REST API Integration? In today&#8217;s post, <a href=\"https:\/\/www.gosquared.com\/\">GoSquared&#8217;s<\/a> Sales Engineer Russell Vaughan will show you how.<\/p>\n<p>Being in the Software as a Service space, you have to admire what Salesforce has managed to accomplish. It would be hard to argue their success, particularly at the enterprise customer level.<\/p>\n<p>While they have one of the most tuned and well-known sales approaches in software, there is almost a feeling that when a company gets to a certain size, they just decide it\u2019s time to use Salesforce. It\u2019s due to this that if you have a product that operates in the Sales and Marketing space, there is huge opportunity in tapping into the Salesforce community and ecosystem.<\/p>\n<p>For example, we\u2019ve built the <a href=\"https:\/\/www.gosquared.com\/integrations\/salesforce\/\" target=\"_blank\" rel=\"noopener noreferrer\">GoSquared Salesforce integration<\/a> to capture the on-site behaviour of leads when they\u2019re browsing your website (E.g. when a lead views your pricing page or watches a webinar), and send this directly into Salesforce ready for your sales team to act on within their existing workflow.<\/p>\n<h2>Digging into the Salesforce developer ecosystem<\/h2>\n<p>With a company that has the breadth and depth of product that Salesforce offers, there will always be pros and cons to getting your head around their documentation and terminology.<\/p>\n<p>They have an incredible developer community, including their own Stackoverflow-esque forums. If you hit a road block, it\u2019s likely someone\u2019s hit it before you and you can find a documented solution.<\/p>\n<p>Similarly they have an extremely robust e-learning platform with tracks that you can complete across a plethora of different subjects to get up to speed on a lot of their terminology and principals.<\/p>\n<p>There can, however, be an abundance of content to sift through and it can be an incredibly time consuming process \u2013 particularly if building and developing on the Salesforce Platform is not going to be the core responsibility of your job!<\/p>\n<p>This blog post is really focused around communicating, at a very basic level, the key concepts needed to build a basic Salesforce REST API integration.<\/p>\n<h2>Salesforce REST API Integration vs Salesforce App<\/h2>\n<p>It\u2019s important to highlight the difference between a Salesforce REST API integration and a Salesforce app that you\u2019d find on their AppExchange (essentially the Salesforce App Store.)<\/p>\n<p>Listing an app within the Salesforce AppExchange will give you the ability to build your product directly into the Salesforce platform. For example, visualising your product\u2019s data directly within a component in Salesforce. While there are clear benefits in having a presence within this ecosystem it\u2019s important to note that there are some costs associated with doing so.<\/p>\n<p>A REST API integration is a lot simpler and is primarily focused around sending data from your application and fetching data from Salesforce. Currently there is no cost associated with this type of integration however it&#8217;s worth noting that REST integrations are only accessible to Salesforce users on their enterprise plans (there is scope to get REST API access on Professional and Group editions but involves getting your app whitelisted.)<\/p>\n<p>For the purposes of this post, our example REST API integration is going to be super basic. Our app is going to have customer data that we want to send to Salesforce and there will be customer data in Salesforce that we want to retrieve.<\/p>\n<p>Essentially then, our REST API integration is going to need to do 3 critical things:<\/p>\n<ol>\n<li>Allow a user of our application to authorise us to access and transfer their Salesforce data on their behalf.<\/li>\n<li>Allow a user to push data from our application to Salesforce.<\/li>\n<li>Allow a user to retrieve Salesforce data to be used within our app.<\/li>\n<\/ol>\n<h2>Getting set up with Salesforce<\/h2>\n<h3>Create a free developer account<\/h3>\n<p>Start by getting yourself a <a href=\"https:\/\/developer.salesforce.com\/signup\">free Salesforce Developer account<\/a>.<\/p>\n<p>The Salesforce developer accounts are awesome and pretty much give you a working Salesforce organisation (an organisation is Salesforce\u2019s terminology for an account) so you can get a feel for the interface and even add and manage users.<\/p>\n<h3>Set up a Connected App<\/h3>\n<p>Once you have your developer account set up you\u2019ll want to set up a <strong>Connected App<\/strong>. Connected Apps have the ability to offer a lot of functionality and sometimes that can make it a bit difficult to get your head around them.<\/p>\n<p>For the purposes of this and how we\u2019re going to use it, it\u2019s easiest to think of a connected app as a small app that sits on Salesforce\u2019s infrastructure that you point your integration to. It is responsible for managing the authentication and also the routing of requests to the relevant client instances.<\/p>\n<p>Once you\u2019ve set up your Salesforce developer account, you can set up a connected app by clicking the <strong>Setup<\/strong> icon in the top-right navigation menu and select <strong>Setup<\/strong>.<\/p>\n<p>Enter <strong>App Manager<\/strong> in the <strong>Quick Find<\/strong> box and then select <strong>App Manager<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"screenshot alignnone\" src=\"https:\/\/static.gosquared.com\/images\/liquidicity\/18_06_06_salesforce_01\/18_06_06_salesforce_03.png\" alt=\"Screenshot of the Salesforce App Manager rest api in salesforce\" width=\"3350\" height=\"1436\" \/><\/p>\n<p>1. Click <strong>New Connected App<\/strong>.<\/p>\n<p>2. In the New Connected App form, fill in:<\/p>\n<p>In the <strong>Basic Information<\/strong> section:<\/p>\n<ol>\n<li>Connect App Name: YourAppName.<\/li>\n<li>API Name: this will automatically become \u2018YourAppName\u2019.<\/li>\n<li>Contact Email: enter your email address.<\/li>\n<\/ol>\n<p>In the <strong>API (Enable OAuth Settings)<\/strong> section:<\/p>\n<ol>\n<li>Check Enable OAuth Settings.<\/li>\n<li>Callback URL: enter your callback url, example: https:\/\/www.yourappname.com\/api\/callback<\/li>\n<\/ol>\n<p>This will be the URL which Salesforce POSTs to when the user has authorised your app to access their data. This will include the <strong>access and request token<\/strong> (we\u2019ll explain a bit more on this below but they are essential to be able to send and receive data.) So if you don\u2019t have one already, you\u2019ll need to set up an endpoint who\u2019s role it is to receive and handle this request.<\/p>\n<p>Under <strong>Selected OAuth Scopes<\/strong>:<\/p>\n<ol>\n<li>Select <strong>Access and manage your data (API)<\/strong>.<\/li>\n<li>Click <strong>Add<\/strong>.<\/li>\n<\/ol>\n<p>Once you\u2019ve set up your app, you\u2019ll be given a <strong>Consumer Key<\/strong> and a <strong>Consumer Secret<\/strong> for you app.<\/p>\n<h2>The basic Salesforce Oauth data flow<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/static.gosquared.com\/images\/liquidicity\/18_06_06_salesforce_01\/18_06_06_salesforce_02@2x.jpg\" alt=\"Salesforce Oauth data flow diagram. by GoSquared\" \/><\/p>\n<p>With the connected app set up, its handy to get an idea of how the data flow works.<\/p>\n<p>To start, your user is directed to a Saleforce.com authorisation endpoint, there they log in and approve access for your app to access their data.<\/p>\n<p>After a successful authorisation Salesforce sends a response with an <strong>Access token<\/strong> and <strong>Refresh token<\/strong>.<\/p>\n<p>The <strong>Access token<\/strong> is to be passed in the header of all API requests for data. This token has an expiry date and will always expire. By default the Connected Apps have an access token with an expiry of 15 minutes (inline with the sessions settings within your Salesforce settings).<\/p>\n<p>The <strong>Refresh token<\/strong> is to be used to retrieve a valid access token (e.g. when the current access token expires). You can change the expiry settings on this but you can also set this never to expire, only when it revoked.<\/p>\n<h3>Example API calls:<\/h3>\n<p>To make the initial authorisation request for a user to grant your app access to their data (this is where your user is initially directed to a Saleforce.com authorisation endpoint and logs in) you\u2019d make the following request. The <strong>client_id<\/strong> in the below call will be your <strong>consumer ID<\/strong> from the connected app. The <strong>redirect_uri<\/strong> will be the <strong>Callback URL<\/strong>.<\/p>\n<pre class=\"language-shell\"><code>\ncurl https:\/\/login.salesforce.com\/services\/oauth2\/authorize?response_type=code\n&amp;client_id=YOURCONSUMERID&amp;redirect_uri=https:\/\/www.yourappname.com\/api\/callback\n<\/code><\/pre>\n<p>A successful response from this will redirect the page to a Salesforce login page where the user is able to login and authenticate. After Salesforce confirms that the client has authorised your app to access their data, the end-user\u2019s browser is redirected to the callback URL you\u2019ve specified by the redirect_uri parameter. Salesforce then appends an <strong>authorisation code<\/strong> to the redirect URL, their request will look similar to the below.<\/p>\n<pre class=\"language-shell\"><code>\nhttps:\/\/www.yourappname.com\/api\/callback?code=aWekysIEeqM9PiThEfm0Cnr6MoLIfwWyRJcqOqHdF8f9INokharAS09ia7UNP6RiVScerfhc4w%3D%3D\n<\/code><\/pre>\n<p>You\u2019ll use this as the value for your <strong>code<\/strong> parameter when you make a request to Salesforce\u2019s token endpoint to receive your <strong>Access and Refresh Token<\/strong>.<\/p>\n<h3>Example request:<\/h3>\n<pre class=\"language-shell\"><code>\ncurl login.salesforce.com\/services\/oauth2\/token?grant_type=authorization_code&amp;redirect_uri=https:\/\/www.yourappname.com\/api\/callback&amp;client_id=YOUR_CONSUMER_ID&amp;client_secret=YOUR_CONSUMER_SECRET&amp;code=aWekysIEeqM9PiThEfm0Cnr6MoLIfwWyRJcqOqHdF8f9INokharAS09ia7UNP6RiVScerfhc4w%3D%3D\n<\/code><\/pre>\n<h3>Example Response:<\/h3>\n<pre class=\"language-shell\"><code>\n{\n  \"access_token\": \"YOUR_ACCESS_TOKEN\",\n  \"refresh_token\": \"YOUR_REFRESH_TOKEN\",\n  \"signature\": \"signature\",\n  \"scope\": \"refresh_token api id\",\n  \"instance_url\": \"https:\/\/instance.salesforce.com\",\n  \"id\": \"https:\/\/login.salesforce.com\/id\/id,\n  \"token_type\": \"Bearer\",\n  \"issued_at\": \"timestamp\"\n}\n<\/code><\/pre>\n<p>Outside of the access and response token, the instance_url is import also. It\u2019s what you\u2019ll need to build the base of your future API calls.<\/p>\n<p>Now we have the access token, we\u2019re able to start making requests to send and receive data on our users behalf. Something to keep in mind though, as mentioned earlier, is that these access tokens will always expire at some point.<\/p>\n<p>Due to that, you\u2019ll want to keep your access token up to date by making a call to the token endpoint and changing the grant_type to \u2018<strong>refresh_token<\/strong>\u2019 along with including the refresh token you had received in the previous call.<\/p>\n<h3>Example call:<\/h3>\n<pre class=\"language-shell\"><code>\ncurl https:\/\/login.salesforce.com\/services\/oauth2\/token?grant_type=refresh_token&amp;client_id=YOUR_CONSUMER__ID&amp;client_secret=YOUR_CONSUMER__SECRET&amp;refresh_token=YOUR_REFRESH_TOKEN\n<\/code><\/pre>\n<h3>Example response:<\/h3>\n<pre class=\"language-shell\"><code>\n{\n  \"access_token\": \"REFRESHED_ACCESS_TOKEN\",\n  \"signature\": \"signature\",\n  \"scope\": \"refresh_token id api\",\n  \"instance_url\": \"https:\/\/INSTANCE.salesforce.com\",\n  \"id\": \"https:\/\/login.salesforce.com\/id\/idE\",\n  \"token_type\": \"Bearer\",\n  \"issued_at\": \"timestamp\"\n}\n<\/code><\/pre>\n<p>Now we have a way to keep our access tokens valid and up to date, we\u2019re set up and ready to start working with Salesforce objects.<\/p>\n<h2>Understanding Salesforce objects<\/h2>\n<p>Salesforce <strong>objects<\/strong> (sobjects) are effectively database tables that contain an organisation&#8217;s data. Examples of standard Salesforce objects will be \u201cAccounts\u201d, \u201cContacts\u201d, \u201cLeads\u201d, and \u201cTasks.\u201d You also have scope to create your own custom objects.<\/p>\n<p>A Salesforce <strong>record<\/strong> describes a specific occurrence of an object (such as a specific contact like \u201cJonny Appleseed\u201d that is represented by a Contact object). A basic comparison would be like a row in a database table.<\/p>\n<p>For the following examples, we\u2019re just going to focus on Contacts.<\/p>\n<h2>Send data from your app to Salesforce<\/h2>\n<p>Creating a contact in salesforce is really straightforward. You just need to build the API url using the instance from your access token response and use the access token value as your bearer token in the header.<\/p>\n<p>One thing to keep an eye out for through is for characters that need to be escaped in your access token.<\/p>\n<p>For example this access token should have the exclamation mark escaped<\/p>\n<p>So this:<\/p>\n<pre class=\"language-shell\"><code>\n00D1r000000dumU!AQEAQFd.O1Q5DVQrUYvr.........\n<\/code><\/pre>\n<p>Becomes this:<\/p>\n<pre class=\"language-shell\"><code>\n00D1r000000dumU\\!AQEAQFd.O1Q5DVQrUYvr........\n<\/code><\/pre>\n<p>you can then make the below call to create a contact.<\/p>\n<h3>Example request<\/h3>\n<pre class=\"language-shell\"><code>\ncurl https:\/\/INSTANCE.salesforce.com\/services\/data\/v42.0\/sobjects\/Contact -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\" -H \"Content-Type: application\/json\" -d '{\"FirstName\" : \"Johnny\", \"LastName\" : \"Appleseed\"}'\n<\/code><\/pre>\n<p>(Your contact will need a last name as the minimum for an entry to be created.)<\/p>\n<p>The response you get back will be the id of your contact<\/p>\n<pre class=\"language-shell\"><code>\n{\"id\":\"0031r000029NDckAAG\",\"success\":true,\"errors\":[]}\n<\/code><\/pre>\n<p>Which will also let you build a link directly to the contact.<\/p>\n<pre class=\"language-shell\"><code>\nhttps:\/\/INSTANCE.salesforce.com\/0031r000029NDckAAG\n<\/code><\/pre>\n<h2>Retrieving data from Salesforce to your app<\/h2>\n<p>If you want to retrieve a list of contacts there are a few ways you can do it. You can make a request to the contact endpoint and it will return a bunch of information about your contacts that I found a bit cumbersome to navigate.<\/p>\n<p>I actually prefer to use a combination a contacts \u2018describe\u2019 endpoint, which will return all of the fields we can populate about our user.<\/p>\n<p>Example request:<\/p>\n<pre class=\"language-shell\"><code>\ncurl https:\/\/INSTANCE.salesforce.com\/services\/data\/v20.0\/sobjects\/Contact\/describe -H  \"Authorization: Bearer YOUR_ACCESS_TOKEN\"\n<\/code><\/pre>\n<p>That will give a detailed response of all of the fields available. (I\u2019ve just given an example of the \u2018first name\u2019 element for brevity)<\/p>\n<pre class=\"language-shell\"><code>\n{\n      \"autoNumber\": false,\n      \"byteLength\": 120,\n      \"calculated\": false,\n      \"calculatedFormula\": null,\n      \"caseSensitive\": false,\n      \"controllerName\": null,\n      \"createable\": true,\n      \"custom\": false,\n      \"defaultValue\": null,\n      \"defaultValueFormula\": null,\n      \"defaultedOnCreate\": false,\n      \"dependentPicklist\": false,\n      \"deprecatedAndHidden\": false,\n      \"digits\": 0,\n      \"externalId\": false,\n      \"filterable\": true,\n      \"groupable\": true,\n      \"htmlFormatted\": false,\n      \"idLookup\": false,\n      \"inlineHelpText\": null,\n      \"label\": \"First Name\",\n      \"length\": 40,\n      \"name\": \"FirstName\",\n      \"nameField\": false,\n      \"namePointing\": false,\n      \"nillable\": true,\n      \"picklistValues\": [],\n      \"precision\": 0,\n      \"referenceTo\": [],\n      \"relationshipName\": null,\n      \"relationshipOrder\": null,\n      \"restrictedPicklist\": false,\n      \"scale\": 0,\n      \"soapType\": \"xsd:string\",\n      \"sortable\": true,\n      \"type\": \"string\",\n      \"unique\": false,\n      \"updateable\": true,\n      \"writeRequiresMasterRead\": false\n    }\n<\/code><\/pre>\n<p>Once you\u2019ve got the fields you can then use them (or a selection) to build a custom query:<\/p>\n<pre class=\"language-shell\"><code>\ncurl https:\/\/INstance.salesforce.com\/services\/data\/v42.0\/query\/?q=SELECT+id,name,email,phone+from+Contact -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'\n<\/code><\/pre>\n<p>That will return all contacts with their associated properties.<\/p>\n<pre class=\"language-shell\"><code>\n{\"totalSize\":1,\"done\":true,\"records\":[{\"attributes\":{\"type\":\"Contact\",\"url\":\"\/services\/data\/v42.0\/sobjects\/Contact\/id\"},\"Id\":\"id\",\"Name\":\"Jonny Appleseed\",\"Email\":\"jonny.appleseed@myfriend.com\",\"Phone\":\"555-555-555\"} ]}\n<\/code><\/pre>\n<p>That should now give you a way to retrieve contact data from Salesforce to use within your app.<\/p>\n<h2>Further resources<\/h2>\n<p>Hopefully that gives a good enough foundation to start exploring more of the Salesforce objects you can interact with through a REST API integration. Here are some additional resources to more in-depth information about the Salesforce REST endpoints.<\/p>\n<ul>\n<li><a href=\"https:\/\/developer.salesforce.com\/page\/REST_API\" target=\"_blank\" rel=\"noopener noreferrer\">Salesforce REST API Documentation<\/a><\/li>\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api_rest.meta\/api_rest\/resources_sobject_basic_info.htm\" target=\"_blank\" rel=\"noopener noreferrer\">Documentation for Salesforce Objects<\/a><\/li>\n<li><a href=\"https:\/\/trailhead.salesforce.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Salesforce Trailhead Community<\/a><\/li>\n<li><a href=\"https:\/\/www.gosquared.com\/integrations\/salesforce\/\">GoSquared Salesforce Integration<\/a><\/li>\n<\/ul>\n<h2>Questions or comments on how to build a basic Salesforce REST API Integration?<\/h2>\n<p>We hope you&#8217;ve enjoyed this post on building a basic Salesforce REST API Integration, brought to you by <a href=\"https:\/\/www.gosquared.com\/\">GoSquared<\/a>. Our award-winning software including <a href=\"https:\/\/www.gosquared.com\/customer-engagement\/\">Engage<\/a>, <a href=\"https:\/\/www.gosquared.com\/live-chat\/\">Live Chat for Sales<\/a> and <a href=\"https:\/\/www.gosquared.com\/analytics\/\">Analytics<\/a> helps businesses understand and engage with their customers.<\/p>\n<p>Feel free to reach out to the author <a href=\"http:\/\/www.twitter.com\/russellvaughan\">Russell Vaughan on Twitter<\/a> with any questions or feedback you have about this post! If you&#8217;d like us to cover any other Salesforce topics, or any other technical discussions let us know too.<\/p>\n<p><strong>If you&#8217;ve enjoyed this post, be sure to <a href=\"https:\/\/gosquared.us2.list-manage.com\/subscribe\/post?u=aff6f5e0c81c6ff5bee968351&amp;id=cee634e8b1\">subscribe to the GoSquared newsletter<\/a>. It&#8217;s free, and you&#8217;ll receive our latest tips and tricks on all things growth for your business.\u00a0<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to know How to build a basic Salesforce REST API Integration? In today&#8217;s post, GoSquared&#8217;s Sales Engineer Russell Vaughan&#8230;<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1452],"tags":[101,1269,482,771,1560,1561],"class_list":["post-1676","post","type-post","status-publish","format-standard","hentry","category-engineering","tag-api","tag-crm","tag-integration","tag-rest","tag-salesforce","tag-salesforce-cloud"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v18.6 (Yoast SEO v19.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to build a basic Salesforce REST API Integration - GoSquared Blog<\/title>\n<meta name=\"description\" content=\"Getting started with your first integration using the Salesforce REST API. Learn how to develop with the Salesforce platform.\" \/>\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.gosquared.com\/blog\/salesforce-rest-api-integration\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to build a basic Salesforce REST API Integration\" \/>\n<meta property=\"og:description\" content=\"Getting started with your first integration using the Salesforce REST API. Learn how to develop with the Salesforce platform.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration\" \/>\n<meta property=\"og:site_name\" content=\"GoSquared Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GoSquared\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-06T11:52:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-20T18:48:48+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/static.gosquared.com\/images\/liquidicity\/18_06_06_salesforce_01\/18_06_06_salesforce_twitter_01@2x.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@Russellvaughan\" \/>\n<meta name=\"twitter:site\" content=\"@GoSquared\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Russell Vaughan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\",\"name\":\"GoSquared\",\"url\":\"https:\/\/www.gosquared.com\/blog\/\",\"sameAs\":[\"https:\/\/instagram.com\/gosquaredteam\",\"https:\/\/www.linkedin.com\/company\/go-squared-ltd.\",\"https:\/\/www.facebook.com\/GoSquared\",\"https:\/\/twitter.com\/GoSquared\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png\",\"contentUrl\":\"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png\",\"width\":1270,\"height\":250,\"caption\":\"GoSquared\"},\"image\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#website\",\"url\":\"https:\/\/www.gosquared.com\/blog\/\",\"name\":\"GoSquared Blog\",\"description\":\"Turn visitors into customers.\",\"publisher\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gosquared.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#webpage\",\"url\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration\",\"name\":\"How to build a basic Salesforce REST API Integration - GoSquared Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#primaryimage\"},\"datePublished\":\"2018-06-06T11:52:50+00:00\",\"dateModified\":\"2022-07-20T18:48:48+00:00\",\"description\":\"Getting started with your first integration using the Salesforce REST API. Learn how to develop with the Salesforce platform.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.gosquared.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to build a basic Salesforce REST API Integration\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#webpage\"},\"author\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/c5fbe35e2c32f13a6e05136b474f43b4\"},\"headline\":\"How to build a basic Salesforce REST API Integration\",\"datePublished\":\"2018-06-06T11:52:50+00:00\",\"dateModified\":\"2022-07-20T18:48:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#webpage\"},\"wordCount\":2010,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#primaryimage\"},\"thumbnailUrl\":\"\",\"keywords\":[\"API\",\"CRM\",\"Integration\",\"REST\",\"Salesforce\",\"Salesforce Cloud\"],\"articleSection\":[\"Engineering\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/c5fbe35e2c32f13a6e05136b474f43b4\",\"name\":\"Russell Vaughan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/822f03d63c83bea45c7827659fab4514c085e2647cc4d6145ead087e3cec4a56?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/822f03d63c83bea45c7827659fab4514c085e2647cc4d6145ead087e3cec4a56?s=96&d=mm&r=g\",\"caption\":\"Russell Vaughan\"},\"description\":\"Russell is a sales engineer at GoSquared, focused on helping new customers get up and running with the GoSquared platform.\",\"sameAs\":[\"https:\/\/gosquared.com\",\"https:\/\/twitter.com\/Russellvaughan\"],\"url\":\"https:\/\/www.gosquared.com\/blog\/author\/russell\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to build a basic Salesforce REST API Integration - GoSquared Blog","description":"Getting started with your first integration using the Salesforce REST API. Learn how to develop with the Salesforce platform.","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.gosquared.com\/blog\/salesforce-rest-api-integration","og_locale":"en_US","og_type":"article","og_title":"How to build a basic Salesforce REST API Integration","og_description":"Getting started with your first integration using the Salesforce REST API. Learn how to develop with the Salesforce platform.","og_url":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration","og_site_name":"GoSquared Blog","article_publisher":"https:\/\/www.facebook.com\/GoSquared","article_published_time":"2018-06-06T11:52:50+00:00","article_modified_time":"2022-07-20T18:48:48+00:00","twitter_card":"summary_large_image","twitter_image":"https:\/\/static.gosquared.com\/images\/liquidicity\/18_06_06_salesforce_01\/18_06_06_salesforce_twitter_01@2x.jpg","twitter_creator":"@Russellvaughan","twitter_site":"@GoSquared","twitter_misc":{"Written by":"Russell Vaughan","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.gosquared.com\/blog\/#organization","name":"GoSquared","url":"https:\/\/www.gosquared.com\/blog\/","sameAs":["https:\/\/instagram.com\/gosquaredteam","https:\/\/www.linkedin.com\/company\/go-squared-ltd.","https:\/\/www.facebook.com\/GoSquared","https:\/\/twitter.com\/GoSquared"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png","contentUrl":"https:\/\/www.gosquared.com\/blog\/wp-content\/uploads\/2015\/07\/gosquared.png","width":1270,"height":250,"caption":"GoSquared"},"image":{"@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/www.gosquared.com\/blog\/#website","url":"https:\/\/www.gosquared.com\/blog\/","name":"GoSquared Blog","description":"Turn visitors into customers.","publisher":{"@id":"https:\/\/www.gosquared.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gosquared.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#primaryimage","url":"","contentUrl":""},{"@type":"WebPage","@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#webpage","url":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration","name":"How to build a basic Salesforce REST API Integration - GoSquared Blog","isPartOf":{"@id":"https:\/\/www.gosquared.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#primaryimage"},"datePublished":"2018-06-06T11:52:50+00:00","dateModified":"2022-07-20T18:48:48+00:00","description":"Getting started with your first integration using the Salesforce REST API. Learn how to develop with the Salesforce platform.","breadcrumb":{"@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.gosquared.com\/blog"},{"@type":"ListItem","position":2,"name":"How to build a basic Salesforce REST API Integration"}]},{"@type":"Article","@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#article","isPartOf":{"@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#webpage"},"author":{"@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/c5fbe35e2c32f13a6e05136b474f43b4"},"headline":"How to build a basic Salesforce REST API Integration","datePublished":"2018-06-06T11:52:50+00:00","dateModified":"2022-07-20T18:48:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#webpage"},"wordCount":2010,"commentCount":0,"publisher":{"@id":"https:\/\/www.gosquared.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#primaryimage"},"thumbnailUrl":"","keywords":["API","CRM","Integration","REST","Salesforce","Salesforce Cloud"],"articleSection":["Engineering"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.gosquared.com\/blog\/salesforce-rest-api-integration#respond"]}]},{"@type":"Person","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/c5fbe35e2c32f13a6e05136b474f43b4","name":"Russell Vaughan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.gosquared.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/822f03d63c83bea45c7827659fab4514c085e2647cc4d6145ead087e3cec4a56?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/822f03d63c83bea45c7827659fab4514c085e2647cc4d6145ead087e3cec4a56?s=96&d=mm&r=g","caption":"Russell Vaughan"},"description":"Russell is a sales engineer at GoSquared, focused on helping new customers get up and running with the GoSquared platform.","sameAs":["https:\/\/gosquared.com","https:\/\/twitter.com\/Russellvaughan"],"url":"https:\/\/www.gosquared.com\/blog\/author\/russell"}]}},"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts\/1676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/comments?post=1676"}],"version-history":[{"count":0,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/posts\/1676\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/media?parent=1676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/categories?post=1676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gosquared.com\/blog\/wp-json\/wp\/v2\/tags?post=1676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}