図の内容取得

図の内容を返します。

メソッド

GET

URL

https://cacoo.com/api/v1/diagrams/diagramId/contents.xml
例 : https://cacoo.com/api/v1/diagrams/00e77f4dc9973517/contents.xml

フォーマット

xml

認証

必須

エラー

ステータスコード メッセージ 内容
403 OLDER_FORMAT 2012年9月27日以前に保存した図では、HTTPステータスコード:403を返します。一度図を開いて保存し直してください。

パラメーター

パラメータ名 内容
diagramId(必須) 文字列 図のID 00e77f4dc9973517
returnValues 文字列 取得したい値の種類を指定します。
以下の値をカンマ区切りで指定してください。
textStyle, shapeStyle, uid, position, point
uid,textStyle

レスポンス例 ( returnValuesはなし)

<?xml version="1.0" encoding="utf-8"?>
<diagram>
  <sheet name="sheet1">
    <group attr-stencil-id="10000">
      <polygon/>
      <text/>
    </group>
    <group attr-stencil-id="10003">
      <polygon/>
      <text>circle</text>
    </group>
    <group attr-stencil-id="10006">
      <polygon/>
      <text/>
    </group>
    <line/>
    <image source-id="53f05a8df688217ebd37ec69a26846379f4f0a7afab8a759c6dd42ac1cd00882"/>
  </sheet>
  <sheet name="background">
    <group attr-stencil-id="10000">
      <polygon/>
      <text/>
    </group>
  </sheet>
</diagram>

基本の要素と属性

要素 (Element) 説明 属性 (Attributes) 子要素
diagram ルート要素 sheet
sheet シート
  • name ( シート名 )
group, polygon, text, line, image
group グループ
  • attr-stencil-id ( ステンシルID )
  • attr-xxxxx ( カスタム属性 )

group, polygon, text, line, image
polygon ポリゴン
  • attr-xxxxx ( カスタム属性 )
line
  • attr-xxxxx ( カスタム属性 )
text テキスト
  • attr-xxxxx ( カスタム属性 )
[テキストの値]
image 画像
  • source-id ( 画像取得するためのID。 貼付け画像取得API参照。 )
  • attr-xxxxx ( カスタム属性 )

Stencil IDは、図に使われているステンシルを区別するIDです。 X年X月X日以前に図に追加したステンシルはこのIDは設定されていません。 このIDを取得したい場合は、ステンシルパネルからドラッグ&ドロップし直してください。 また、グループ化解除した場合は値が消えますのでご注意ください。 Attributeはインスペクタパネルの一番右のタブで設定した値です。ここには自由に値を設定し、このAPIで取得することができます。

レスポンス例 (returnValues=textStyle)

<?xml version="1.0" encoding="utf-8"?>
<diagram>
  <sheet name="sheet1">
    <group attr-stencil-id="10000">
      <polygon/>
      <text h-align="center" v-align="middle">
        <textStyle font="Arial" color="#000000" size="12" italic="false" underline="false" weight="normal"/>
      </text>
    </group>
    <group attr-stencil-id="10003">
      <polygon/>
      <text h-align="center" v-align="middle">
        <textStyle font="Arial" color="#000000" size="12" italic="false" underline="false" weight="normal">
          circle
        </textStyle>
      </text>
    </group>
    <group attr-stencil-id="10006">
      <polygon/>
      <text h-align="center" v-align="middle">
        <textStyle font="Arial" color="#000000" size="12" italic="false" underline="false" weight="normal"/>
      </text>
    </group>
    <line/>
    <image source-id="53f05a8df688217ebd37ec69a26846379f4f0a7afab8a759c6dd42ac1cd00882"/>
  </sheet>
  <sheet name="background">
    <group attr-stencil-id="10000">
      <polygon/>
      <text h-align="center" v-align="middle">
        <textStyle font="Arial" color="#000000" size="12" italic="false" underline="false" weight="normal"/>
      </text>
    </group>
  </sheet>
</diagram>

textStyle指定時に得られる要素と属性

