I have 2 Orgs- Org A & Org B both are ap1 Instance

In Org A I've created a Connected app

In Org B I am trying to Query accounts of Org A From the Connected App Through Http Call, but I am getting the Data of Org B Itself

Is it Because of same Instance of Endpoint Url

Below is My Http Class After Getting the Access Token

 http h = new Http();
 HttpRequest eq1= new HttpRequest();

eq1.setHeader('Content-Type', 'application/xml');
//eq1.setHeader('Authorization', acc);
eq1.setHeader('Authorization', 'OAuth '+acc);
Httpresponse hh1 = new HttpResponse();
hh1 = h.send(eq1);
  • where you are setting up your acc variable value. i.e. access token – Himanshu May 17 '16 at 19:35
  • are you sure when you got your accesstoken that you got it from Org A and not Org B (that is, you didn't self-authorize)? – cropredy May 18 '16 at 2:00
  • @cropredy I am using connected app of Org A itself .. But.. How to check access token against the org – user40138 May 18 '16 at 2:47

Your Answer

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

Browse other questions tagged or ask your own question.