Interface PushApi


  • @Path("/_matrix/client/r0")
    @Produces("application/json")
    @Consumes("application/json")
    public interface PushApi
    This module adds support for push notifications. Homeservers send notifications of events to user-configured HTTP endpoints. Users may also configure a number of rules that determine which events generate notifications. These are all stored and managed by the user's homeserver. This allows user-specific push settings to be reused between client applications.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  PushApi.Actions
      All rules have an associated list of actions.
      static class  PushApi.Condition
      Override, Underride and Default Rules MAY have a list of 'conditions'.
      static class  PushApi.Kind
      Kind of the push rules.
      static class  PushApi.Rule
      Homeservers can specify "server-default rules" which operate at a lower priority than "user-defined rules".
      static class  PushApi.Tweak
      The set_tweak action is used to add an entry to the 'tweaks' dictionary that is sent in the notification request to the Push Gateway.
    • Method Summary

      Modifier and Type Method Description
      void deleteRule​(String scope, String kind, String ruleId, 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 endpoint removes the push rule defined in the path.
      void getActions​(String scope, String kind, String ruleId, 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 endpoint get the actions for the specified push rule.
      void getEnabled​(String scope, String kind, String ruleId, 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 endpoint gets whether the specified push rule is enabled.
      void notifications​(String from, String only, Long limit, 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 is used to paginate through the list of events that the user has been, or would have been notified about.
      void pushRule​(String scope, String kind, String ruleId, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Retrieve a single specified push rule.
      void pushRules​(javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Retrieve all push rulesets for this user.
      void setActions​(String scope, String kind, String ruleId, PushActions pushActions, 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 endpoint allows clients to change the actions of a push rule.
      void setEnabled​(String scope, String kind, String ruleId, PushEnable pushEnable, 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 endpoint allows clients to enable or disable the specified push rule.
      void setPushers​(PushersRequest pushersRequest, 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 endpoint allows the creation, modification and deletion of pushers for this user ID.
      void showPushers​(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 all currently active pushers for the authenticated user.
      void updateRule​(String scope, String kind, String ruleId, String before, String after, PushUpdateRequest pushUpdateRequest, 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 endpoint allows the creation, modification and deletion of pushers for this user ID.
    • Method Detail

      • showPushers

        @GET
        @Path("/pushers")
        void showPushers​(@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 all currently active pushers for the authenticated user.
        Requires auth: Yes.
        Return: PushersResponse.

        Status code 200: The pushers for this user.

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

        @POST
        @Path("/pushers/set")
        void setPushers​(PushersRequest pushersRequest,
                        @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 endpoint allows the creation, modification and deletion of pushers for this user ID. The behaviour of this endpoint varies depending on the values in the JSON body.
        Rate-limited: Yes.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The pusher was set.

        Status code 400: One or more of the pusher values were invalid.

        Status code 429: This request was rate-limited.

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

        @GET
        @Path("/notifications")
        void notifications​(@QueryParam("from")
                           String from,
                           @QueryParam("only")
                           String only,
                           @QueryParam("limit")
                           Long limit,
                           @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 is used to paginate through the list of events that the user has been, or would have been notified about.
        Requires auth: Yes.
        Return: NotificationResponse.

        Status code 200: A batch of events is being returned.

        Parameters:
        from - Pagination token given to retrieve the next set of events.
        only - Allows basic filtering of events returned. Supply highlight to return only events where the notification had the highlight tweak set.
        limit - Limit on the number of events to return in this request.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • pushRules

        @GET
        @Path("/pushrules")
        void pushRules​(@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)
        Retrieve all push rulesets for this user. Clients can "drill-down" on the rulesets by suffixing a scope to this path e.g. /pushrules/global/. This will return a subset of this data under the specified key e.g. the global key.
        Requires auth: Yes.
        Return: PushRulesResponse.

        Status code 200: All the push rulesets for this user.

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

        @GET
        @Path("/pushrules/{scope}/{kind}/{ruleId}")
        void pushRule​(@PathParam("scope")
                      String scope,
                      @PathParam("kind")
                      String kind,
                      @PathParam("ruleId")
                      String ruleId,
                      @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)
        Retrieve a single specified push rule.
        Requires auth: Yes.
        Return: PushRule.

        Status code 200: The specific push rule. This will also include keys specific to the rule itself such as the rule's actions and conditions if set.

        Parameters:
        scope - Required. Global to specify global rules.
        kind - Required. The kind of rule. One of: ["override", "underride", "sender", "room", "content"].
        ruleId - Required. The identifier for the rule.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • deleteRule

        @DELETE
        @Path("/pushrules/{scope}/{kind}/{ruleId}")
        void deleteRule​(@PathParam("scope")
                        String scope,
                        @PathParam("kind")
                        String kind,
                        @PathParam("ruleId")
                        String ruleId,
                        @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 endpoint removes the push rule defined in the path.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The push rule was deleted.

        Parameters:
        scope - Required. Global to specify global rules.
        kind - Required. The kind of rule. One of: ["override", "underride", "sender", "room", "content"].
        ruleId - Required. The identifier for the rule.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • updateRule

        @PUT
        @Path("/pushrules/{scope}/{kind}/{ruleId}")
        void updateRule​(@PathParam("scope")
                        String scope,
                        @PathParam("kind")
                        String kind,
                        @PathParam("ruleId")
                        String ruleId,
                        @QueryParam("before")
                        String before,
                        @QueryParam("after")
                        String after,
                        PushUpdateRequest pushUpdateRequest,
                        @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 endpoint allows the creation, modification and deletion of pushers for this user ID. The behaviour of this endpoint varies depending on the values in the JSON body.
        Rate-limited: Yes.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The pusher was set.

        Status code 400: There was a problem configuring this push rule.

        Status code 429: This request was rate-limited.

        Parameters:
        scope - Required. Global to specify global rules.
        kind - Required. The kind of rule. One of: ["override", "underride", "sender", "room", "content"].
        ruleId - Required. The identifier for the rule.
        before - Use 'before' with a rule_id as its value to make the new rule the next-most important rule with respect to the given user defined rule. It is not possible to add a rule relative to a predefined server rule.
        after - This makes the new rule the next-less important rule relative to the given user defined rule. It is not possible to add a rule relative to a predefined server rule.
        pushUpdateRequest - JSON body request.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • getEnabled

        @GET
        @Path("/pushrules/{scope}/{kind}/{ruleId}/enabled")
        void getEnabled​(@PathParam("scope")
                        String scope,
                        @PathParam("kind")
                        String kind,
                        @PathParam("ruleId")
                        String ruleId,
                        @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 endpoint gets whether the specified push rule is enabled.
        Requires auth: Yes.
        Return: PushEnable.

        Status code 200: Whether the push rule is enabled.

        Parameters:
        scope - Required. Either global or device/<profile_tag> to specify global rules or device rules for the given profile_tag.
        kind - Required. The kind of rule. One of: ["override", "underride", "sender", "room", "content"].
        ruleId - Required. The identifier for the rule.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • setEnabled

        @PUT
        @Path("/pushrules/{scope}/{kind}/{ruleId}/enabled")
        void setEnabled​(@PathParam("scope")
                        String scope,
                        @PathParam("kind")
                        String kind,
                        @PathParam("ruleId")
                        String ruleId,
                        PushEnable pushEnable,
                        @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 endpoint allows clients to enable or disable the specified push rule.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The push rule was enabled or disabled.

        Parameters:
        scope - Required. Global to specify global rules.
        kind - Required. The kind of rule. One of: ["override", "underride", "sender", "room", "content"].
        ruleId - Required. The identifier for the rule.
        pushEnable - JSON body request.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • getActions

        @GET
        @Path("/pushrules/{scope}/{kind}/{ruleId}/actions")
        void getActions​(@PathParam("scope")
                        String scope,
                        @PathParam("kind")
                        String kind,
                        @PathParam("ruleId")
                        String ruleId,
                        @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 endpoint get the actions for the specified push rule.
        Requires auth: Yes.
        Return: PushActions.

        Status code 200: The actions for this push rule.

        Parameters:
        scope - Required. Either global or device/<profile_tag> to specify global rules or device rules for the given profile_tag.
        kind - Required. The kind of rule One of: ["override", "underride", "sender", "room", "content"].
        ruleId - Required. The identifier for the rule.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • setActions

        @PUT
        @Path("/pushrules/{scope}/{kind}/{ruleId}/actions")
        void setActions​(@PathParam("scope")
                        String scope,
                        @PathParam("kind")
                        String kind,
                        @PathParam("ruleId")
                        String ruleId,
                        PushActions pushActions,
                        @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 endpoint allows clients to change the actions of a push rule. This can be used to change the actions of builtin rules.
        Requires auth: Yes.
        Return: EmptyResponse.

        Status code 200: The actions for the push rule were set.

        Parameters:
        scope - Required. Global to specify global rules.
        kind - Required. The kind of rule. One of: ["override", "underride", "sender", "room", "content"].
        ruleId - Required. The identifier for the rule.
        pushActions - JSON body request.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.