API Overview
This page gives an overview of APIs.
1. Introduction
You can query or manipulate any data on the Cinchy Platform using the Cinchy Query Language (CQL). You can then save that as a Saved Query which allows it to be accessed via an API endpoint.
You will need to first a Cinchy bearer token (see Authentication), and then you can either access a pre-defined Saved Query via the Saved Query endpoints, or perform freeform querying via the ExecuteCQL endpoint.
Note that regardless of how you query or manipulate data on the platform, it is always associated back to an account.
2. Master List of Endpoints
The following is a list of common API endpoints. These follow the format of <baseurl>/endpoint
2.1 /admin/index
Description |
---|
This endpoint will bring you to a page with your logs and health check. |
2.2 /apps/modelloader
Description |
---|
This endpoint will open the model loader. |
2.3 /healthcheck
Description |
---|
This endpoint will bring you to a page with your platform health check. |
2.4 /metaforms/healthcheck
Description |
---|
This endpoint will bring you to a page with your Meta-Forms health check. |
2.5 /cache/clear
Description |
---|
This endpoint will delete your platform cache data. |
2.6 /API/ExecuteCQL
POST: https://<Cinchy Web URL>/API/ExecuteCQL
Description |
---|
You can execute CQL directly without creating a Saved Query using the below endpoint: |
Query Parameters:
Name | Data Type | Description |
---|---|---|
CompressJSON | boolean | Default is true. Add this parameter and set to false if you want the JSON that is returned to be expanded rather than having the schema being returned separately. |
ResultFormat | string | XML JSON CSV TSV PSV PROTOBUF |
Type | string | QUERY - Query (Approved Data Only) DRAFT_QUERY - Query (Include Draft Changes) SCALAR - Scalar NONQUERY - Non Query, such as an insert or delete VERSION_HISTORY_QUERY - Query (Include Version History) |
ConnectionId | string | |
TransactionId | string | When one or more requests share the same TransactionId, they are considered to be within the scope of a single transaction. |
Query | string | The CQL query statement to execute |
Parameters | boolean | See below on format for the parameters. |
SchemaOnly | integer | Defaults to false. |
StartRow | integer | When implementing pagination, specify a starting offset. Combine with |
RowCount | integer | When implementing pagination, specify the number of rows to retrieve for the current page. Combine with |
CommandTimeout | string | Use this parameter to override the default timeout (30s) for long running queries. In seconds. |
UserId | string | ID of a user with authorization to run the saved query. |
Header Parameters:
Name | Data Type | Description |
---|---|---|
Authorization | string | Bearer <access_token> The access token can be either a Bearer token or a Personal Access token. See Authentication for details. |
Responses:
200 (OK)
Parameters
To pass in parameters in your executeCQL, you will need to pass in sets of parameters in the following format. So if you have one parameter then you would pass in 3 query parameters beginning with Parameters[0].
, and if you have a second parameter you would include an additional 3 query parameters beginning with Parameters[1].
.
Query String Parameter Name | Content |
---|---|
Parameters[n].ParameterName | Name of the parameter that is in your query, including the '@'.
Ex. |
Parameters[n].XmlSerializedValue | XML Serialized version of the value of that parameter.
Ex. |
Parameters[n].ValueType | Datatype of the value.
Ex. |
GET: https://<Cinchy Web URL>/API/MyDomain/MyQuery
Description |
---|
You can use this endpoint to access your Cinchy Saved Queries via API. To access any Cinchy Saved Query API, pass the access token, received from either the Bearer Token Request or created as a PAT, in the Authorization header, prefixed by "Bearer". For more information, see here. |
Query Parameters
Name | Data Type | Description |
---|---|---|
WrapSingleRecordInArray | boolean | Default is true. Add this parameter and set to false if you want single record results returned as an object instead of within an array. |
@param | string | If you have parameters in your query, you pass them indirectly as query parameters. |
CompressJSON | boolean | Default is true. Add this parameter and set to false if you want the JSON that is returned to be expanded rather than having the schema being returned separately. |
Header Parameters
Name | Data Type | Description |
---|---|---|
Authorization | string | Bearer <access_token> The access token can be either a Bearer token or a Personal Access token. See Authentication for details. |
Responses
200: The request has successfully returned the record set.
400: The request could not be understood, the client is sending a request with incomplete data, poorly constructed data or invalid data.
Optional Validation Logic: To validate query business / control conditional logic failure can be added at the beginning of the API which can intentionally generate a 400 error code (using RAISERROR) and stopping (using RETURN) the API. If there is no RETURN the errors will accumulate and will be provided at the end of running the API.
An attribute (X-Cinchy Error) will be returned in the HTTP header with the custom RAISERROR message indicated (see example)
401: The saved query API endpoint will return a 401 error code when you provide invalid credentials, this includes not providing credentials, expired credentials and incorrect credentials.
POST: https://<Cinchy SSO URL>/identity/connect/token
Definition |
---|
The Post Request will return an access token which can be used to access Cinchy APIs. |
Header Parameters
Name | Data Type | Description |
---|---|---|
Content-type | string | application/x-www-form-urlencoded |
Body Parameters
Name | Data Type | Description |
---|---|---|
Token | string | You can pass in your base64 encoded SAML token instead of your Cinchy username and password |
Client_id | string | Client Id value from Integrated Clients table |
Client_secret | string | Guid value from Integrated Clients table |
Username | string | Username of Cinchy user |
Password | string | Password for Cinchy user in plain text |
Grant_Type | string | Set as "password" for username/password authentication. Set as "saml2" for saml token authentication. |
Scope | string | Set as "js_api" |
Responses
200: The request is successful
400: For invalid parameters, a 400 error will be returned with the following JSON response with a description of the error.
2.9 /api/getstsauthorityuri
Description |
---|
This will return your IDP URL endpoint. |
2.10 /api/jobs
POST: https://<Connections-URL>/api/jobs
Description |
---|
This endpoint can be used to trigger a batch data sync job that has been configured in Cinchy. |
Request Header Parameters
Name | Data Type | Description |
---|---|---|
Authorization | string | Bearer <access_token> Note that this endpoint does not support Personal Access Tokens. See Authentication for details. |
Content-Type | String | multipart/form-data |
Body Parameters
Note that the parameter names "files" and "options" are both case sensitive and must use lowercase in your JSON. The contents of the parameters themselves are not case sensitive.
Name | Data Type | Description |
---|---|---|
files | binary | The URL to any file(s) needed to be uploaded to be used in place of a parameter in the data sync |
options | string | A JSON string of the data sync options. See here for the structure of this JSON string. |
Options - JSON Structure
Endpoint Example
Responses
200: The request was successful.
400: The request could not be completed.
Last updated