開発APIリファレンスProject / Room Design API

Project / Room Design API

GET /(v0|v1)/project/room_designs


リクエストヘッダーに Authorization Key が必要です。

使用箇所

アプリはこのAPIに基づいてクラウドセーブ(Cloud Saves)のリストを生成します。

クラウドセーブリスト

APIの戻り値からは BOM データを削除する必要があります。

概要

room_designs 情報を返します。

パラメータ

パラメータ必須説明
app_versionintegerはいフィルタリングするルームデザインバージョン。指定がない場合、app_version = 0 が適用されます。
sort_bystringcreated_at, updated_at または name
pageintegerリソースビューのページ番号。デフォルト: 1
perintegerAPIレスポンスで返すルームデザインの数。デフォルト: 25
termstringルームデザイン名、ルームID、オーナー名、レベルファイル、または説明を指定可能

リクエスト

GET /v0/project/room_designs?app_version=1 HTTP/1.1
Authorization: Token 9c31d8018f8930c24e8f28c52186ece0dc8296bb46caf4e5

レスポンス

{
    "results": [
        {
            "uuid": "as23dWOsdfdWOMCqwpoassd21",
            "image_url": "/uploads/room_design/0008/template-image-size.png",
            "status": "limited",
            "is_preset": false,
            "product_ids": "",
            "name": "Design 08",
            "description": "0008 Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis ut elit molestie gravida. Cras tristique imperdiet congue.",
            "created_at": "2019-11-25T06:29:09.401Z",
            "created_by": "a58O0000000HumJIAS",
            "updated_at": "2019-11-28T03:50:03.541Z",
            "updated_by": "a58O0000000HumJIAS",
            "role": "owner",
            "level_file": ""
        },
        {
            "uuid": "JSLWjfdWOMCqwpoas23dWOssd21",
            "image_url": "/uploads/room_design/0011/template-image-size.png",
            "status": "limited",
            "is_preset": false,
            "product_ids": "",
            "name": "Design 11",
            "description": "0011 Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis ut elit molestie gravida. Cras tristique imperdiet congue.",
            "created_at": "2019-11-25T06:29:10.292Z",
            "created_by": "003O0000017Vly2IAC",
            "updated_at": "2019-11-25T06:29:10.292Z",
            "updated_by": "003O0000017Vly2IAC",
            "role": "admin",
            "level_file": ""
        },
        {
            "uuid": "JSLWjfdWOMCqwpoas2301dsad21",
            "image_url": "/uploads/room_design/0003/template-image-size.png",
            "status": "opened",
            "is_preset": false,
            "product_ids": "",
            "name": "Design 03",
            "description": "0003 Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis ut elit molestie gravida. Cras tristique imperdiet congue.",
            "created_at": "2019-11-25T06:29:07.928Z",
            "created_by": "a58O0000000LNAwIAO",
            "updated_at": "2019-11-25T06:29:07.928Z",
            "updated_by": "a58O0000000HumJIAS",
            "role": "viewer",
            "level_file": ""
        }
    ]
}

GET Project / Room Designs (Detail)

GET /(v0|v1)/project/room_designs/:id


リクエストヘッダーに Authorization Key が必要です。

使用箇所

ルームデザインがクリックされると、このAPIがBOMを返し、アプリがルームを読み込みます。

ルームデザイン読み込み

概要

room_design 情報を返します。

パラメータ

パラメータ必須説明
idstringはいルームデザインID

リクエスト

GET /v0/project/room_designs/7d1b3403-da8c-4b4a-a800-a34b1103a0d9 HTTP/1.1
Authorization: Token 9c31d8018f8930c24e8f28c52186ece0dc8296bb46caf4e5

レスポンス

