-
Using SOQL queries in REST API request - Salesforce
Hi everybody,
I am trying to fetch Accounts from another salesforce org by using a httprequest instance. I have obtained the security token from the other org , my code extract for the query is as follows:
{httprequest req = new httprequest();
http testHttp = new http();req.setMethod('GET');
req.setEndPoint('https://ap2.salesforce.com/services/data/v38.0/query/?q=SELECT id,Name FROM Account');
req.setHeader('Authorization','OAuth *Here is the token*');
HttpResponse res = testHttp.send(req); }But it is giving me Error Code: 400
Any suggestions?? Thanks
Log In to reply.
Popular Salesforce Blogs
Salesforce Sales Cloud Implementation - All You Need to Know
You’ve decided to use Salesforce, but now what? What do you need to be aware of? What comes out of the box and what will…
URL Hacking in Salesforce - Episode 1
In Salesforce, the most important and fun interactive way playing with the pre-populated fields is done with the help of URL Hacking. Hey! Hey! Hey!…
3 Hot Trends Secretly Pointing towards Future of CRM
Customer Relationship Management or CRM is the future of the business and is not going to fed so soon. Starting from small businesses to the…
Popular Salesforce Videos
Introducing Salesforce Experience Cloud LWR Sites | Lightning Web Runtime
In the first episode of this series, we'll walk you through what the Build-Your-Own (BYO) LWR template is. Based on our new sample app "AZ…
AppExchange Demo Jam - April 2020
Watch AppExchange apps Lifeguard Solutions, FilePulse, Vonage, Icertis, Taskray, and Salesforce Crisis App from Salesforce Labs demo their technology in three minutes for the audience…
Salesforce Careers: Drive Success Through the Lens of the Customer
Salesforce employs over half of the Technical Architects across the globe and is shaping the future! Visit careers at Salesforce to apply for the Professional…