...
This response provides detailed room information, including surfaces (walls, floor, etc.), dimensions, and unique wall identifiers. Each surface contains x
and y
properties, which represent the center point of the surface as a percentage of the room image's width and height. These coordinates are particularly useful for developers who are working on web applications and need to place UI controls or interactive elements precisely on a surface. By using these relative percentage values, you can dynamically position UI components, such as buttons or material selection menus, directly over specific surfaces in the room's image. This allows for an intuitive and seamless user experience when applying or modifying materials on surfaces within the room.
...
Step 2: Retrieve Product Data
Receive products data from v1.0/articles.
Step 3: Prepare the Request Body with
...
Product Data
To apply materials, you need to fill in the room’s surfaces with the appropriate product information. For each surface (floor, wall, ceiling), you can specify a material to apply.
Legacy request bodyRequest body /v1.0/apply:
Code Block |
---|
{ "room_data": { "room": { "id": "fa4e3811-0287-4176-9fb1-1a1b360d338b", "walls": [ { "wall_id": 0, "is_active": true, "custom_rotation_angle": 0, "wallpaper": { "uuid": "09d58e60-dd4d-4ded-ac7b-c5500d9035f0", "is_visible": true, "product_type": { "uuid": "c2a62091-c2ed-4958-9358-538dcfa122ee", "code": "wallpaper" }, "preview_image_path": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/one_item_preview_color.jpg", "width": 1, "product_width": 1, "length": null, "reverse_180": false, "rapport_shift": null, "scene_data": { "data": [ { "type": "laying-pattern", "code": "no_pattern", "is_default": true, "material_maps": { "color": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_color.png", "normal": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_normal.png", "metalness": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_metal.png", "roughness": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_roughness.png" }, "pattern_length": null, "pattern_width": null } ] }, "product_length": null, "pattern": null } }, { "wall_id": 1, "is_active": true, "custom_rotation_angle": 0, "wallpaper": { "uuid": "09d58e60-dd4d-4ded-ac7b-c5500d9035f0", "is_visible": true, "product_type": { "uuid": "c2a62091-c2ed-4958-9358-538dcfa122ee", "code": "wallpaper" }, "width": 1, "product_width": 1, "length": null, "reverse_180": false, "rapport_shift": null, "scene_data": { "data": [ { "type": "laying-pattern", "code": "no_pattern", "is_default": true, "material_maps": { "color": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_color.png", "normal": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_normal.png", "metalness": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_metal.png", "roughness": "pim-data/a78d0200-78ce-444b-a34a-e2fb2829d03a/12665/09d58e60-dd4d-4ded-ac7b-c5500d9035f0/no_pattern/663f75bd709738f9a23376c38293f47d_one_item_roughness.png" }, "pattern_length": null, "pattern_width": null } ] }, "product_length": null, "pattern": null } } ] } } } |
If you want to apply a material to a surface, include the material
object for that surface. If no material is passed for a surface, no changes will be made to it.
Material Object Properties:
material_uuid
: Product UUID from PIM or retrieved through the API.layout
: Layout code. Some products may have multiple layouts, allowing you to choose which to apply.custom_rotation_angle
: For flooring materials and tiles on walls, you can specify a rotation angle to apply the material in different orientations.
Example Request Body:
...
Request Body /v1.1/apply:
Code Block |
---|
{ "room_data": { "room": { "id": "example-room-uuid", "floor": { "material": { "material_uuid": "example-floor-material-uuid", "custom_rotation_angle": 0, "layout": "no_pattern" } }, "ceiling": { "material": { "material_uuid": "example-ceiling-material-uuid", "layout": "no_pattern" } }, "walls": [ { "wall_id": 0, "material": { "material_uuid": "example-floor-material-uuid", "layout": "no_pattern" } }, { "wall_id": 1, "custom_rotation_angle": 0, "material": { "material_uuid": "example-wall-material-uuid", "layout": "no_pattern" } } ] } } } |
...
If you want to apply a material to a surface, include the material
object for that surface. If no material is passed for a surface, no changes will be made to it.
Material Object Properties:
material_uuid
: Product UUID from PIM or retrieved through the API.layout
: Layout code. Some products may have multiple layouts, allowing you to choose which to apply.custom_rotation_angle
: For flooring materials and tiles on walls, you can specify a rotation angle to apply the material in different orientations.
...
Step 4: Apply Materials to the Room
Once the request body is prepared with the room and material data, send the request to apply the materials to the room's surfaces.
...