• rancpine
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi all,     

        Please any one send me the exact code for httprequest with accesstoken to retrive one org date from anothe org. I am sing this but geting respone as Invalid Token (but i ma puting the correct access token). So tell me what i am doing wrong in below code:

 

httprequest hreq=new httprequest();//https://login.salesforce.com/id/00D90000000aSjoEAE/00590000000eb7cAAAhreq.Setendpoint('https://ap1.salesforce.com');hreq.setmethod('GET');hreq.setHeader('Authorization: OAuth ', '00D90000000aSjo!AQgAQNfbCS3aunHX37ko2VhwXzk4holpYFrU9juuCIMdanXC54DAjI916nYNvzZHjOV2vRubCiT1XZGeongMBAVxtdMfpLlN');//hreq.setHeader('Content-Type', 'text/xml;charset=UTF-8');hreq.setHeader('SOAPAction','');hreq.setHeader('Host','https://ap1.salesforce.com');http htp=new http();httpResponse res=htp.send(hreq);system.debug('%%%%%%%%%%%%%' +res);System.debug('@@@@@@@@' +res.getBody());

 Please help me on this.