-
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 Winter '23 Marketing Updates
Let's take a look at the marketing updates that have been introduced in the Salesforce Winter '23 release. Marketing Cloud Account Engagement (Pardot) Automate Tasks…
Salesforce Spring '25 Release: Key Enhancements You Need to Know
Unlocking the Power of Salesforce Spring '25 Release: Key Enhancements You Need to Know The Salesforce ecosystem is continuously evolving, introducing powerful new features with…
Salesforce Lightning Experience – Five Tips for Salespeople
Customer relationship management (CRM) was revolutionized when Salesforce was released. Today, it remains one of the most prominent names in CRM software, primarily because of…
Popular Salesforce Videos
Salesforce Web-to-Case in under 5 Minutes
we'll see how to make a Salesforce Web-to-Case form quickly and easily, and how to embed it in our Word press website. This whole process…
Building a Custom UI with Lightning Web Components | Salesforce Tutorial
Lightning Web Components is a modern JavaScript framework that leverages the web standards breakthroughs over the past few years. Watch this session to understand how…
How To Use Salesforce Campaigns in Pardot
Learn campaign basics to help you plan your marketing strategy. In this video, Pardot experts guide you in: - Defining campaigns in Pardot and Salesforce…