-
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 Telephony and VoIP Integration: A Beginner’s Guide
You’re likely using Salesforce’s CRM to manage your communications with leads and customers online—but not all communication occurs through digital methods. If your sales reps…
Salesforce PDO Partner Program 2021: A Guide
Salesforce AppExchange has been a huge hit across its 15-year lifespan and is the key differentiator for Salesforce when it comes to the global CRM…
New URL Format For Salesforce Lightning
This post taks about the upcoming new URL format for Salesforce Lightning experience ans Salesforce mobile. The new URL format will be available to users…
Popular Salesforce Videos
How to Get Jobs or Work Outside India | Salesforce Developer vs Cloud Professional
In this Video Shrey covered answers to the three questions which are: 1. How do you find a job in Salesforce as a fresher or…
How To Use Data Loader In Salesforce - Learn Salesforce Series By Algoworks
Learn how to use Data Loader in Salesforce. In this video, the following points will be covered - 1. Introduction Here you will get a…
Future of Salesforce Job Market | The Shrey Sharma Show
This is the very first episode of The Shrey Sharma Show with Christopher A Hopper. They discussed Salesforce. Below is a list of questions they…