Is it possible to connect one salesforce(EE) org to another salesforce(EE) org using REST API. Please Guide me and give related links.
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.
- Get a Test DE.
- In the remote apps section, add a new app.
- Fill in O.Auth callback URL. Take the token and secret that Salesforce generates for you and hardcode it in your backend.
- Authorize the app to be used by both the
- Now you can make
REST APIcalls to both the EEs and do your thing.
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.setMethod('POST'); req.setTimeout(60000); req.setEndpoint('https://www.salesforce.com/services/Soap/u/22.0'); 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>'; req.setBody(body); httpresponse res=new httpresponse(); res=p.send(req);
Using this code you will obtain Status Code 200 and sessionid.