SAP Open Connectors

Salesforce Sales Cloud - Is there an implementation of the Salesforce Query API?

There is an undocumented API on the Salesforce Sales Cloud connector that lets you pass an SOQL query directly to Salesforce. OCNQL (Open Connectors Query Language) supports, for the most part, the most basic functionality of SQL. Typically something like this:

select * from Account where Name = 'TestAccount'

Salesforce actually supports much more than this. Such as aggregate functions like count(Id) and even INNER JOIN and OUTER JOIN.

See this documentation for what salesforce supports:

On SAP Open Connectors, you can use this extra querying functionality through the GET /query api.
The syntax is as follows:

GET /query?q=SELECT count(Id) FROM Contact WHERE name = 'test'&page=1&pageSize=200

GET /query?q=SELECT Amount, Id, Name, (SELECT Quantity, ListPrice, PricebookEntry.UnitPrice, PricebookEntry.Name FROM OpportunityLineItems) FROM Opportunity

This API is undocumented and only available on the Salesforce Sales Cloud connector.

The SFDC connector also supports a raw query endpoint (GET /raw-query) that can be used when nested select statements are required. Similar to the /query resource, this endpoint is not in the API Docs, but is accessible when you make API calls against SFDC connector instances. An example of using this endpoint is: