Update room
PUThttp://localhost/api/v2/rooms/:id
Update room info
Request
Responses
- 200
- 401
- 404
- 409
Room updated
User Not Authorized
Room not found
Room with specified name already exists
Authorization: http
name: Tokentype: httpscheme: bearerdescription: For this method, user should acquire token with a call to `POST /api/v2/auth/login` using [Basic Authentication](#section/Authentication/Basic-Authentication) In case of success response will contain token (see [reference](#tag/Authorization) for response format) Every subsequent query should contain next header: ``` Authorization: Bearer abcdefg1234567 ``` where `abcdefg1234567` is previously received token. :::note Access token has expiration time, when it is expired, **Refresh Token** should be user to acquire new one. :::
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "http://localhost/api/v2/rooms/:id");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"name\": \"Hallway\",\n \"order\": 1,\n \"section_id\": 1,\n \"background_image\": \"123321.jpg\",\n \"icon\": \"ch-door\",\n \"main_devices\": {\n \"temperature_sensor\": 132,\n \"humidity_sensor\": 22,\n \"luminosity_sensor\": 23,\n \"power_sensor\": 0\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear