Methods are provided for creating, deleting, loading, updating, and retrieving information about records:
For information on locating records via methods other than numeric ID, see the Find section.
Note: This API expects and returns dates/times in the format of MDCY and HJMST. I.e., MM/DD/CCYY h|hh:mm:ss.ttt (24 h) (ttt are milliseconds). Hours can be either one or two digits. (See c-treeDB Date Formats and c-treeDB Time Formats for details and alternative formats.)
Add a new record to the specified table in the specified database.
Type: POST
URL: /ctree/api/v1/record/{db}/{table}
Parameters:
Body:
A JSON string containing one object or an array of objects to create multiple records. Each object will consist of field names and associated values.
{
"field1": "This is the field value",
"field2": 39,
"field3": "Another field value"
}
OR create multiple records at a time by using an array of objects:
[
{
"field1": "String value",
"field2": 39
},
{
"field1": "Other string value",
"field2": 40
}
]
Example:
POST https://localhost:8443/ctree/api/v1/record/ctreeSQL/part
[
{
"part_name" : "Wide Angle lens",
"part_description" : "28mm equivalent, fixed focus",
"part_number" : 1395
},
{
"part_name" : "Image Sensor",
"part_description" : "10MP CCD with controller",
"part_number" : 1394
}
]
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Responses:
{
"_ids": [
1,
2
]
}
Delete a record by specified ID from the specified table and database.
Type: DELETE
URL: /ctree/api/v1/record/{db}/{table}/{id}
Parameters:
Example:
DELETE https://localhost:8443/ctree/api/v1/record/ctreeSQL/part/1234
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Responses:
Get a single record specified by ID from the specified table and database. See the Find section for other ways to find records.
Type: GET
URL: /ctree/api/v1/record/{db}/{table}/{id}
Parameters:
Example:
GET https://localhost:8443/ctree/api/v1/record/ctreeSQL/part/2
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Responses:
{
"part_number": 1395,
"part_name": "Wide Angle lens",
"part_description": "28mm equivalent, fixed focus"
}
Update an entire existing record specified by ID from the specified table and database. All fields will be changed. Included fields will be set to the supplied values, fields not included in the body will be set to null.
Type: PUT
URL: /ctree/api/v1/record/{db}/{table}/{id}
Parameters:
Body:
A JSON string consisting of field names and associated values:
{
"field1": "This is the field value",
"field2": 39,
"field3": "Another field value"
}
Example:
PUT https://localhost:8443/ctree/api/v1/record/ctreeSQL/part/1
{
"part_name" : "Wide Angle lens",
"part_description" : "17mm equivalent, manual focus",
"part_number" : 1395
}
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Responses:
Update a record specified by ID within the specified table and database. Only included fields will be changed. Fields not included in the body will be left as-is.
Type: PATCH
URL: /ctree/api/v1/record/{db}/{table}/{id}
Parameters:
Body:
JSON list of property/value pairs of fields in the record or an array of records:
{
field1: "New value"
}
Example:
PATCH https://localhost:8443/ctree/api/v1/record/ctreeSQL/part/1
{
"part_description" : "17mm equivalent, auto focus"
}
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Responses: