Skip to main content

ExecuteActionByActionID

Perform action (not recommended)

Description

  • Perform action (old specification)
  • ExecuteAction is recommended。

Method

POST

Request URL Format

/api/v0/items/:item-id/actions/:action-id

URL Params

item-id      : Item ID
action-id : Action ID

Payload

Content-Type : application/json

{
"rev_no":2, // "is_force_update": Optional if true
"is_force_update": true, // Optional if "rev_no" is specified
"datastore_id": "59ad2d890e247927638e7619",
"comment": "comment..."
"item": {
"5a26722e0e24794c979fa5b6": "更新データサンプル", // field_id : Update value
"5ab84bfecce5fe5c983ea184": [ // For user type Field
"58272f4efb90a148d8508d9c", // user_id
"5846636efb90a1024d2982fa" // user_id
],
"5ab0c239cce5fed3a859a910": [ // For attachment file type Field
"5ab84c1fcce5fe5c983ea185", // file_id
"5ab84c1fcce5fe5c983ea186" // file_id
]
},
"access_key_updates": {  // Specify access key
"overwrite": true,  // Overwrite access key (default is false: add to existing key)
"ignore_action_settings": true, // Do not use the public settings set in the action (only the key specified in this payload is given)
"apply_related_ds": true, // Use the same settings for items specified in related_ds_items (if specified individually, the contents will be executed)
"groups_to_publish": ["GROUP1", "GROUP2"], // Specify group display_id (only keys held by execution user can be specified)
"roles_to_publish": ["ADMIN", "MEMBER"], // Specify role display_id (Only keys held by the execution user can be specified)
"users_to_publish": ["607c2a25844887b6855a12a9", "5f25956428dc5c55b463bc77" ] // Specify user_id (a user_id that exists in the workspace can be specified)
}
"related_ds_items" : {
"関連データストアID_1" : [{ },{ },{ },{ }... ] ,
"関連データストアID_2" : [{ },{ },{ },{ }... ]
} // Specify new, update, or delete related datastores. See below for details.
}
  • To update related items at the same time, specify in the following format:
    "related_ds_items" : { // Specify new, update, or delete related datastore
"RELATED_DS_1" : [
{
"operation" : 1, // new
"action_id" : "", // new actionID * can be omitted (if omitted, the default new action will be used)
"item": {
"FIELD_ID1" : "data",
"FIELD_ID2" : "data",
"FIELD_ID3" : "data",
"FIELD_ID4" : "data"
},
"access_key_updates": {  // Specify access keys individually
"overwrite": true,  // Overwrite access key (default is false: add to existing key)
"ignore_action_settings": true, // Do not use the public settings set in the action (only the key specified in this payload is given)
"apply_related_ds": true, // Use similar settings for items specified in related_ds_items
"groups_to_publish": ["GROUP1", "GROUP2"], // Specify group display_id (only keys held by the execution user can be specified)
"roles_to_publish": ["ADMIN", "MEMBER"], // Specify role display_id (only keys held by execution user can be specified)
"users_to_publish": ["607c2a25844887b6855a12a9", "5f25956428dc5c55b463bc77" ] // Specify user_id (A user_id that exists in the workspace can be specified)
},
"related_ds_items" : { // It is also possible to nest related_ds_items. (Multiple nesting of the same Datastore is not possible)
"関連データストアID_3" : [{ },{ },{ },{ }... ] ,
}
},{
"operation" : 2, // update
"action_id" : "", // update actionID ※Can be omitted (if omitted, the default update action will be used)
"i_id" : "58bbaa27fbfcba609874aaa3f", // Target item ID
"item": {
"FIELD_ID1" : "data",
"FIELD_ID3" : "data"
},
"access_key_updates": {  // Specify access keys individually
"overwrite": true,  // Overwrite access key (default is false: add to existing key)
"ignore_action_settings": true, // Do not use the public settings set in the action (only the key specified in this payload is given)
"apply_related_ds": true, // Use similar settings for items specified in related_ds_items
"groups_to_publish": ["GROUP1", "GROUP2"], // Specify group display_id (only keys held by the execution user can be specified)
"roles_to_publish": ["ADMIN", "MEMBER"], // Specify role display_id (Only keys held by the execution user can be specified)
"users_to_publish": ["607c2a25844887b6855a12a9", "5f25956428dc5c55b463bc77" ] // Specify user_id (A user_id that exists in the workspace can be specified)
},
},{
"operation" : 3, // delete
"action_id" : "", // delete actionID * can be omitted (if omitted, the default delete action will be used)
"i_id" : "58bbaa27fbfcba609874aqr45", // Target item ID
},{
// Multiple related items can be specified. sample omitted
},{
// Multiple related items can be specified. sample omitted
},{
// Multiple related items can be specified. sample omitted
}
]
"RELATED_DS_2" : [ // sample omitted ]
"RELATED_DS_3" : [ // sample omitted ]
}
  • rev_no is used for the exclusion check. Specify the rev_no returned in /api/v0/datastores/:datastore-id/items/search. An error will occur if the specified rev_no and the rev_no in the database are different. (exclusion control)

  • If you want to forcibly update the data without checking the rev_no error, set the is_force_update flag to true. In that case, the rev_no field does not need to be specified. It will be overwritten with the last updated data.

  • If the data type of the field is user type and attachment file type, specify the array of user_id and file_id respectively, for value.

  • If the data type of the field is date, specify it in the following format:

    yyyy-mm-ddThh:mm:ss.SSSZ (.SSS can be omitted)

    Specify UTC time for the time specified between TZ

    Example) 2018年1月11日 to specify、"2018-01-10T15:00:00.000Z"

  • Values for updating can also be specified as an array to the changes property.

"changes": [
{
"id": "5a26722e0e24794c979fa5b6",
"value": "更新データサンプル"
},
{
"id": "5ab84bfecce5fe5c983ea184", // user type Fieldの場合
"value": [
"58272f4efb90a148d8508d9c", // user_id
"5846636efb90a1024d2982fa" // user_id
],
},
{
"id": "5ab0c239cce5fed3a859a910", // attachment file type Fieldの場合
"value": [
"5ab84c1fcce5fe5c983ea185", // file_id
"5ab84c1fcce5fe5c983ea186" // file_id
],
},
]

Request URL Sample

POST https://api.xxx.com/api/v0/items/5a2671ef0e24794cb08e6200/actions/5a2671ec0e24794c979fa5b1

Response Sample

null