trocco API Integration
- 07 Dec 2022
- 3 Minutes to read
-
Print
-
DarkLight
trocco API Integration
- Updated on 07 Dec 2022
- 3 Minutes to read
-
Print
-
DarkLight
This is a machine-translated version of the original Japanese article.
Please understand that some of the information contained on this page may be inaccurate.
summary
You can use some of trocco's functions using the API.
Issuing an API Key
- Click API KEY Settings from the settings at the top right of the trocco top screen to open the API KEY list screen.
- Issue an API key from Create New in the upper right.
Authentication methods
Authenticate by specifying the API key in the Authorization header.
example
$ curl -X POST https://trocco.io/api/jobs?job_definition_id=<転送設定ID>
-H "Authorization: Token <APIキー>"
Run Job API
POST /api/jobs
parameter
Parameter Name | Type | Description |
---|---|---|
job_definition_id | int | This is a required parameter. Specify the transfer setting ID. |
context_time | String | If you use the custom variable **Time and Date (when queuing)** in the transfer settings, you can specify the date and time to be expanded. Specify the following form: YYYY-MM-DD HH:MM:SS. Example: 2019-11-18 00:00:00 The timezone is JST Japan time (GMT+9). If not specified, the date and time of the API request are used. |
custom_variables | Array of Custom Variable<name, value> | You can specify custom variables. name: Custom variable name (e.g. value: The value of the custom variable |
response
Item Name | Type | Description |
---|---|---|
id | int | This will be the ID of the job. |
job_definition_id | int | It will be the ID of the forwarding settings. |
job_definition_name | String | This is the name of the transfer setting. |
status | String | This is the status of the job. The following statuses exist: ・ queued ... Waiting to be executed ・ setting_up ... Execution readiness ・executing ... Running state ・Interrupting ... Execution suspended state ・succeeded ... Execution completed (success) state ・ Error ... Execution completed (error) state ・ canceled ... Execution completed (canceled) state ・Skipped ... Execution completed (skipped) state |
created_at | timestamp | This is the date and time that the transfer job was created. |
example
$ curl -X POST https://trocco.io/api/jobs?job_definition_id=<転送設定ID>
-H "Authorization: Token <APIキー>"
-d "context_time=<展開時刻>"
-d "custom_variables[][name]=$ad_id$"
-d "custom_variables[][value]=A0000"
Check Job Status API
GET /api/jobs/<Job ID>
response
Item Name | Type | Description |
---|---|---|
id | int | This will be the ID of the job. |
job_definition_id | int | It will be the ID of the forwarding settings. |
job_definition_name | String | This is the name of the transfer setting. |
status | String | This is the status of the job. The following statuses exist: ・ queued ... Waiting to be executed ・ setting_up ... Execution readiness ・executing ... Running state ・Interrupting ... Execution suspended state ・succeeded ... Execution completed (success) state ・ Error ... Execution completed (error) state ・ canceled ... Execution completed (canceled) state ・Skipped ... Execution completed (skipped) state |
started_at | timestamp | This is the transfer start date and time of the transfer job. * If the job is incomplete, it will not be included in the response. |
finished_at | timestamp | This is the transfer end date and time of the transfer job. * If the job is incomplete, it will not be included in the response. |
created_at | timestamp | This is the date and time that the transfer job was created. |
example
$ curl -X GET https://trocco.io/api/jobs/<ジョブID>
-H "Authorization: Token <APIキー>"
Workflow Job Execution API
POST /api/pipeline_jobs
parameter
Parameter Name | Type | Description |
---|---|---|
pipeline_definition_id | int | This is a required parameter. Specify the workflow definition ID. |
context_time | String | If you use the custom variable **Time and Date (when queuing)** in the forwarding settings, you can specify the date and time to be expanded. Specify YYYY-MM-DD HH:MM:SS. Example: 2019-11-18 00:00:00 The timezone is JST Japan time (GMT+9). If not specified, the date and time of the API request are used. |
response
Item Name | Type | Description |
---|---|---|
id | int | This will be the ID of the job. |
pipeline_definition_id | int | This will be the ID of the data mart definition. |
name | String | This is the name of the data mart definition. |
status | String | This is the status of the job. The following statuses exist: ・ queued ... Waiting to be executed ・ setting_up ... Execution readiness ・executing ... Running state ・Interrupting ... Execution suspended state ・succeeded ... Execution completed (success) state ・ Error ... Execution completed (error) state ・ canceled ... Execution completed (canceled) state ・Skipped ... Execution completed (skipped) state |
created_at | timestamp | This is the date and time the workflow job was created. |
started_at | timestamp | This is the start date and time of the workflow job. |
finished_at | timestamp | This is the completion date and time of the workflow job. |
context_time | timestamp | If you use the custom variable [Time and date (when queuing)** in the workflow settings, it will be expanded based on this date and time. |
example
$ curl -X POST https://trocco.io/api/pipeline_jobs?pipeline_definition_id=<ワークフロー設定ID>
-H "Authorization: Token <APIキー>"
-d "context_time=<展開時刻>"
Check Workflow Job Status API
GET /api/pipeline_jobs/<Job ID>
response
Item Name | Type | Description |
---|---|---|
id | int | This will be the ID of the job. |
pipeline_definition_id | int | This will be the ID of the data mart definition. |
name | String | This is the name of the data mart definition. |
status | String | This is the status of the job. The following statuses exist: ・ queued ... Waiting to be executed ・ setting_up ... Execution readiness ・executing ... Running state ・Interrupting ... Execution suspended state ・succeeded ... Execution completed (success) state ・ Error ... Execution completed (error) state ・ canceled ... Execution completed (canceled) state ・Skipped ... Execution completed (skipped) state |
created_at | timestamp | This is the date and time the workflow job was created. |
started_at | timestamp | This is the start date and time of the workflow job. |
finished_at | timestamp | This is the completion date and time of the workflow job. |
context_time | timestamp | If you use the custom variable [Time and date (when queuing)** in the workflow settings, it will be expanded based on this date and time. |
example
$ curl -X POST https://trocco.io/api/pipeline_jobs?pipeline_definition_id=<ワークフロー設定ID>
-H "Authorization: Token <APIキー>"
-d "context_time=<展開時刻>"
Was this article helpful?