There are various APIs available and supported by Cinchy, each performing important functions for your use cases.
For example, using the MyQuery API will allow you to turn any Saved Query on your platform into a REST API.
Many of the APIs listed on this page can utilize Bearer Tokens or Personal Access Tokens to authenticate. Please review the API Authentication page for further information.
2. Master List of Endpoints
The following is a list of common API endpoints. These follow the format of <baseurl>/endpoint
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]. .
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)
Example:
--given the following CQL used within a saved query:
IF (ISNULL(@Int,0) = 0)
BEGIN
RAISERROR('Invalid parameter: @Int cannot be NULL or zero',18,0)
RETURN
END
IF (ISNULL(@String,'') = '' OR ISNULL(@String,'') = 'X')
BEGIN
RAISERROR('Invalid parameter: @String cannot be NULL or empty or X',18,0)
RETURN
END
--note "X-Cinchy-Error" in the sample response:
< HTTP/1.1 400 Bad Request
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Server: Microsoft-IIS/10.0
< X-AspNetMvc-Version: 5.2
< Access-Control-Allow-Origin: *
< X-Cinchy-Error: Invalid parameter: @Int cannot be NULL or zero
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Wed, 1 Aug 2020 17:43:04 GMT
< Content-Length: 4517
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.
400: For invalid parameters, a 400 error will be returned with the following JSON response with a description of the error.
Example:
{
"error": "invalid_grant",
"error_description": "Invalid username or password"
}
2.9 /api/getstsauthorityuri
2.10 /api/jobs
POST: https://<Connections-URL>/api/jobs
Request Header Parameters
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.
Options - JSON Structure
{"paramValues": {"<name of parameter in sync>": {"isFile": <set to true if this parameter corresponds to a file, otherwise set it to false>, "value": "<value of the parameter, if the parameter corresponds to a file, then it should match the file name that was uploaded>"
} },"server":"<cinchy url without protocol>","useHttps": <true or false, depending on the server's protocol>, "userId": "<username of the user you want to run the data sync as, leave as null if you want to run it as the user associated with the access token used in the Authorization header>",
"password": "<password of the user you want to run the data sync as, leave as null if you want to run it as the user associated with the access token used in the Authorization header>",
"model":"Cinchy","feed":"<name of the data sync configuration>", "batchsize": <Set to 5000 for the default behaviour - the size of the batches when performing inserts/updates/deletes in the target, set to 5000 if you want the default behaviour>,
"retrievalbatchsize": <Set to 5000 for the default behaviour - this is the size of the batches when retrieving records from the source to process>,
"writeToFile": <Set to true for the default behaviour - This will ensure it will write records to temp files on disk to save memory on larger syncs. If this is set to false, it'll store source records in memory, which will be faster for smaller data syncs>
}
{
executionId = "<The Cinchy Id of the data sync execution, it will correspond go the Cinchy Id of the newly created record in the [Cinchy.[Execution Log] table>"
}
400: The request could not be completed.
{
status = <Http status code>,
message = "<Error message>"
}
This endpoint will bring you to a page with your logs and health check.
This endpoint will open the model loader.
This endpoint will bring you to a page with your platform health check.
This endpoint will bring you to a page with your Meta-Forms health check.
This endpoint will delete your platform cache data.
You can execute CQL directly without creating a Saved Query using the below endpoint:
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 to set the size of the data window.
RowCount
integer
When implementing pagination, specify the number of rows to retrieve for the current page. Combine with StartRow to set the paging position.
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.
Name of the parameter that is in your query, including the '@'.
Ex. @name
Parameters[n].XmlSerializedValue
XML Serialized version of the value of that parameter.
Ex. "test"
Parameters[n].ValueType
Datatype of the value.
Ex. System.String
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".
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.