Interface FederationV2Api
-
@Path("/_matrix/federation/v2") @Consumes("application/json") @Produces("application/json") public interface FederationV2Api
Matrix homeservers use the Federation APIs (also known as server-server APIs) to communicate with each other. Homeservers use these APIs to push messages to each other in real-time, to request historic messages from each other, and to query profile and presence information about users on each other's servers.
The APIs are implemented using HTTPS GETs and PUTs between each of the servers. These HTTPS requests are strongly authenticated using public key signatures at the TLS transport layer and using public key signatures in HTTP Authorization headers at the HTTP layer.
-
-
Method Summary
Modifier and Type Method Description void
invite(String roomId, String eventId, InviteV2Request request, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
Invites a remote user to a room.
-
-
-
Method Detail
-
invite
@PUT @Path("/invite/{roomId}/{eventId}") void invite(@PathParam("roomId") String roomId, @PathParam("eventId") String eventId, InviteV2Request request, @Context javax.ws.rs.core.UriInfo uriInfo, @Context javax.ws.rs.core.HttpHeaders httpHeaders, @Suspended javax.ws.rs.container.AsyncResponse asyncResponse)
Invites a remote user to a room. Once the event has been signed by both the inviting homeserver and the invited homeserver, it can be sent to all of the servers in the room by the inviting homeserver.
This endpoint is preferred over the v1 API as it is more useful for servers. Senders which receive a 400 or 404 response to this endpoint should retry using the v1 API as the server may be older, if the room version is "1" or "2".
Note that events have a different format depending on the room version - check the room version specification for precise event formats. The request and response bodies here describe the common event fields in more detail and may be missing other required fields for a PDU.
Requires auth: Yes.
Return: List of theInteger
andEventContainer
.Status code 200: The event with the invited server's signature added. All other fields of the events should remain untouched. Note that events have a different format depending on the room version - check the room version specification for precise event formats.
Status code 403: The invite is not allowed. This could be for a number of reasons, including:
- The sender is not allowed to send invites to the target user/homeserver.
- The homeserver does not permit anyone to invite its users.
- The homeserver refuses to participate in the room.
- Parameters:
roomId
- Required. The room ID that the user is being invited to.eventId
- Required. The event ID for the invite event, generated by the inviting server.request
- Invite JSON request.uriInfo
- Request Information.httpHeaders
- Http headers.asyncResponse
- Asynchronous response.
-
-