{
  "results": {
    "uuid": "7d1b3403-da8c-4b4a-a800-a34b1103a0d9",
    "image_url": "/uploads/pexels-photo-404630.jpeg",
    "bom": "<?xml version=\"1.0\"?>\n<catalog>\n   <book id=\"bk101\">\n      <author>Gambardella, Matthew</author>\n      <title>XML Developer's Guide</title>\n      <genre>Computer</genre>\n      <price>44.95</price>\n      <publish_date>2000-10-01</publish_date>\n      <description>An in-depth look at creating applications\n      with XML.</description>\n   </book>\n</catalog>\n",
    "status": "opened",
    "is_preset": false,
    "product_ids": "",
    "name": "Design 110",
    "description": "0110 Lorem ipsum dolor sit amet, consectetur adipiscing elit. In iaculis ut elit molestie gravida. Cras tristique imperdiet congue. Cras mi massa, varius a leo vel, placerat elementum neque. Integer non dapibus tellus. Nullam feugiat eget urna non commodo. Nam condimentum sapien dui, a suscipit nisi dictum a. Suspendisse scelerisque diam ac elit congue pellentesque. Suspendisse dapibus dui nisl, non pulvinar enim consectetur eget.",
    "created_at": "2018-09-06T02:36:10.018Z",
    "created_by": "a58O0000000HumJIAS",
    "updated_at": "2018-09-06T02:36:10.018Z",
    "updated_by": "a58O0000000HumJIAS",
    "lock_version": 1,
    "level_file": "",
    "delete_all_images": false,
    "room_design_images": [
      {
        "id": "bbf4da55-4515-4597-b3e4-7f198a0118e8",
        "name": "Picture 20",
        "description": "The xxx picture",
        "url": "/uploads/pexels-photo-404630.jpeg",
        "created_at": "2018-09-06T02:36:25.280Z",
        "updated_at": "2018-09-06T02:36:25.280Z"
      },
      {
        "id": "fee578b8-cbc1-4055-846e-f541009445db",
        "name": "Picture 19",
        "description": "The xxx picture",
        "url": "/uploads/pexels-photo-308663.jpeg",
        "created_at": "2018-09-06T02:36:25.275Z",
        "updated_at": "2018-09-06T02:36:25.275Z"
      },
      {
        "id": "83a32427-2c02-41ad-b7d0-e2a5b9c00ae5",
        "name": "Picture 18",
        "description": "The xxx picture",
        "url": "/uploads/pexels-photo-308663.jpeg",
        "created_at": "2018-09-06T02:36:25.270Z",
        "updated_at": "2018-09-06T02:36:25.270Z"
      }
    ]
  }
}

注意点:

lock_version フィールドはルームデザインのバージョンを示し、レスポンスに含まれます。

ルームデザインの更新または削除をリクエストする場合、lock_version フィールドは必須です。

lock_version がサーバー上の現在の lock_version よりも古い場合、APIは 409 Conflict を返します。正しい lock_version を指定してください。

POST Project / Room Designs (Create)

POST /(v0|v1)/project/room_designs/


リクエストヘッダーに Authorization Key が必要です。

概要

room_design 情報を作成し、返します。

パラメータ

パラメータ必須説明
room_design *hashはい
- bomstringはいBOM
- imagedata/imageはい画像
- mesh_n_elementsBase64 encoded string[]プロダクト要素の配列
- namestring[]プロダクトIDの配列
- descriptionstring説明
- is_presetboolean
- statusstringstatus は hidden, limited, closed または :opened
- level_filestringレベルファイル
- additional_level_filestringレベルファイル
- app_versionintegerはい
- chunk_idsArray
- total_file_sizefloat
- graphics_qualitystring
- scenario_namestringライティングシナリオまたはダイナミックスカイ
- hdri_sfidstringHDRIアイテムの design_mesh_junction_sfid
- delete_all_imagesboolean
- is_configurableboolean
- configurable_items_attributes
- guidstringはい
- indexesarray
  • リクエストボディはJSON形式である必要があります。

リクエスト

POST /v0/project/room_designs HTTP/1.1
Authorization: Token 9c31d8018f8930c24e8f28c52186ece0dc8296bb46caf4e5
Content-Type: application/x-www-form-urlencoded

リクエストボディ

{
    "room_design": {
        "bom": "eDb...",
        "image": "base64:...",
        "mesh_n_elements": "aTyi...",
        "name": "edited name",
        "level_file": "PR-0000",
        "description": "edited description",
        "status": "opened",
        "additional_level_file": "PR-0001",
        "chunk_ids": [1, 2],
        "total_file_size": 100.0,
        "graphics_quality": "High",
        "hdri_sfid": "aDf...",
        "scenario_name": "scenario_name",
        "delete_all_images": false,
        "is_configurable": true,
        "configurable_items_attributes": [
            { "guid": "guid1", "indexes": [1,2,3] },
            { "guid": "guid2", "indexes": [1,2,3] }
        ]
    }
}

レスポンス

