-
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
The What, Why, and How of Salesforce Change Management
If you are introducing new features or processes to a Salesforce instance, then you might make or break the system. In the contemporary business environment,…
How to add Visualforce Web tabs in Salesforce1 mobile?
We all know that the Web tab is not working inside the Salesforce1 Mobile Navigation Bar. Therefore, we need to create a Visualforce page. I…
Top 12 Salesforce Winter ’19 Features
It’s been a busy month for Salesforce. With the most awaited, world’s greatest tech conference, Dreamforce 2018 unveiling today and the launch of Winter ’19 Release, we are…
Popular Salesforce Videos
AI Cloud: Explore the GPTs of Salesforce
Discover how GPTs, or Generative Pre-trained Transformers, are revolutionizing the way we interact with AI. We break down the complex jargon and show you how…
Salesforce Demo - Sales Dashboard Example
Our team created a comprehensive sales dashboard for one of our clients. We're posting this video about it to generate feedback and additional ideas for…
Create Digital-First Customer Experiences I Salesforce Industries
Attract new customers, grow relationships, and drive revenue using data-driven personalization for every moment in the customer journey. Watch this video to learn how to…