I'm looking for a way to connect to some Force.com API using only password + security token, username and URI in a similar manner SublimeText or realforce explorer do. All approaches I've found so far require some additional settings or parameters.

Any ideas?

EDIT: I'm mostly interested in integrating Salesforce with .NET platform but some general thoughts might be helpful as well.

  • With what platform are you trying to integrate Salesforce? Which language? C#? Java? – Mihai Neagoe Jan 20 '15 at 14:46
  • Mainly C#, but maybe there is some general solution? – Bart Juriewicz Jan 20 '15 at 14:50

What I use and recommend is the Force.com Toolkit for .NET. It provides native libraries for interacting with Salesforce APIs, including the REST API and Chatter API. These toolkits make it super simple to consume services from Salesforce within .NET applications by packaging them up as NuGet packages, thus handling deployment and versioning.

  • Ok, but which method from AuthenticationClient would fit my needs? – Bart Juriewicz Jan 20 '15 at 14:56
  • The UsernamePasswordAsync() method. As the name says in an async method. It uses this username and password flow help.salesforce.com/… – Mihai Neagoe Jan 20 '15 at 15:08
  • UsernamePasswordAsync() requires consumer key and consumer secret in addition to username and password. As far as I know, the connected app must be created in salesforce in order to obtain them. It's still more than mavensmate asks for. – Bart Juriewicz Jan 20 '15 at 15:16
  • What mavensmate and other IDEs are accessing is the Metadata API. salesforce.com/us/developer/docs/api_meta . You need a WSDL for that to import and then call the login() method. Here is a sample in Java salesforce.com/us/developer/docs/api_meta/Content/…. Now the question is, do you need to access metadata or data? – Mihai Neagoe Jan 20 '15 at 15:27
  • You only need to create teh connected app once, not once per org, so just create it in your dev org and you're done. – superfell Jan 20 '15 at 16:07

The answer is to use the Partner SOAP API. Unlike the Enterprise SOAP API, Partner SOAP API is API specific, not only org specific. Also, unlike REST API, using Partner SOAP API doesn't require any additional steps in Org. The cost is that it's weakly typed and api specific, so there there might be a need to use multiple WSDLs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.