{
  "results": {
    "uuid": "efad9cc3-ef9b-4d77-88cd-9e036826dc62",
    "image_url": "/uploads/image.jpeg",
    "bom": "<note>\n<to>Tove</to>\n</note>\n",
    "status": "opened",
    "is_preset": false,
    "product_ids": "\"products\":[{\"product_id\":\"01t10000002rGFXAA2\",\"value\":10.5},{\"product_id\":\"01t10000002rF1OAAU\",\"value\":9.8}]",
    "mesh_n_elements": "\"products\":[{\"elements\":[\"AV-00002585\",\"BASE_GLASS\"],\"design_version_id\":\"a40100000017maMAAQ\",\"mesh\":\"MS-00002005\",\"value\":\"1\"}]",
    "name": "",
    "description": "",
    "level_file": "level file data",
    "created_at": "2019-10-15T04:44:34.834Z",
    "created_by": "a58O0000000HumJIAS",
    "updated_at": "2019-10-15T04:44:34.834Z",
    "updated_by": "a58O0000000HumJIAS",
    "delete_all_images": true,
    "is_configurable": true,
    "configurable_items": []
  }
}

PUT Project / Room Designs (Update)

PUT /(v0|v1)/project/room_designs/:id


リクエストヘッダーに Authorization Key が必要です。

概要

room_design 情報を更新し、返します。

⚠️

注意: このAPIは既存のすべてのルームデザイン画像を削除します。新しい画像を必ず渡してください。

パラメータ

パラメータ必須説明
idstringはいルームデザインID
room_design *hashはい
lock_version *integerはい
- bomstringBOM
- imagedata/image画像
- mesh_n_elementsBase64 encoded string[]プロダクト要素の配列
- namestring名前
- descriptionstring説明
- is_presetboolean
- statusstringstatus は :hidden, :closed または :opened (デフォルト)。
- level_filestringレベルファイル
- additional_level_filestring
- chunk_idsstring
- app_versionstring
- is_developmentboolean
- graphics_qualitystring
- scenario_namestringライティングシナリオ名
- hdri_sfidstringHDRIアイテムの design_mesh_junction_sfid
- delete_all_imagesboolean
- is_configurableboolean
- configurable_items_attributes
- guidstring
- indexesarray
  • リクエストボディはJSON形式である必要があります。

リクエスト

PUT /v0/project/room_designs/686ae546-1115-46f2-b774-3a725dadf339 HTTP/1.1
Authorization: Token 9c31d8018f8930c24e8f28c52186ece0dc8296bb46caf4e5
Content-Type: application/x-www-form-urlencoded

リクエストボディ

{
    "room_design": {
        "bom": "eDb...",
        "image": "base64:...",
        "mesh_n_elements": "aTyi...",
        "name": "edited name",
        "level_file": "PR-0000",
        "description": "edited description",
        "status": "opened",
        "additional_level_file": "PR-0001",
        "chunk_ids": [1, 2],
        "total_file_size": 100.0,
        "graphics_quality": "High",
        "hdri_sfid": "aDf...",
        "scenario_name": "scenario_name",
        "delete_all_images": false,
        "is_configurable": true,
        "configurable_items_attributes": [
            { "guid": "guid1", "indexes": [1,2,3] },
            { "guid": "guid2", "indexes": [1,2,3] }
        ]
    }
}

レスポンス

{
  "results": {
    "uuid": "686ae546-1115-46f2-b774-3a725dadf339",
    "image_url": "/uploads/image.jpeg",
    "bom": "<note>\n<to>Tove</to>\n<from>Jani</from>\n<heading>Reminder</heading>\n<body>Don't forget me this weekend!</body>\n</note>\n",
    "status": "opened",
    "is_preset": false,
    "product_ids": "\"products\":[{\"product_id\":\"01t10000002rGFXAA2\",\"value\":10.5},{\"product_id\":\"01t10000002rF1OAAU\",\"value\":9.8}]",
    "mesh_n_elements": "\"products\":[{\"elements\":[\"AV-00002585\",\"BASE_GLASS\"],\"design_version_id\":\"a40100000017maMAAQ\",\"mesh\":\"MS-00002005\",\"value\":\"1\"}]",
    "name": "",
    "description": "",
    "level_file": "level file data",
    "additional_level_file": "",
    "chunk_ids": "",
    "chunk_id": "",
    "chunk_size": "",
    "additional_chunk_id": "",
    "additional_chunk_size": "",
    "created_at": "2018-05-18T08:40:17.361Z",
    "created_by": "516a42c87ef287c024",
    "updated_at": "2018-05-18T08:40:17.411Z",
    "updated_by": "516a42c87ef287c024",
    "lock_version": 1,
    "delete_all_images": true,
    "is_configurable": true
  }
}

POST Project / Room Designs (Update Variant)

POST /(v0|v1)/project/room_designs/:id/update


リクエストヘッダーに Authorization Key が必要です。

概要

