6 Query API

Warning: Ignore this page and refer to the following topic if you plan to use the query API without username and password and log-in using federated authentication instead.

6.1 Making an API Call

The Query API works with POST HTTP requests. A server call should follow the template:

URL Parameters

Parameter Description Type Required Example
user The user name. String Required myUserName
account The name of the account for which the request is being made. String Required myAccountName
company The name of the company. String Required myCompanyName
dtos The data transfer object/s and their version being queried.

Please note how this text is constructed:
Resource1.Version;Resource2.Version;....;ResourceN.Version
String Required BusinessPartner.17;ServiceCall.17

Headers

Header Description Required Example
X-Request-ID Request id for request tracing, helps to idientiy your request in the system Optional 825adf80-9f1e-4e7d-90-704818fb2e00
X-Client-ID Your client identifier. For information on generating client ID and secret, refer to the following. Required COR_CONNECTOR
X-Client-Version Your client version Required 0.0.1
Authorization OAuth 2.0 token. Required bearer <access_token>

Example

We want to get the first three pairs of (Business Partner , Service Call). In each pair there is this relation:

The Service Call is connected to its Business Partner by bp=sc.businessPartner


Request

POST https://et.dev.coresuite.com/api/query/v1?&account=scribe&company=Ambit%20AG&clientIdentifier=COR_CON_NONE?dtos=BusinessPartner.17;ServiceCall.17

POST request body (application/json)

{"query":"SELECT bp.id, bp.name, sc.id FROM BusinessPartner bp JOIN ServiceCall sc ON bp=sc.businessPartner LIMIT 3"}


6.2 Query API Guide

For information on supported clauses and functions, please refer to the following guide:

Writing Queries