Skip to main content

Salesforce REST API

This post describe about the salesforce rest api and using salesforce rest api .


Salesforce implements the OAuth to authenticate soap and rest calls with the client. So I will describe with the simple steps, how to create salesforce app that expose outside to authenticate and call rest methods.

  • First you need to create a salesforce developer account if you don't have an developer account or sandbox account. If you don't have an developer account go with the following link and create an account. It's free.   https://developer.salesforce.com/signup.
    Once you create the developer account go to https://login.salesforce.com/ and login with your credentials.
       
  • Navigate to setup and type app and you will be able to find Apps section and click the link.
  • So now you will be able to find Connected Apps section and click New. What we doing here is creating a connected app and that app will exposing to outside to authenticate and call rest api calls.
  • So you can insert Connected App Name , API Name , Contact Email and make sure you have checked Enable OAuth Settings in API (Enable OAuth Settings). We can ignore other fields for now. Once you click the Enable OAuth Setting check box you have to fill Callback URL , that will return if the request success. So you can set https://login.salesforce.com for the Callback URL.For the Selected OAuth Scopes Give Full access(full). If you need to set the permission for the api requests you can set it here. And click Save , it will take 2- 10 minutes to make those changes take effect.
            



  • After Click Continue you will be able to see a screen same as below screen.
 

  • We have created the Connected App. So now we can make rest calls to salesforce from outside via  the connected app. Here we using Username-Password OAuth Authentication Flow to authenticate with our connected app , there for we should have grant_type , client_id , client_secret , username , password parameters with the request. I will explain each parameters and endpoint URL in next post.

Comments

Popular posts from this blog

Integrate .NET console application with Salesforce Rest API

According to the integration perspective in Salesforce there are several APIs to integrate with external systems. As an example there are REST API, SOAP API, Bulk API, Tooling API and Streaming API. Here I will focusing for Rest API. I have created a different post which will describing the integration with Salesforce Soap API. You can find it from  here . And for the Tooling API you can find it from  here . 1st of all you need to create a connected app in Salesforce in order to make the bridge to integrate with console app.  A connected app integrates an external application with Salesforce using APIs. Connected apps use standard SAML and OAuth protocols to authenticate, provide single sign-on, and provide tokens for use with Salesforce APIs. So I have created a separate post which will describe how to create a connected app to get consumer id and consumer secret. Please follow  this   post to get consumer id and consumer secret. After you...

How to automate testing using Selenium and C#

Hi All, today I’m going to explain about Selenium which is a open source automation tool and how to utilize it with C#. As you know automation tools save our time in terms of testing a software product. If we are doing some regression testings automation tools doing a great job in terms of saving the time. So I’m going to explain a very simple example for using Selenium from C#. We can divide selenium as two entities. One is Selenium IDE as a web browser extension. And the other one is Selenium Web Driver. So I’m going to talk about the selenium web driver which is using for web based testings from C# code. Basically Selenium Web driver will open the browser and doing the actions as we instructing in the C#code. Firstly you need to install visual studio. For my case I have installed visual studio community version which is a free version of Microsoft. Then you need to create a project by navigating to File -> New -> Project. And give a name for the project and click ok...

How to connect Salesforce with .NET console application using SOAP api

This article mainly focusing on the basics about the integration with Salesforce and .NET console application via Salesforce SOAP api. So I would prefer to start it form Salesforce. :) . And I think it would be easy if I continuing with Steps so the viewers can go through the steps easily. 1st Step : Navigating to Enterprise WSDL from Salesforce. You will be able to generate WSDL in Salesforce by Navigating to Setup -> Integrations -> API.  Here you will be able to see different apis which will be generating for different purposes. In order to do this you need to log in as an system administrator or as a user who has the “Modify All Data” permission. You will be able to see below APis. Enterprise WSDL Partner WSDL Apex WSDL Metadata WSDL Tooling WSDL Generate Tooling WSDL Delegated Authentication WSDL Client Certificate Enterprise Package Version Settings Partner Package Version Settings We are focusing Enterprise WDSL in order to integrate with .NET and you want t...