I'm in need to use Salesforce API as my new project requires salesforce integration. I'm very new to this and gone through some tutorials and set up till :

  • Sign up to sales force developer portal.
  • Created a connected app.
  • Got customer key and customer secret.

I have given a call back url for the app as https://login.salesforce.com/. Is it right?. What is the purpose of this? How it works?.

I have created a sample project in ASP.NET MVC4. I have a sample Saleforce account. Now my need is to call an API and see the result.

Can anybody provide me sample C# or JS code for the API call ?.

What is single sign-on mechanism for Salesforce. How can I implement this?

  • You only use login.salesforce.com to login to a production account. It should return a different URL in the form of https://[instance].salesforce.com for further calls.
    – Mike Chale
    Aug 13, 2013 at 12:02
  • Sorry mike i didn't get you fully.. can please elaborate a little. I mean we need to set up a development environment. How can we achieve this. Aug 13, 2013 at 12:09
  • I elaborated in my answer.
    – Mike Chale
    Aug 13, 2013 at 12:25

1 Answer 1


Salesforce uses OAuth for its REST API. You will send a logon request to either https://login.salesforce.com for production environments or to https://test.salesforce.com for accessing a sandbox. In the response, you will receive what is called the Instance URL to which all further requests should be routed. These are in the format of https://[instance name].salesforce.com and some examples are https://na1.salesforce.com and https://cs9.salesforce.com. They can also be custom, like https://anish.my.salesforce.com.

Salesforce provides an excellent developers guide for the REST API; I highly recommend reading it. The guide provides many examples. I personally went through the examples with Fiddler instead of cURL, but that's a personal preference.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .