+ Start a Discussion
ashish raiashish rai 

How to make httprequest with access token with example

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  Bad_OAuth_Token. So tell me what i am doing wrong in below code:


httprequest hreq=new httprequest();



hreq.setHeader('Authorization',':OAuth 00D90000000aSjo!AQgAQIRuHIv1pXGwo306PxvZCcgeDp_S__T1jWwarX9KNUzCQO74prs0xPfoE49S7GGHWUkubZlA.q_6N34TPj9036UaPNPt');


http htp=new http();

httpResponse res=htp.send(hreq);
system.debug('%%%%%%%%%%%%%' +res);