要素 (Element) 説明 属性 (Attributes) 子要素
text テキスト
  • h-align ( “left”
“center”
textStyle テキストスタイル
  • font
  • color
  • size
  • italic ( “true”
“false” )
  • underline ( “true”
  • レスポンス例 (returnValues=shapeStyle)

    <?xml version="1.0" encoding="utf-8"?>
    <diagram>
      <sheet name="sheet1">
        <group attr-stencil-id="10000">
          <polygon fill-style="singleColor" fill-color="#ffffff" fill-opacity="50.0" border-style="normal" border-color="#ed4580" border-thickness="1"/>
          <text/>
        </group>
        <group attr-stencil-id="10003">
          <polygon fill-style="gradation_linear_tb" fill-color="#ffffff" fill-color2="#9ac7bf" fill-opacity="100.0" border-style="normal" border-color="#000000" border-thickness="1"/>
          <text>circle</text>
        </group>
        <group attr-stencil-id="10006">
          <polygon border-style="dashed2" border-color="#02735f" border-thickness="1"/>
          <text/>
        </group>
        <line type="STRAIGHT" border-style="normal" border-color="#000000" border-thickness="1">
          <start/>
          <end style="arrow"/>
        </line>
        <image source-id="53f05a8df688217ebd37ec69a26846379f4f0a7afab8a759c6dd42ac1cd00882"/>
      </sheet>
      <sheet name="background">
        <group attr-stencil-id="10000">
          <polygon fill-style="singleColor" fill-color="#f8cecc" fill-opacity="100.0"/>
          <text/>
        </group>
      </sheet>
    </diagram>
    

    shapeStyle指定時に得られる要素と属性

    要素 (Element) 説明 属性 (Attributes) 子要素
    polygon ポリゴン
    • fill-style ( “singleColor”
    “gradation_linear_lr”
    line
    • type ( “STRAIGHT”
    “CURVE”
    start 開始点
    • style ( 通常以外のみ - “arrow”
    “small_arrow”
    end 終了点 上に同じ

    レスポンス例 (returnValues=uid)

    <?xml version="1.0" encoding="utf-8"?>
    <diagram>
      <sheet name="sheet1" uid="4147C" background-sheet="C83D2">
        <group uid="D82A36B5-4A89-B4D5-D150-0A48B2F9EECE" attr-stencil-id="10000">
          <polygon uid="64EB9716-D811-509B-AF3E-0A48B2F921C1"/>
          <text uid="6E3C2243-880B-63E7-74FA-0A48B2F9F875"/>
        </group>
        <group uid="BAAECC56-421B-E0DD-3D09-0A48BA890646" attr-stencil-id="10003">
          <polygon uid="A7A31CF0-C65D-0787-A50A-0A48BA894769"/>
          <text uid="3889EB54-BE1D-39F3-4D3C-0A48BA8955E5">circle</text>
        </group>
        <group uid="A3BAD414-DC6C-F7F1-FD41-0A48C9E508B3" attr-stencil-id="10006">
          <polygon uid="E9EEFD06-2C4F-D3DC-9326-0A48C9E5857B"/>
          <text uid="1639A930-B9C5-D710-7A6E-0A48C9E50CAB"/>
        </group>
        <line uid="1D00CADB-4146-600B-E490-0A5BC71FBEE0">
          <start connect-uid="64EB9716-D811-509B-AF3E-0A48B2F921C1"/>
          <end connect-uid="E9EEFD06-2C4F-D3DC-9326-0A48C9E5857B"/>
        </line>
        <image source-id="53f05a8df688217ebd37ec69a26846379f4f0a7afab8a759c6dd42ac1cd00882" uid="5AFC2501-4EA2-F86D-5529-0A5D459F391F"/>
      </sheet>
      <sheet name="background" uid="C83D2">
        <group uid="33A4712C-1152-A665-5B30-0A54E2BCDCC4" attr-stencil-id="10000">
          <polygon uid="4A0ABC27-1BE0-6F8C-0CB7-0A54E2BCC035"/>
          <text uid="D128A672-0923-47E5-FC02-0A54E2BC94CB"/>
        </group>
      </sheet>
    </diagram>
    

    uid指定時に得られる要素と属性

    要素 (Element) 説明 属性 (Attributes) 子要素
    sheet Root Element
    • uid ( シートのユニークID )
    • background-sheet ( 背景シートのユニークID )
    group
    polygon
    line
    text
    image
    All Shapes
    • uid ( 図形オブジェクトのユニークID )
    start
    end
    Edge
    • connect-uid ( 接続先の図形オブジェクトのユニークID )

    レスポンス例 (returnValues=position)

    <?xml version="1.0" encoding="utf-8"?>
    <diagram>
      <sheet name="sheet1">
        <group x="61.0" y="41.0" width="50.0" height="50.0" angle="0.0" attr-stencil-id="10000">
          <polygon x="0.0" y="0.0" width="50.0" height="50.0" angle="0.0"/>
          <text x="1.0" y="1.0" width="48.0" height="48.0" angle="0.0"/>
        </group>
        <group x="124.0" y="91.0" width="50.0" height="50.0" angle="0.0" attr-stencil-id="10003">
          <polygon x="0.0" y="0.0" width="50.0" height="50.0" angle="0.0"/>
          <text x="6.9" y="8.0" width="36.1" height="33.8" angle="0.0">circle</text>
        </group>
        <group x="174.0" y="19.5085" width="49.6" height="43.0" angle="0.0" attr-stencil-id="10006">
          <polygon x="0.0" y="0.0" width="49.634" height="42.983" angle="0.0"/>
          <text x="9.9" y="19.4" width="29.8" height="23.0" angle="0.0"/>
        </group>
        <line x="111.0" y="44.1" width="73.6" height="16.3" angle="0.0"/>
        <image source-id="53f05a8df688217ebd37ec69a26846379f4f0a7afab8a759c6dd42ac1cd00882" x="193.6" y="99.0" width="60.0" height="60.0" angle="0.0"/>
      </sheet>
      <sheet name="background">
        <group x="31.0" y="8.0" width="225.0" height="150.0" angle="0.0" attr-stencil-id="10000">
          <polygon x="0.0" y="0.0" width="225.0" height="145.0" angle="0.0"/>
          <text x="1.0" y="1.0" width="223.0" height="148.0" angle="0.0"/>
        </group>
      </sheet>
    </diagram>
    

    position指定時に得られる要素と属性

    要素 (Element) 説明 属性 (Attributes) 子要素

    group
    polygon
    line
    text
    image
    All Shapes
    • x ( 親からの相対座標 )
    • y ( 親からの相対座標 )
    • width
    • height
    • angle ( 親からの相対角度 )

    レスポンス例 (returnValues=point)

    <?xml version="1.0" encoding="utf-8"?>
    <diagram>
      <sheet name="sheet1">
        <group attr-stencil-id="10000">
          <polygon>
            <path close="true">
              <point type="NORMAL" x="50.0" y="50.0"/>
              <point type="NORMAL" x="0.0" y="50.0"/>
              <point type="NORMAL" x="0.0" y="0.0"/>
              <point type="NORMAL" x="50.0" y="0.0"/>
            </path>
          </polygon>
          <text/>
        </group>
        <group attr-stencil-id="10003">
          <polygon>
            <path close="true">
              <point type="NORMAL" x="50.0" y="25.0"/>
              <point type="BEZIER_CP" x="50.0" y="35.354843"/>
              <point type="NORMAL" x="42.678" y="42.67725"/>
              <point type="BEZIER_CP" x="35.35565" y="50.0"/>
              <point type="NORMAL" x="25.0" y="50.0"/>
              <point type="BEZIER_CP" x="14.64475" y="50.0"/>
              <point type="NORMAL" x="7.3223763" y="42.677624"/>
              <point type="BEZIER_CP" x="0.0" y="35.35525"/>
              <point type="NORMAL" x="0.0" y="25.0"/>
              <point type="BEZIER_CP" x="0.0" y="14.64475"/>
              <point type="NORMAL" x="7.3223753" y="7.3223763"/>
              <point type="BEZIER_CP" x="14.64475" y="0.0"/>
              <point type="NORMAL" x="25.0" y="0.0"/>
              <point type="BEZIER_CP" x="35.355827" y="0.0"/>
              <point type="NORMAL" x="42.678" y="7.3223753"/>
              <point type="BEZIER_CP" x="50.0" y="14.644578"/>
              <point type="NORMAL" x="50.0" y="25.0"/>
            </path>
          </polygon>
          <text>circle</text>
        </group>
        <group attr-stencil-id="10006">
          <polygon>
            <path close="true">
              <point type="NORMAL" x="24.817" y="0.0"/>
              <point type="NORMAL" x="37.224" y="21.491"/>
              <point type="NORMAL" x="49.634" y="42.983"/>
              <point type="NORMAL" x="24.817" y="42.983"/>
              <point type="NORMAL" x="0.0" y="42.983"/>
              <point type="NORMAL" x="12.409" y="21.491001"/>
              <point type="NORMAL" x="24.817" y="0.0"/>
            </path>
          </polygon>
          <text/>
        </group>
        <line>
          <point type="NORMAL" x="0.0" y="16.306983673887736"/>
          <point type="NORMAL" x="73.58819908547969" y="0.0"/>
        </line>
        <image source-id="53f05a8df688217ebd37ec69a26846379f4f0a7afab8a759c6dd42ac1cd00882"/>
      </sheet>
      <sheet name="background">
        <group attr-stencil-id="10000">
          <polygon>
            <path close="true">
              <point type="NORMAL" x="225.0" y="150.0"/>
              <point type="NORMAL" x="0.0" y="150.0"/>
              <point type="NORMAL" x="0.0" y="0.0"/>
              <point type="NORMAL" x="225.0" y="0.0"/>
            </path>
          </polygon>
          <text/>
        </group>
      </sheet>
    </diagram>
    

    point指定時に得られる要素と属性

    要素 (Element) 説明 属性 (Attributes) 子要素
    polygon ポリゴン path
    line point
    path ポリゴンのパス情報
    • close ( “true”
    “false” )
    point 点情報
    • type ( “NORMAL”
    “BEZIER_CP” )
  • x ( ポリゴンまたは線の位置からの相対座標 )
  • y ( ポリゴンまたは線の位置からの相対座標 )