Interface DeviceApi


  • @Path("/_matrix/client/r0")
    @Consumes("application/json")
    @Produces("application/json")
    public interface DeviceApi
    Clients that implement this module should offer the user a list of registered devices, as well as the means to update their display names. Clients should also allow users to delete disused devices.
    • Method Summary

      Modifier and Type Method Description
      void deleteDevice​(String deviceId, DeviceDeleteRequest deviceDeleteRequest, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      This API endpoint uses the User-Interactive Authentication API.
      void deleteDevices​(DevicesDeleteRequest devicesDeleteRequest, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      This API endpoint uses the User-Interactive Authentication API.
      void device​(String deviceId, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Gets information on a single device, by device id.
      void devices​(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Gets information about all devices for the current user.
      void updateDevice​(String deviceId, DeviceUpdateRequest deviceUpdateRequest, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Updates the metadata on the given device.
    • Method Detail

      • devices

        @GET
        @Path("/devices")
        void devices​(@Context
                     javax.ws.rs.core.UriInfo uriInfo,
                     @Context
                     javax.ws.rs.core.HttpHeaders httpHeaders,
                     @Suspended
                     javax.ws.rs.container.AsyncResponse asyncResponse,
                     @Context
                     javax.ws.rs.core.SecurityContext securityContext)
        Gets information about all devices for the current user.
        Requires auth: Yes.
        Return: DevicesResponse.

        Status code 200: A list of all registered devices for this user.

        Parameters:
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • device

        @GET
        @Path("/devices/{deviceId}")
        void device​(@PathParam("deviceId")
                    String deviceId,
                    @Context
                    javax.ws.rs.core.UriInfo uriInfo,
                    @Context
                    javax.ws.rs.core.HttpHeaders httpHeaders,
                    @Suspended
                    javax.ws.rs.container.AsyncResponse asyncResponse,
                    @Context
                    javax.ws.rs.core.SecurityContext securityContext)
        Gets information on a single device, by device id.
        Requires auth: Yes.
        Return: Device.

        Status code 200: Device information.

        Status code 404: The current user has no device with the given ID.

        Parameters:
        deviceId - Required. The device to retrieve.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • updateDevice

        @PUT
        @Path("/devices/{deviceId}")
        void updateDevice​(@PathParam("deviceId")
                          String deviceId,
                          DeviceUpdateRequest deviceUpdateRequest,
                          @Context
                          javax.ws.rs.core.UriInfo uriInfo,
                          @Context
                          javax.ws.rs.core.HttpHeaders httpHeaders,
                          @Suspended
                          javax.ws.rs.container.AsyncResponse asyncResponse,
                          @Context
                          javax.ws.rs.core.SecurityContext securityContext)
        Updates the metadata on the given device.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The device was successfully updated.

        Status code 404: The current user has no device with the given ID.

        Parameters:
        deviceId - Required. The device to update.
        deviceUpdateRequest - The new display name for this device. If not given, the display name is unchanged.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • deleteDevice

        @DELETE
        @Path("/devices/{deviceId}")
        void deleteDevice​(@PathParam("deviceId")
                          String deviceId,
                          DeviceDeleteRequest deviceDeleteRequest,
                          @Context
                          javax.ws.rs.core.UriInfo uriInfo,
                          @Context
                          javax.ws.rs.core.HttpHeaders httpHeaders,
                          @Suspended
                          javax.ws.rs.container.AsyncResponse asyncResponse,
                          @Context
                          javax.ws.rs.core.SecurityContext securityContext)
        This API endpoint uses the User-Interactive Authentication API.
        Deletes the given device, and invalidates any access token associated with it.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The device was successfully removed, or had been removed previously.

        Status code 401: The homeserver requires additional authentication information.

        Parameters:
        deviceId - Required. The device to delete.
        deviceDeleteRequest - Additional authentication information for the user-interactive authentication API.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • deleteDevices

        @POST
        @Path("/delete_devices")
        void deleteDevices​(DevicesDeleteRequest devicesDeleteRequest,
                           @Context
                           javax.ws.rs.core.UriInfo uriInfo,
                           @Context
                           javax.ws.rs.core.HttpHeaders httpHeaders,
                           @Suspended
                           javax.ws.rs.container.AsyncResponse asyncResponse,
                           @Context
                           javax.ws.rs.core.SecurityContext securityContext)
        This API endpoint uses the User-Interactive Authentication API.
        Deletes the given devices, and invalidates any access token associated with them.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The devices were successfully removed, or had been removed previously.

        Status code 401: The homeserver requires additional authentication information.

        Parameters:
        devicesDeleteRequest - JSON body request.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.