跳到主要内容

changeRoomGroupIcon

RoomGroupWrapper changeRoomGroupIcon(id, IconRequest)

POST /api/2.0/files/group/{id}/icon

Change room group icon

Replaces the icon of one of the caller's own room groups and returns the whole group, its name and its rooms left as they were. Send the identifier of one of the built-in covers offered by GET api/2.0/files/rooms/covers; an empty string strips the icon, after which the group comes back with an empty icon, and any other value - including a word that merely reads like one, such as none - is rejected as an invalid request. An uploaded image cannot be used here, unlike the logo of a room. Leaving icon out of the body or sending it as null is accepted and changes nothing, whereas a request that carries no body at all, or a body that is not JSON, is refused. Setting the icon the group already has is accepted as well, so retrying the call is safe. Any role may re-icon its own group, and a group belonging to another account is answered as missing rather than refused, exactly as reading it would be.

Parameters​

NameInTypeDescriptionNotes
idpathInteger (int32)The room group to re-icon, identified by the value GET api/2.0/files/group reports for it. A group of another account cannot be addressed and reads as missing.[required] [example: 42]
IconRequestbodyIconRequestThe icon to give the group. A body that leaves the icon out is accepted and changes nothing.[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The room group with the new iconRoomGroupWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read, or the icon is neither a built-in cover nor an empty string--
404The group does not exist or belongs to another account--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

RoomGroupWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json