Structure APIs
Get a list of tables that can be queried
Overview
Get a list of all tables that can be queried.
Entry point
GET /api/structure
Authorisation
Use the bearer token obtained from GetBearerToken for authorisation.
Parameters
No parameter needed.
Resource URL
https://{environment}.retaincloud.com/DataAccessAPI/{tenant}/api/structure
Response
If successful, returns the following:
- 200 OK
- Success
- A list of tables
else returns one of the following response codes as a string:
- 400 - Bad request
- 401 - Unauthorised
- 403 - Forbidden
- 404 - Not found
Example response
Returns the following on success:
[
"booking",
"resource",
"job",
...
]
Get a list of tables
Overview
Retrieve a list of tables as rich structures.
Entry point
GET /api/structure/tablestructure
Authorisation
Use the bearer token obtained from GetBearerToken for authorisation.
Parameters
No parameter needed.
Resource URL
https://{environment}.retaincloud.com/DataAccessAPI/{tenant}/api/structure/tablestructure
Response
If successful, returns the following:
- 200 OK
- Success
- a list of tables as structures
else returns one of the following response codes as a string:
- 400 - Bad request
- 401 - Unauthorised
- 403 - Forbidden
- 404 - Not found
Example: Retrieve the structure for all tables
Enter {} in the Request body to retrieve the structure for all tables.
On success, the following will be returned:
[
{
"name": "booking",
"alias": "booking",
"description": "booking",
"explanation": "booking",
"readOnly": false
},
{
"name": "bookingcomment",
"alias": "bookingcomment",
"description": "bookingcomment",
"explanation": "bookingcomment",
"readOnly": false
},
...
]
Get field names of a table
Overview
Gets a list of field names belonging to a table.
Entry point
GET /api/structure/fieldnames
Authorisation
Use the bearer token obtained from GetBearerToken for authorisation.
Path Parameters
Enter the name of the table as a string:
Name | Mandatory | Description | Default value | Example |
---|---|---|---|---|
Table | Yes | Table name | Booking |
Resource URL
https://{environment}.retaincloud.com/DataAccessAPI/{tenant}/api/structure/fieldnames?table=booking
Response
If successful, returns code 200: SUCCESS and a list field names of the table as follows:
[
"booking_guid",
"booking_start",
"booking_end",
"booking_resource_guid",
...
]
If unsuccessful returns the following response codes as a string:
- 400 - Bad request
- 401 - Unauthorised
- 403 - Forbidden
- 404 - Not found
Get info about fields of a table
Overview
Gets field name and field information like datatypes etc. for all the fields belonging to a table.
Entry point
GET /api/structure/fieldstructure
Authorisation
Use the bearer token obtained from GetBearerToken for authorisation.
Path Parameters
Enter the name of the table as a string:
Name | Mandatory | Description | Default value | Example |
---|---|---|---|---|
Table | Yes | Table name | Booking |
Resource URL
https://{environment}.retaincloud.com/DataAccessAPI/{tenant}/api/structure/fieldstructure?table=booking
Response
If successful, returns code 200:SUCCESS and a structure of fields and field info.
else returns one of the following response codes as a string:
- 400 - Bad request
- 401 - Unauthorised
- 403 - Forbidden
- 404 - Not found
Example response
Returns the following structure for every field on success:
[
{
"name": "booking_guid",
"alias": "booking_guid",
"description": "booking_guid",
"explanation": "booking_guid",
"readOnly": true,
"category": "Data",
"dataType": "ID",
"uiFieldCategory": "SystemHidden",
"hideInUI": false,
"linkTable": null,
"linkColumn": null
},
{
"name": "booking_time",
"alias": "booking_time",
"description": "booking_time",
"explanation": "booking_time",
"readOnly": false,
"category": "Data",
"dataType": "Float",
"uiFieldCategory": "SystemRequired",
"hideInUI": false,
"linkTable": null,
"linkColumn": null
},
...
]
Get detailed info about fields of a table
Overview
Gets detailed information about table fields including additional meta-info like defined data limits for all the fields belonging to a table.
Entry point
GET /api/structure/richfieldstructure
Authorisation
Use the bearer token obtained from GetBearerToken for authorisation.
Path Parameters
Enter the name of the table as a string:
Name | Mandatory | Description | Default value | Example |
---|---|---|---|---|
Tablename | Yes | Table name | Booking |
Resource URL
https://{environment}.retaincloud.com/DataAccessAPI/{tenant}/api/structure/richfieldstructure?table=booking
Response
If successful, returns code 200: SUCCESS and a structure of fields and detailed field info
else returns one of the following response codes as a string:
- 400 - Bad request
- 401 - Unauthorised
- 403 - Forbidden
- 404 - Not found
Example response
Returns the following structure for every field on success:
[
{
"name": "booking_guid",
"alias": "Unique system ID",
"description": "",
"explanation": "",
"readOnly": true,
"category": "Data",
"dataType": "ID",
"uiFieldCategory": "SystemHidden",
"hideInUI": false,
"linkTable": null,
"linkColumn": null,
"defaultValues": {
"value": null,
"valueGuid": null,
"isInherited": null
},
"accessLevel": "ReadOnly",
"fieldStorageSize": null,
"mandatory": false,
"min": null,
"max": null,
"iscustom": false,
"fieldtype": "Guid",
"length": null
},
{
"name": "booking_time",
"alias": "hours booked in total",
"description": "",
"explanation": "",
"readOnly": false,
"category": "Data",
"dataType": "Float",
"uiFieldCategory": "SystemRequired",
"hideInUI": false,
"linkTable": null,
"linkColumn": null,
"defaultValues": {
"value": null,
"valueGuid": null,
"isInherited": null
},
"accessLevel": "Editable",
"fieldStorageSize": null,
"mandatory": true,
"min": -2000000000.00000,
"max": 2000000000.00000,
"iscustom": false,
"fieldtype": "Decimal number",
"length": null,
"decimalPlace": null
},
...
]