Using Web APIs¶
You can use the following Web APIs.
- Specify search conditions for the table and get a list of search results
- Fetch one record of table data
- Register one record of table data
- Update one record of table data
- Delete one record of table data
- Bulk registration of table data
- Bulk update of table data
- Registering and updating table data in bulk
- Delete table data in bulk
- Fetch the last modified date of the table (header information only)
- Fetching table data in bulk
Among these, the CELF management tables 'sys_user', 'sys_group', and 'sys_operation_log' can be used for 'retrieving the last update date of the table (header information only)' and 'bulk fetching of table data'. These Web APIs are designed for use with master tables that have infrequent data updates.
The common URL/request/response for each WebAPI¶
This section lists the URL, request headers, and request parameters that are common to all Web APIs, as well as the response headers that may be returned.
URL
URL Description Example CELF Server URL API Server URL https://api.cloud.celf.jp (for Japan Cloud. For other countries, contact your CELF distributor.) Table API Name API name for the target talbe. partners ID ID to match the record in the target table 25 Request headers
Header name Required Description Example X-CELF-API-KEY Required API Key X-CELF-API-KEY: 3fce5122-e14f-4f9a-a687-5e5cd1c4b57f Request parameters
Parameter name Required Description Example company Required(for Cloud version) CompanyID company=SCSK1 Response headers
- If the combination of the company ID and API key is incorrect, it responds with an authentication error 401.
- If a table that is not published is specified, it responds with an authorization error 403.
Specify search conditions for the table and get a list of search results¶
Endpoint
{CELF Server URL}/v1/{table API name}/query
Method
POST
Request parameters
Parameter name Required Description Example limit Optional Number of records to fetch (default is 100) limit=50 offset Optional Number of records to Skip from the Start(default is 0) offset=100 sort Optional Columns to sort sort=tr_name,-registration_date (You can specify multiple column names separated by commas. '+' or no symbol for ascending order, '-' for descending order.) Request body(JSON)
Search condition can be sepcified.For string data, you can specify a partial match, and for other types, you can specify an exact match or range.(Example) When the tr_name column of table includes "Corporation" and the registration date is from April 1, 2022 to March 31, 2023.{ "tr_name": "Corporation", "touroku_date": { "from": "2022/04/01", "to": "2023/03/31" } }Response body (JSON)
Data matching the search criteria is returned in the specified sort order and within the specified range. "total" is the total number of data items matching the search criteria, not the number of items retrieved.(Example) When API name of table is "partners"{ "partners": [ { "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }, { "tr_code": "2222", "tr_name": "Yamakawa Corporation", ・・・ }, ・・・ ], "total": 68 }
Fetch one record of table data¶
Endpoint
{CELF Server URL}/v1/tables/{table API name}/{ID}
Method
GET
Response body (JSON)
Responds with data that has the specified ID.(Example){ "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }
Register one record of table data¶
Endpoint
{CELF Server URL}/v1/tables/{Table API Name}
Method
POST
Request body(JSON)
Request data other than ID, LAST_UPDATER, LAST_MODIFIED which are automatically set in CELF’s table.(Example){ "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }Response body (JSON)
Responds with data that has the specified ID.(Example){ "id": 4 }
Update one record of table data¶
Endpoint
{CELF Server URL}/v1/tables/{table API name}/{ID}
Method
PATCH
Request body(JSON)
Request data other than ID, LAST_UPDATER, LAST_MODIFIED which are automatically set in CELF’s table. Columns not specified will not be changed.(Example){ "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }Response body (JSON)
None
Delete one record of table data¶
Endpoint
{CELF Server URL}/v1/tables/{table API name}/{ID}
Method
DELETE
Response body (JSON)
None
Bulk registration of table data¶
Endpoint
{CELF Server URL}/v1/tables/{Table API Name}/bulkinsert
Method
POST
Request body(JSON)
Request an array of data excluding the ID, LAST_UPDATER, and LAST_MODIFIED automatically set in CELF tables.(Example) When API name of table is "partners"{ "partners": [ { "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }, { "tr_code": "2222", "tr_name": "Yamakawa Corporation", ・・・ }, ・・・ ] }Response body (JSON)
Responds with an array of IDs for the registered data.(Example){ "ids": [ 4, 5, ・・・ ] }
Bulk update of table data¶
Endpoint
{CELF server URL}/v1/tables/{table API name}/bulkupdate
Method
POST
Request body(JSON)
Request an array of data that includes the IDs of the data you want to update.(Example) When API name of table is "partners"{ "partners": [ { "id": 4, "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }, { "id": 7, "tr_code": "2222", "tr_name": "Yamakawa Corporation", ・・・ }, ・・・ ] }Response body (JSON)
None
Registering and updating table data in bulk¶
Endpoint
{CELF server URL}/v1/tables/{table API name}/bulkupsert
Method
POST
Request body(JSON)
Request an array of data that includes the IDs of the data you want to update and an array of data excluding the automatically set ID, LAST_UPDATER, and LAST_MODIFIED in the CELF table as the data you want to register.After updating all the specified data you want to update, the data will be registered.(Example) When API name of table is "partners"{ "partners": [ { "id": 4, "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }, { "tr_code": "2222", "tr_name": "Yamakawa Corporation", ・・・ }, ・・・ ] }Response body (JSON)
Responds with an array of IDs of the registered data. IDs of the updated data will not be responded.(Example){ "ids": [ 8, ・・・ ] }
Delete table data in bulk¶
Endpoint
{CELF server URL}/v1/tables/{table API name}/bulkdelete
Method
POST
Request body(JSON)
Request an array of IDs you want to delete.(Example){ "ids": [ 1, 3, 8 ] }Response body (JSON)
None
Fetch the last modified date of the table (header information only)¶
Endpoint
{CELF Server URL}/v1/tables/{Table API Name}
Method
HEAD
Response body (JSON)
NoneResponse headers
- Responds with the latest date and time of LAST_MODIFIED of the table data in Last-Modified.
Fetching table data in bulk¶
Endpoint
{CELF Server URL}/v1/tables/{Table API Name}
Method
GET
Request parameters
Parameter name Required Description Example limit Optional Number of records to fetch (default is 100) limit=50 offset Optional Number of records to Skip from the Start(default is 0) offset=100 sort Optional Columns to sort sort=tr_name,-registration_date (You can specify multiple column names separated by commas. '+' or no symbol for ascending order, '-' for descending order.) Response body (JSON)
The response is sorted according to the specified range. "total" is the total number of data items, not the number of items retrieved.(Example) When API name of table is "partners"{ "partners": [ { "tr_code": "1111", "tr_name": "Umiyama Corporation", ・・・ }, { "tr_code": "2222", "tr_name": "Yamakawa Corporation", ・・・ }, ・・・ ], "total": 68 }Response headers
- Responds with the latest date and time of LAST_MODIFIED of the table data in Last-Modified.