room_design 情報を更新し、情報を返します。

⚠️

注意: このAPIは既存のすべてのルームデザイン画像を削除します。新しい画像を必ず渡してください。

パラメータ

パラメータ必須説明
idstringはいルームデザインID
room_design *hashはい
lock_version *integerはい
- bomstringBOM
- imagedata/image画像
- mesh_n_elementsBase64 encoded string[]プロダクト要素の配列
- namestring名前
- descriptionstring説明
- is_presetboolean
- statusstringstatus は :hidden, :closed または :opened (デフォルト)。
- level_filestringレベルファイル
- additional_level_filestring
- chunk_idsstring
- delete_all_imagesboolean
- is_configurableboolean
- configurable_items_attributes
- guidstring
- indexesarray
  • リクエストボディはJSON形式である必要があります。

リクエスト

POST /v0/project/room_designs/3af7fd30-8fc6-4bf5-b5bb-082dffc8eb97/update HTTP/1.1
Authorization: Token 9c31d8018f8930c24e8f28c52186ece0dc8296bb46caf4e5
Content-Type: application/x-www-form-urlencoded

リクエストボディ

{
    "room_design": {
        "bom": "eDb...",
        "image": "base64:...",
        "mesh_n_elements": "aTyi...",
        "name": "edited name",
        "level_file": "PR-0000",
        "description": "edited description",
        "status": "opened",
        "additional_level_file": "PR-0001",
        "chunk_ids": [1, 2],
        "total_file_size": 100.0,
        "graphics_quality": "High",
        "hdri_sfid": "aDf...",
        "scenario_name": "scenario_name",
        "delete_all_images": false,
        "is_configurable": true,
        "configurable_items_attributes": [
            { "guid": "guid1", "indexes": [1,2,3] },
            { "guid": "guid2", "indexes": [1,2,3] }
        ]
    }
}

レスポンス

{
  "results": {
    "uuid": "3af7fd30-8fc6-4bf5-b5bb-082dffc8eb97",
    "image_url": "/uploads/image.jpeg",
    "bom": "<note>\n<to>Tove</to>\n<from>Jani</from>\n<heading>Reminder</heading>\n<body>Don't forget me this weekend!</body>\n</note>\n",
    "status": "opened",
    "is_preset": false,
    "product_ids": "\"products\":[{\"product_id\":\"01t10000002rGFXAA2\",\"value\":10.5},{\"product_id\":\"01t10000002rF1OAAU\",\"value\":9.8}]",
    "mesh_n_elements": "\"products\":[{\"elements\":[\"AV-00002585\",\"BASE_GLASS\"],\"design_version_id\":\"a40100000017maMAAQ\",\"mesh\":\"MS-00002005\",\"value\":\"1\"}]",
    "name": "",
    "description": "",
    "level_file": "level file data",
    "additional_level_file": "",
    "chunk_ids": "",
    "chunk_id": "",
    "chunk_size": "",
    "additional_chunk_id": "",
    "additional_chunk_size": "",
    "created_at": "2018-05-18T08:40:18.407Z",
    "created_by": "6b7c63ce3130941803",
    "updated_at": "2018-05-18T08:40:18.458Z",
    "updated_by": "6b7c63ce3130941803",
    "lock_version": 1,
    "delete_all_images": true,
    "is_configurable": true
  }
}

DELETE Project / Room Designs

DELETE /(v0|v1)/project/room_designs/:id


リクエストヘッダーに Authorization Key が必要です。

概要

room_design を削除し、コンテンツなし(No Content)を返します。

パラメータ

パラメータ必須説明
idstringはいルームデザインID
lock_version *integerはい

リクエスト

DELETE /v0/project/room_designs/884c68af-8f72-4bf0-9924-e0d2715c3477 HTTP/1.1
Authorization: Token 9c31d8018f8930c24e8f28c52186ece0dc8296bb46caf4e5

レスポンス

HTTP/1.1 204 No Content

POST Project / Room Designs (Delete Variant)

POST /v0/project/room_designs/:id/delete


リクエストヘッダーに Authorization Key が必要です。

概要

room_design を削除し、コンテンツなし(No Content)を返します。

パラメータ

パラメータ必須説明
idstringはいルームデザインID
lock_version *integerはい

リクエスト

POST /v0/project/room_designs/1a1fae95-aa04-4686-aa2f-132c8baa4765/delete HTTP/1.1
Authorization: Token 9c31d8018f8930c24e8f28c52186ece0dc8296bb46caf4e5

レスポンス

HTTP/1.1 204 No Content