-
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
9 Books You Need to Study if You Want to Master Salesforce in 2023
Salesforce is a powerful customer relationship management (CRM) platform that has become a staple in the world of business. Whether you're a seasoned Salesforce professional…
Client-Side Validation
Carrying out validation in the browser when a user submits a form is a technique that has been followed by the number of years. The…
Javascript Framework for Lightning Design System
The lightning design system is a very sharp and neat UI. But Salesforce yet not providing any JS framework for SLDS(salesforce lightning design system). I…
Popular Salesforce Videos
Use cases Automation UiPath with Salesforce
The following video demonstrates a UiPath Robot automatically populating Salesforce using data read from an Excel spreadsheet....imagine how UiPath Robots could accelerate your Salesforce activities.…
Knowledge Base in Salesforce Lightning
By end of this video, we will be able to 1. Understand what is knowledge base. 2. Why we need to use Knowledge base 3.…
Salesforce Development and Career Opportunities
Salesforce is the world’s #1 customer relationship management (CRM) platform. Salesforce allows sales reps to see everything about a customer in one place and provide…