...
The Wizart Visualizer API allows you to apply products such as wallpapers, floorings, and other materials to specific rooms. To accomplish this, follow the steps outlined below to retrieve the necessary room data, add product information, and submit the final requestroom surfaces. If you’re unsure which material types are applicable for different surfaces (e.g., wall, floor, or ceiling), please refer to our article on Supported Product Types for Wall, Floor, and Ceiling Applications.
...
Step 1: Retrieve Room Data
Start by selecting the room you wish want to work withmodify. Every room in the Wizart system has a unique identifier (UUID) that , which can be obtained through either through the API or the Wizart PIM interface. Once you have With the room _uuidUUID, you can request the detailed data for that about the room.
API Endpoint:
Code Block |
---|
http |
Копировать код
GET /api/v1/rooms/{room_uuid}
Example Response:
Code Block | ||
---|---|---|
| ||
{ "uuid": "88cc386a-0897-48ea-93ed-a8aee0609253", "title": "Wizart GO-1551 3", "image_path": "interiors/reserved/images/4b0a7a56-2f6f-4c22-9135-8f28ea004106.jpg", "room_type_title": "Bathroom", "room_type_id": 9, "width": 2560, "height": 1706, "surfaces": [ "wall", "floor" ], "created_at": "24.01.2022", "mask_name": "mask.png", "ceiling": null, "floor": { "x": 52.25457191467285, "y": 88.72437382079792 }, "walls": [ { "x": 3, "y": 20, "wall_id": 0 }, { "x": 35, "y": 20, "wall_id": 1 }, { "x": 87, "y": 20, "wall_id": 2 } ] } |
The This response provides detailed room information about the room, including surfaces (walls, floor, etc.), dimensions, and unique wall identifiers. You will You’ll use this information data to apply materials in the next step.
...
Step 2: Prepare
...
the Request Body with Material Data
Once you have the room data, the next step is to gather product information for the material 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.
If you want to apply a material to the surfaces. You can retrieve this information from the product catalog through the Wizart API.
Step 3: Prepare Request Body
Example Request Body: The example below shows how to structure the product data for a room’s walls, applying wallpaper to two walls.
...
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.code
: 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:
Code Block |
---|
{ "room_data": { "room": { "id": "e948bc98example-d955-4fb1-be42-506f3904cc18", "image_path": "interiors/uploaded/images/9c34973f-d1cc-495d-8205-5c59a969b31e.jpg", "mask_name": "mask.png"room-uuid", "floor": {}, "ceiling": {}, "wallsmaterial": [ { "wallmaterial_iduuid": 0, "is_active": true"example-floor-material-uuid", "custom_rotation_angle": 0, "material": { "uuid": "bbe81b21-e9a7-43d4-bdf1-93f08ac701c1", "code": "no_pattern", } }, { "wall_idceiling": 1,{ "is_active": true, "custom_rotation_angle": 0, "material" { "material": { "material_uuid" } "wallpaper": { "uuid": "bbe81b21example-e9a7ceiling-43d4material-bdf1-93f08ac701c1uuid", "is_visiblecode": true, "productno_typepattern": { } "uuid": "5d04afb2-03bf-4be6-8bd0-0fb6a89653b5" }, "code"walls": "wallpaper"[ { }, "width"wall_id": 0.465, "productis_widthactive": 0.47true, "lengthmaterial": 8.37,{ "reversematerial_180uuid": false, "mural": false"example-floor-material-uuid", "rapport_shiftcode": 0, "sceneno_datapattern": { "data": [} { }, { "typewall_id": "laying-pattern", 1, "codeis_active": "no_pattern", true, "iscustom_rotation_defaultangle": true, 0, "material_maps": { "color"material_uuid": "pimexample-data/5411d399wall-baec-4c35-8e81-8c1cc185dee1/2055/158913.jpg" }, material-uuid", "pattern_lengthcode": null, "pattern_width": null } ] }, "product_length": null, "pattern": null"no_pattern" } } ] } } } |
This JSON body includes the following information:
...
Room ID: Unique identifier of the room.
...
Image Path: Path to the room image for rendering.
Walls: A list of walls, each with its unique wall_id
.
...
...
Step 3: Apply Materials to the Room
After preparing Once the request body is prepared with the room and material data with the product information, send the final request to apply the materials to the selected surfaces (e.g., walls).room's surfaces.
API Endpoint:
...
POST
...
/api/v1/rooms/{room_uuid}/apply-materials
Use the room_data
structure as the request body, and the API will return the room with the selected specified materials applied .
By following these steps, you can easily manage room configurations and customize them with various products using the Wizart Visualizer API.
...
to the surfaces.
6. Uploading Your Own Products to PIM
Now that you're comfortable applying textures and visualizing predefined rooms, you can upload your own products to Wizart PIM.
...
Learn more in the Getting Started with Wizart PIM article.
6. API Debugging and Error Handling
Common Errors:
...
Invalid Token: Ensure your API Token and Device-Tokens are valid and included correctly in the headers.
...
Missing UUIDs: Double-check that you’re using the correct UUIDs for rooms, products, or collections.
...
.