-
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: Streamline Your Sales Process for Success
In today's highly competitive business landscape, optimizing sales processes is crucial for organizations to stay ahead. Salesforce Sales Cloud, a leading customer relationship management (CRM)…
Public Groups in Salesforce - The Complete Developer Guide
A public group can be defined as a collection of individual users, other groups, individual roles, and/or roles with their subordinates that all have a…
Popular Salesforce Videos
Salesforce Sales Cloud Implementation
There are many things to take into consideration when developing and deploying a Salesforce Sales Cloud implementation that will take your business to the next…
Salesforce Training Videos 1 for beginners with RealTime Projects Salesforce Demo
This video explains what a primary level person should be doing after getting any Salesforce Project. What should be steps for the same.
Creating a Rollup Using DLRS | Salesforce Tutorial
In certain situations, an object does not support a roll-up, or the relationship is not permitted. Learn how to make it possible by using the…