Consuming the TCM v10 Gateway Rest APIs
This article describes the data Integration service used to communicate with the beqom solution using the Gateway REST API.
Authentication
beqom owns an identity provider called Passport to acquire a token that is then used to access all the connected systems or tenants. Use the following method to obtain the access token:
| Endpoint | Action | Input | Body |
|---|---|---|---|
| https://passport.beqom.com/api/auth | POST | - |
Copy |
Output sample
{
"access_token": "eyJ0eXAx4xjnuFwdYh6qBJuN0mXYCiPqm-qqvwrAvxSs",
"token_type": "urn:ietf:params:oauth:token-type:jwt",
"expires_in": 35999,
"refresh_token": null
}Use the access token and pass it to all APIs through the header.
The standard authorization header is the following:
Authorize bearer {authorization token}
Retrieving all tables/views
Use the following method to return all the tables/views in the tenant.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/api/admin/GetTableViewList | GET | Type (nullable) -> “table” or “view” | - |
Sample Output
{
"id": -454,
"supports_datagrid_hierarchy_security": false,
"text": "k_m_field_perspective",
"type": "table"
},
{
"id": -302,
"supports_datagrid_hierarchy_security": false,
"text": "Kernel_View_Admin_UserProfile",
"type": "view"
},
......Reading the data in a table/view
Use the following method to return all records of a selected table/view. Pagination and filtering are also enabled in this endpoint.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/GET/api/data/GetTableViewData | GET |
tableViewId skip, take // For pagination Filter format:
Copy
Filter type:
Copy
|
- |
Sample output
{
"count": 240,
"records": [
{
"band": "Band C",
"base_salary": 64260,
"bonus_split_businessunit_margin": 12,
"bonus_split_businessunit_opex": 6,
"bonus_split_businessunit_revenue": 12,
"bonus_split_division": 40,
"bonus_split_individual": 30,
"bu_margin_attainment": 0.96,
"bu_margin_result": 112824,
],
"_expandable": null
}Adding a single record to a table
Use the following method to insert a record into an existing table.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/POST /api/data/AddTableViewData | POST | tableViewId | New Object Payload |
Adding multiple records to a table/view (bulk insert)
Use the following method to insert multiple records to an existing table.
| Endpoint | Action | Input | Body | Sample output |
|---|---|---|---|---|
| {ServiceURL}/POST /api/Data/AddBulk?tableViewId={tableViewId} | POST | tableViewId | Array of objects | Array of objects |
This bulk operation takes column names from the first record of of the array specified in the body. It then generates an SQL query using columns in the first record and table name in k_referential_tables_views. If there is a difference in column names between records (either column names are different or the number of columns is different), the system then returns the error 500 INTERNAL ERROR.
Updating a record in a table
Use the following method to update a record in an existing table. This method operates at property level. The method will work only if the target is a table.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/PATCH /api/data/UpdateTableViewData | PATCH |
tableViewId recordId |
Patch payload |
Deleting a Record in a Table/View
Use the following method to delete a record in an existing table.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/DELETE /api/data/DeleteTableViewData | DELETE |
tableViewId recordId |
- |
HTTP Output
Standard HTTP output
200 Succeeded
401 Unauthorized
404 Not found
500 Internal error