Interface ThirdPartyProtocolApi


  • @Path("/_matrix/client/r0/thirdparty")
    @Consumes("application/json")
    @Produces("application/json")
    public interface ThirdPartyProtocolApi
    Application services can provide access to third party networks via bridging. This allows Matrix users to communicate with users on other communication platforms, with messages ferried back and forth by the application service. A single application service may bridge multiple third party networks, and many individual locations within those networks. A single third party network location may be bridged to multiple Matrix rooms.
    • Method Summary

      Modifier and Type Method Description
      void location​(String alias, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Retrieve an array of third party network locations from a Matrix room alias.
      void locationProtocol​(String protocol, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Requesting this endpoint with a valid protocol name results in a list of successful mapping results in a JSON array.
      void protocol​(String protocol, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Fetches the metadata from the homeserver about a particular third party protocol.
      void protocols​(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Fetches the overall metadata about protocols supported by the homeserver.
      void user​(String userId, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Retrieve an array of third party users from a Matrix User ID.
      void userProtocol​(String protocol, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Retrieve a Matrix User ID linked to a user on the third party service, given a set of user parameters.
    • Method Detail

      • protocols

        @GET
        @Path("/protocols")
        void protocols​(@Context
                       javax.ws.rs.core.UriInfo uriInfo,
                       @Context
                       javax.ws.rs.core.HttpHeaders httpHeaders,
                       @Suspended
                       javax.ws.rs.container.AsyncResponse asyncResponse)
        Fetches the overall metadata about protocols supported by the homeserver. Includes both the available protocols and all fields required for queries against each protocol.
        Requires auth: Yes.
        Return: Map from the String to the Protocol.

        Status code 200: The protocols supported by the homeserver.

        Parameters:
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • protocol

        @GET
        @Path("/protocol/{protocol}")
        void protocol​(@PathParam("protocol")
                      String protocol,
                      @Context
                      javax.ws.rs.core.UriInfo uriInfo,
                      @Context
                      javax.ws.rs.core.HttpHeaders httpHeaders,
                      @Suspended
                      javax.ws.rs.container.AsyncResponse asyncResponse)
        Fetches the metadata from the homeserver about a particular third party protocol.
        Requires auth: Yes.
        Return: Protocol.

        Status code 200: The protocol was found and metadata returned.

        Status code 404: The protocol is unknown.

        Parameters:
        protocol - Required. The name of the protocol.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • locationProtocol

        @GET
        @Path("/location/{protocol}")
        void locationProtocol​(@PathParam("protocol")
                              String protocol,
                              @Context
                              javax.ws.rs.core.UriInfo uriInfo,
                              @Context
                              javax.ws.rs.core.HttpHeaders httpHeaders,
                              @Suspended
                              javax.ws.rs.container.AsyncResponse asyncResponse)
        Requesting this endpoint with a valid protocol name results in a list of successful mapping results in a JSON array. Each result contains objects to represent the Matrix room or rooms that represent a portal to this third party network. Each has the Matrix room alias string, an identifier for the particular third party network protocol, and an object containing the network-specific fields that comprise this identifier. It should attempt to canonicalise the identifier as much as reasonably possible given the network type.
        Requires auth: Yes.
        Return: List of the ProtocolLocations.

        Status code 200: At least one portal room was found.

        Status code 404: No portal rooms were found.

        Parameters:
        protocol - Required. The protocol used to communicate to the third party network.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • userProtocol

        @GET
        @Path("/user/{protocol}")
        void userProtocol​(@PathParam("protocol")
                          String protocol,
                          @Context
                          javax.ws.rs.core.UriInfo uriInfo,
                          @Context
                          javax.ws.rs.core.HttpHeaders httpHeaders,
                          @Suspended
                          javax.ws.rs.container.AsyncResponse asyncResponse)
        Retrieve a Matrix User ID linked to a user on the third party service, given a set of user parameters.
        Requires auth: Yes.
        Return: List of the ProtocolUsers.

        Status code 200: The Matrix User IDs found with the given parameters.

        Status code 404: The Matrix User ID was not found.

        Parameters:
        protocol - Required. The name of the protocol.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • location

        @GET
        @Path("/location")
        void location​(@QueryParam("alias")
                      String alias,
                      @Context
                      javax.ws.rs.core.UriInfo uriInfo,
                      @Context
                      javax.ws.rs.core.HttpHeaders httpHeaders,
                      @Suspended
                      javax.ws.rs.container.AsyncResponse asyncResponse)
        Retrieve an array of third party network locations from a Matrix room alias.
        Requires auth: Yes.
        Return: List of the ProtocolLocations.

        Status code 200: At least one portal room was found.

        Status code 404: No portal rooms were found.

        Parameters:
        alias - Required. The Matrix room alias to look up.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • user

        @GET
        @Path("/user")
        void user​(@QueryParam("userid")
                  String userId,
                  @Context
                  javax.ws.rs.core.UriInfo uriInfo,
                  @Context
                  javax.ws.rs.core.HttpHeaders httpHeaders,
                  @Suspended
                  javax.ws.rs.container.AsyncResponse asyncResponse)
        Retrieve an array of third party users from a Matrix User ID.
        Requires auth: Yes.
        Return: List of the ProtocolUsers.

        Status code 200: The Matrix User IDs found with the given parameters.

        Status code 404: The Matrix User ID was not found.

        Parameters:
        userId - Required. The Matrix User ID to look up.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.