-
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
What is Salesforce Financial Services?
If you work in the financial sector and you like Salesforce as much as we do, it’s likely you’ve heard of the Financial Services Cloud.…
Salesforce Data Cloud: Features & Use Cases
Salesforce Data Cloud, formerly known as Salesforce Data.com, is a robust data-as-a-service platform provided by Salesforce, one of the world’s leading customer relationship management (CRM)…
Understanding Decorators and Lifecycle Hooks in Lightning Web Components (LWC)
Lightning Web Components (LWC) have revolutionized the way we build user interfaces in Salesforce. They offer a powerful way to create interactive and responsive web…
Popular Salesforce Videos
Salesforce Field Service Scheduling Optimization | AblyPro Webinar
Revolutionize and Level Up Your Game in Services Business With Field Service With Salesforce Field Service on your side, businesses can reduce travel time, improve…
What is Billing - Salesforce Revenue Cloud
How can you transform your billing system for subscription and usage models? By dropping your legacy systems and streamlining your processes. In this video, learn…
Top 5 Features Salesforce Winter Release '21
Even though we're in the middle of one of the strangest summers in our lives, we can rely on one constant: releases from Salesforce. It's…