Interface ApplicationApi


  • @Path("/_matrix/app/v1")
    @Consumes("application/json")
    @Produces("application/json")
    public interface ApplicationApi
    Application service APIs which are used by the homeserver. All application services MUST implement these APIs.
    • Method Summary

      Modifier and Type Method Description
      void rooms​(String roomAlias, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      This endpoint is invoked by the homeserver on an application service to query the existence of a given room alias.
      void transaction​(String txnId, TransactionRequest request, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      This API is called by the homeserver when it wants to push an event (or batch of events) to the application service.
      void users​(String userId, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      This endpoint is invoked by the homeserver on an application service to query the existence of a given user ID.
    • Method Detail

      • transaction

        @PUT
        @Path("/transactions/{txnId}")
        void transaction​(@PathParam("txnId")
                         String txnId,
                         TransactionRequest request,
                         @Context
                         javax.ws.rs.core.UriInfo uriInfo,
                         @Context
                         javax.ws.rs.core.HttpHeaders httpHeaders,
                         @Suspended
                         javax.ws.rs.container.AsyncResponse asyncResponse)
        This API is called by the homeserver when it wants to push an event (or batch of events) to the application service.
        Note that the application service should distinguish state events from message events via the presence of a state_key, rather than via the event type.
        Return: EmptyResponse.

        Status responseCode 200: The transaction was processed successfully.

        Parameters:
        txnId - Required. The transaction ID for this set of events. Homeservers generate these IDs and they are used to ensure idempotency of requests.
        request - JSON body request.
        uriInfo - Information about the request.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • rooms

        @GET
        @Path("/rooms/{roomAlias}")
        void rooms​(@PathParam("roomAlias")
                   String roomAlias,
                   @Context
                   javax.ws.rs.core.UriInfo uriInfo,
                   @Context
                   javax.ws.rs.core.HttpHeaders httpHeaders,
                   @Suspended
                   javax.ws.rs.container.AsyncResponse asyncResponse)
        This endpoint is invoked by the homeserver on an application service to query the existence of a given room alias. The homeserver will only query room aliases inside the application service's aliases namespace. The homeserver will send this request when it receives a request to join a room alias within the application service's namespace.
        Return: EmptyResponse.

        Status responseCode 200: The application service indicates that this room alias exists. The application service MUST have created a room and associated it with the queried room alias using the client-server API. Additional information about the room such as its name and topic can be set before responding.

        Status responseCode 401: The homeserver has not supplied credentials to the application service. Optional error information can be included in the body of this response.

        Status responseCode 403: The credentials supplied by the homeserver were rejected.

        Status responseCode 404: The application service indicates that this room alias does not exist. Optional error information can be included in the body of this response.

        Parameters:
        roomAlias - Required. The room alias being queried.
        uriInfo - Information about the request.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • users

        @GET
        @Path("/users/{userId}")
        void users​(@PathParam("userId")
                   String userId,
                   @Context
                   javax.ws.rs.core.UriInfo uriInfo,
                   @Context
                   javax.ws.rs.core.HttpHeaders httpHeaders,
                   @Suspended
                   javax.ws.rs.container.AsyncResponse asyncResponse)
        This endpoint is invoked by the homeserver on an application service to query the existence of a given user ID. The homeserver will only query user IDs inside the application service's users namespace. The homeserver will send this request when it receives an event for an unknown user ID in the application service's namespace.
        Return: EmptyResponse.

        Status responseCode 200: The application service indicates that this user exists. The application service MUST create the user using the client-server API.

        Status responseCode 401: The homeserver has not supplied credentials to the application service. Optional error information can be included in the body of this response.

        Status responseCode 403: The credentials supplied by the homeserver were rejected.

        Status responseCode 404: The application service indicates that this user does not exist. Optional error information can be included in the body of this response.

        Parameters:
        userId - Required. The user ID being queried.
        uriInfo - Information about the request.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.