Contents

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 NameTypeContentExample
diagramId (Required)StringDiagram Id00e77f4dc9973517
command(Required)JsonContents of operations. Text in JSON format.{“operations”:[{“type”:“AddImageUrl”,“parameter”:{“url”:“http://www.nulab.co.jp”}}], “error”:“ignore”}

“command” Parameters

Parameter NameTypeContentExample
operations(Required)ArrayArray 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”:{…}}]
errorStringSpecify 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 NameTypeContentExample
url(Required)StringURL of image.https://nulab.com/
xIntegerX coordinate of inserted image. The value is 0 if this is not specified.10
yIntegerY coordinate of inserted image. The value is 0 if this is not specified.20

Delete object ( type : “DeleteObject” )

Parameter NameTypeContentExample
uid(Required)StringThe 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)StringThe 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

FieldTypeDescriptionExample
tokenStringToken string for ‘automationToken’ parameter of the Editor APIwAHbE0gJ8DgRIUhy

JSON Response Example

{
    "token": "wAHbE0gJ8DgRIUhy"
}

XML Response Example

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