-
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

How To Plan For A Successful Salesforce Data Migration?
This blog on data migration planning features a brief into towards data migration planning process then it focuses on common data migration issues, the extension…

Enabling and Creating Personal Accounts And Business Accounts in Salesforce
Salesforce accounts are used to store information about customer and entities with which you are working such as government agencies, schools, companies, or individuals. You…

8 Ways CRM Software Can Help Reduce Costs
CRM systems are becoming essential tools for businesses. A recent study by Nucleus Research found that for every dollar invested in CRM, businesses see a…
Popular Salesforce Videos
Transform the Consumer Experience - Salesforce Customer 360 Guide
The Transform the Consumer Experience Customer 360 Guide helps you: Unlock & unify data Personalize digital journeys Go direct to consumers Scale service across channels…
Marc Benioff & Aneel Bhusri On Ensuring a Safe Return to Work | Leading Through Change | Salesforce
In this week’s Leading Through Change, join Aneel Bhusri the Co-Founder and CEO of Workday and Marc Benioff the Chair and CEO of Salesforce as…
Manual & Apex Managed Sharing in Salesforce
In this video, we will talk about Manual Sharing and Apex Managed Sharing. Manual Sharing Manual Sharing is used to share the record Manually. For…