Editor automation

Register operations that will be processed automatically when the Editor is opened.

Method

GET, POST

URL

https://cacoo.com/api/v1/diagrams/diagramId/editor/automation.format
Example : https://cacoo.com/api/v1/diagrams/00e77f4dc9973517/editor/automation.json?command={"operations":[{"type":"AddImageUrl","parameter":{"url":"http://www.nulab.co.jp"}}], "error":"ignore"}

Format

json, xml

Authentication

required

Parameters

Parameter Name Type Content Example
diagramId (Required) String Diagram Id 00e77f4dc9973517
command(Required) Json Contents of operations. Text in JSON format. {“operations”:[{“type”:“AddImageUrl”,“parameter”:{“url”:“http://www.nulab.co.jp”}}], “error”:“ignore”}

“command” Parameters

Parameter Name Type Content Example
operations(Required) Array Array of objects for specifying operation. Each object has type and parameter as its property.
Specify operation type for “type” and operation parameters for “parameter”. Refer below for available operation parameters.
[{“type”:“AddImageUrl”,“parameter”:{“url”:“https://nulab.com”, “x”:10, “y”:20}},{“type”:"…",“parameter”:{…}},{“type”:"…",“parameter”:{…}}]
error String Specify the behavior when error occurs during operations. The value is one of “ignore”, “message” or “stop”. When it is not specified, it will behave as “ignore”.
  • ignore - Ignore errors and continue operations.
  • message - Show error message in the Editor then abort operations.
  • stop - Abort operations.

ignore

Add image by URL ( type : “AddImageUrl” )

Parameter Name Type Content Example
url(Required) String URL of image. https://nulab.com/
x Integer X coordinate of inserted image. The value is 0 if this is not specified. 10
y Integer Y coordinate of inserted image. The value is 0 if this is not specified. 20

Delete object ( type : “DeleteObject” )

Parameter Name Type Content Example
uid(Required) String The uid value of object that to be deleted. You can get uid value of object by Diagram Contents API. 8FE31DA2-6396-4872-6A90-F7E710AD035A
sheetUid(Required) String The uid value of sheet which contains the object that to be deleted. You can get uid value of sheet by Diagram Contents API. 3532B

Response

Field Type Description Example
token String Token string for ‘automationToken’ parameter of the Editor API wAHbE0gJ8DgRIUhy

JSON Response Example

{
    "token": "wAHbE0gJ8DgRIUhy"
}

XML Response Example

<?xml version="1.0" encoding="utf-8"?>
<editor>
  <token>wAHbE0gJ8DgRIUhy</token>
</editor>