-
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
Benefits of Salesforce CRM for Insurance Company
In today’s dynamic market, insurance companies need more than just adaptability to stay competitive – they must innovate for long-term success. A powerful tool in…
Salesforce Apex Test Class Best Practices
If you’re planning to get a job as a Salesforce Developer one day, these testing principles are an absolute must learn! To get the minimum…
How to Prepare for Salesforce Data Migration in 2024?
In Customer Relationship Management (CRM), Salesforce is a colossus, offering unparalleled capabilities for managing customer interactions, sales, and marketing. However, the transition to Salesforce, particularly…
Popular Salesforce Videos
Salesforce JavaScript Developer 1 Certification Series
Hi Everyone, SFDC Panther has started the Salesforce JavaScript Certification series and this is the first session. What you will learn: Variables Data Types Operators…
What is Salesforce Roles? Explain in Details
Salesforce Roles deals with the hierarchy of your organizations, So it will actually be based on the record level access and it can override the…
What is Salesforce? Why Salesforce? Salary Expectation | Certification Required
Watch this video and learn all about Salesforce and how to make a career in Salesforce. What is Salesforce? Why Salesforce? Salary Expectation | Certification…