Completely new to the Salesforce API. I'd like to simply download all lead and contact information from a connected user's account - that is, anything which has an "Email" field. I've only briefly used Salesforce before so I may be in way over my head.
I'm currently using the jsForce API wrapper for NodeJS, but everything in the docs seems far too advanced for my needs.
I'm trying to do a request like this:
conn.query("SELECT Id, Name, Email FROM Leads", function(err, result) {
if (err) { return console.error(err); }
console.log("total : " + result.totalSize);
console.log("fetched : " + result.records.length);
console.log(util.inspect(result, false, null));
});
However, this gets me the result:
Object type 'Leads' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.] name: 'INVALID_TYPE', errorCode: 'INVALID_TYPE' }
Knew it wouldn't be that easy. However, looking in my Salesforce account (my organisation is called "Warm") I can see that I do have plenty of leads and they all have email addresses under the column "Email":
Clearly I'm doing something very wrong. I'd like to download all leads, opportunities, contacts, orders etc but I barely know where to start / the Salesforce API docs have been no help at all (I've been reading for a couple of hours but it's all very theoretical and mostly Java based!)
Any idea what I can do to simply bulk download Salesforce data through an oAuth2 authenticated API call?