You need to sign in to do that
Don't have an account?
How can we access REST Api build in Salesforce Developer Org into Another SFDC Org
I have written this REST class in SFDC developer Org. And I am able to access this REST callout thorugh workbench.developerforce.com using this URL
REST URL=
/services/apexrest/StakkonForce/v1.0/MYCALL/getAccountRecords
===================================================================================================
//Apex Class:
@RestResource(urlMapping='/v1.0/MYCALL/*')
global without sharing class MyRestWs{
@HttpGet
global static List<Account> getListOfAccount() {
RestRequest request = RestContext.request;
RestResponse response = Restcontext.response;
String operation = request.requestURI.substring(request.requestURI.lastIndexOf('/getAccountRecords')+1);
String resource = operation.split('/').get(0);
list<Account> lstAccount=new list<Account>();
if(resource == 'getAccountRecords') {
lstAccount= [ Select ID, Name, Phone, BillingState from Account limit 100];
}
return lstAccount;
}
}
===========================================================================================
I wanted to Access this above REST call out from different sfdc Developer Org.
Please provide me some sample code And Steps.
Thanks in advance.
http://shivasoft.in/blog/salesforce/getting-record-from-one-salesforce-organization-to-other/
please gothroug this link it may help
All Answers
Hi,
I can give you code for sure. But to access this rest endpoint from other salesforce org, you will need session Id of one of user on org1. How will you accomplish this?
Hi,
You can use below code snippet to try this:-
But can you please let me know can we access this using SFDC OAuth2.0
using access Token?
For OAuth we need to have Security key and Pass code.
Image
Please see this
How can we access using thi API OAuth
API (Enable OAuth Settings)
Hi Amul,
Read the article on Salesforce as an Identity Provider for Customer Portal - you can have users in one org logging into another, either as portal/community users, or internal users. In either case, you get an access token (accessible via AuthToken.getAccessToken) in the 'target' org that you can use in REST calls to the 'source' org.
Cheers,
Pat
Thank you so much Pat.
http://shivasoft.in/blog/salesforce/getting-record-from-one-salesforce-organization-to-other/
please gothroug this link it may help