Is it possible to connect one salesforce(EE) org to another salesforce(EE) org using REST API. Please Guide me and give related links.

  • is there any way you can provide an explanation as to what you want to achieve or why you want to do this?
    – Bartley
    Commented Nov 12, 2013 at 10:52

2 Answers 2


Yes. The overall architecture, well.. depends.

You can do it by having an application outside the force.com platform, making REST API calls to Salesforce. You would be needing a Developer Edition org that will be serving as the application's identity endpoint.

  1. Get a Test DE.
  2. In the remote apps section, add a new app.
  3. Fill in O.Auth callback URL. Take the token and secret that Salesforce generates for you and hardcode it in your backend.
  4. Authorize the app to be used by both the EEs.
  5. Now you can make REST API calls to both the EEs and do your thing.
  • @erbdex you mentioned "...hardcode it in your backend..." have you any pointers to this? How would you do this?
    – Bartley
    Commented Nov 12, 2013 at 9:43

You need To create a remote application if you want to call Your Org From other than Salesforce, like cURL, POSTMAN etc., if you want to call Salesforce instance From Salesforce then there will be no use of Remote Application, all you need is to construct a Well Structure Code, for example:

httprequest req= new httprequest();
req.setHeader('Content-Type', 'text/xml;charset=UTF-8');

req.setHeader('SOAPAction', '""');
string body='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><login xmlns="urn:partner.soap.sforce.com"><username>' +'mysfdc.com'+ '</username><password>' + 'mypassword'+ '</password></login></Body></Envelope>';


httpresponse res=new httpresponse();

Using this code you will obtain Status Code 200 and sessionid.

  • It uses Soap Envelope. Any example of pure rest implementation? Commented Aug 4, 2015 at 6:45

You must log in to answer this question.

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