2

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.setMethod('GET');
 eq1.setEndpoint('https://ap1.salesforce.com/services/data/v33.0/query?q=SELECT+id,name,type,description,industry+FROM+account+ORDER+BY+name');

eq1.setHeader('Content-Type', 'application/xml');
//eq1.setHeader('Authorization', acc);
eq1.setHeader('Authorization', 'OAuth '+acc);
Httpresponse hh1 = new HttpResponse();
hh1 = h.send(eq1);
3
  • where you are setting up your acc variable value. i.e. access token
    – Himanshu
    Commented May 17, 2016 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
    Commented May 18, 2016 at 2:00
  • @cropredy I am using connected app of Org A itself .. But.. How to check access token against the org
    – user40138
    Commented May 18, 2016 at 2:47

0

You must log in to answer this question.

Browse other questions tagged .