Interface MessagesApi


  • @Path("/")
    public interface MessagesApi
    Agent API

    This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to aome subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2

    • Method Detail

      • v1MessageIdGet

        @GET
        @Path("/v1/message/{id}")
        @Produces("application/json")
        V4Message v1MessageIdGet​(@HeaderParam("sessionToken")
                                 String sessionToken,
                                 @HeaderParam("keyManagerToken")
                                 String keyManagerToken,
                                 @PathParam("id")
                                 String id)
        Get a message by ID
      • v1MessageImportPost

        @POST
        @Path("/v1/message/import")
        @Consumes("application/json")
        @Produces("application/json")
        ImportResponseList v1MessageImportPost​(List<ImportedMessage> body,
                                               @HeaderParam("sessionToken")
                                               String sessionToken,
                                               @HeaderParam("keyManagerToken")
                                               String keyManagerToken)
        Import messages from other systems into Symphony. Sends a message to be imported into the system. Allows you to override the timestamp and author of the message with your desired values. The requesting user must have the Content Management role. The user that the message is intended to have come from must also be present in the conversation. The intended message timestamp must be a valid time from the past. It cannot be a future timestamp.
      • v1MessageSearchGet

        @GET
        @Path("/v1/message/search")
        @Produces("application/json")
        V4MessageList v1MessageSearchGet​(@QueryParam("query")
                                         String query,
                                         @HeaderParam("sessionToken")
                                         String sessionToken,
                                         @HeaderParam("keyManagerToken")
                                         String keyManagerToken,
                                         @QueryParam("skip")
                                         Integer skip,
                                         @QueryParam("limit")
                                         Integer limit,
                                         @QueryParam("scope")
                                         String scope,
                                         @QueryParam("sortDir")
                                         String sortDir)
        Search messages Search messages according to the specified criteria. The \"query\" parameter takes a search query defined as \"field:value\" pairs combined by the operator \"AND\" (e.g. \"text:foo AND autor:bar\"). Supported fields are (case-insensitive): \"text\", \"author\", \"hashtag\", \"cashtag\", \"mention\", \"signal\", \"fromDate\", \"toDate\", \"streamId\", \"streamType\". \"text\" search requires a \"streamId\" to be specified. \"streamType\" accepts one of the following values: \"chat\" (IMs and MIMs), \"im\", \"mim\", \"chatroom\", \"post\". \"signal\" queries can only be combined with \"fromDate\", \"toDate\", \"skip\" and \"limit\" parameters.
      • v1MessageSearchPost

        @POST
        @Path("/v1/message/search")
        @Consumes("application/json")
        @Produces("application/json")
        V4MessageList v1MessageSearchPost​(MessageSearchQuery body,
                                          @HeaderParam("sessionToken")
                                          String sessionToken,
                                          @HeaderParam("keyManagerToken")
                                          String keyManagerToken,
                                          @QueryParam("skip")
                                          Integer skip,
                                          @QueryParam("limit")
                                          Integer limit,
                                          @QueryParam("scope")
                                          String scope,
                                          @QueryParam("sortDir")
                                          String sortDir)
        Search messages Search messages according to the specified criteria.
      • v1StreamSidMessageCreatePost

        @POST
        @Path("/v1/stream/{sid}/message/create")
        @Consumes("application/json")
        @Produces("application/json")
        Message v1StreamSidMessageCreatePost​(MessageSubmission body,
                                             @HeaderParam("sessionToken")
                                             String sessionToken,
                                             @HeaderParam("keyManagerToken")
                                             String keyManagerToken,
                                             @PathParam("sid")
                                             String sid)
        Post a message to one existing stream. Post a new message to the given stream. The stream can be a chatroom, an IM or a multiparty IM. If the message parameter type is TEXT then the message contains plain text and cannot include formating, hash tags, mentions etc. If the message parameter type is MessageML then the message contains MessageML which allows for these entities. If the message is in MessageML and fails schema validation a client error results If the message is sent then 200 is returned.
      • v1StreamSidMessageGet

        @GET
        @Path("/v1/stream/{sid}/message")
        @Produces("application/json")
        MessageList v1StreamSidMessageGet​(@PathParam("sid")
                                          String sid,
                                          @QueryParam("since")
                                          Long since,
                                          @HeaderParam("sessionToken")
                                          String sessionToken,
                                          @HeaderParam("keyManagerToken")
                                          String keyManagerToken,
                                          @QueryParam("offset")
                                          Integer offset,
                                          @QueryParam("maxMessages")
                                          Integer maxMessages)
        Get messages from an existing stream. A caller can fetch all unseen messages by passing the timestamp of the last message seen as the since parameter and the number of messages with the same timestamp value already seen as the skip parameter. This means that every message will be seen exactly once even in the case that an additional message is processed with the same timestamp as the last message returned by the previous call, and the case where there are more than maxMessages with the same timestamp value. This method is intended for historic queries and is generally reliable but if guaranteed delivery of every message in real time is required then the equivilent firehose method should be called.
      • v2MessageImportPost

        @POST
        @Path("/v2/message/import")
        @Consumes("application/json")
        @Produces("application/json")
        V2ImportResponseList v2MessageImportPost​(List<V2ImportedMessage> body,
                                                 @HeaderParam("sessionToken")
                                                 String sessionToken,
                                                 @HeaderParam("keyManagerToken")
                                                 String keyManagerToken)
        Import messages from other systems into Symphony. Sends a message to be imported into the system. Allows you to override the timestamp and author of the message with your desired values. The requesting user must have the Content Management role. The user that the message is intended to have come from must also be present in the conversation. The intended message timestamp must be a valid time from the past. It cannot be a future timestamp. Optionally the original message ID can be specified to identify the imported message for the purpose of repeat imports.
      • v2StreamSidMessageCreatePost

        @POST
        @Path("/v2/stream/{sid}/message/create")
        @Consumes("application/json")
        @Produces("application/json")
        V2Message v2StreamSidMessageCreatePost​(V2MessageSubmission body,
                                               @HeaderParam("sessionToken")
                                               String sessionToken,
                                               @HeaderParam("keyManagerToken")
                                               String keyManagerToken,
                                               @PathParam("sid")
                                               String sid)
        Post a message to one existing stream. Post a new message to the given stream. The stream can be a chatroom, an IM or a multiparty IM. You may include an attachment on the message (see the V2MessageSubmission parameter). If the message parameter type is TEXT then the message contains plain text and cannot include formating, hash tags, mentions etc. If the message parameter type is MessageML then the message contains MessageML which allows for these entities. If the message is in MessageML and fails schema validation a client error results If the message is sent then 200 is returned.
      • v2StreamSidMessageGet

        @GET
        @Path("/v2/stream/{sid}/message")
        @Produces("application/json")
        V2MessageList v2StreamSidMessageGet​(@PathParam("sid")
                                            String sid,
                                            @QueryParam("since")
                                            Long since,
                                            @HeaderParam("sessionToken")
                                            String sessionToken,
                                            @HeaderParam("keyManagerToken")
                                            String keyManagerToken,
                                            @QueryParam("offset")
                                            Integer offset,
                                            @QueryParam("limit")
                                            Integer limit)
        Get messages from an existing stream. A caller can fetch all unseen messages by passing the timestamp of the last message seen as the since parameter and the number of messages with the same timestamp value already seen as the skip parameter. This means that every message will be seen exactly once even in the case that an additional message is processed with the same timestamp as the last message returned by the previous call, and the case where there are more than maxMessages with the same timestamp value. This method is intended for historic queries and is generally reliable but if guaranteed delivery of every message in real time is required then the equivilent firehose method should be called.
      • v3StreamSidMessageCreatePost

        @POST
        @Path("/v3/stream/{sid}/message/create")
        @Consumes("application/json")
        @Produces("application/json")
        V2Message v3StreamSidMessageCreatePost​(V2MessageSubmission body,
                                               @HeaderParam("sessionToken")
                                               String sessionToken,
                                               @PathParam("sid")
                                               String sid,
                                               @HeaderParam("keyManagerToken")
                                               String keyManagerToken)
        PROVISIONAL - Post a message to one existing stream. Post a new message to the given stream. The stream can be a chatroom, an IM or a multiparty IM. You may include an attachment on the message (see the V2MessageSubmission parameter). If the message parameter type is TEXT then the message contains plain text and cannot include formating, hash tags, mentions etc. If the message parameter type is MessageML then the message contains MessageML which allows for these entities. If the message is in MessageML and fails schema validation a client error results If the message is sent then 200 is returned. Regarding authentication, you must either use the sessionToken which was created for delegated app access or both the sessionToken and keyManagerToken together.
      • v4MessageImportPost

        @POST
        @Path("/v4/message/import")
        @Consumes("application/json")
        @Produces("application/json")
        V4ImportResponseList v4MessageImportPost​(List<V4ImportedMessage> body,
                                                 @HeaderParam("sessionToken")
                                                 String sessionToken,
                                                 @HeaderParam("keyManagerToken")
                                                 String keyManagerToken)
        Import messages from other systems into Symphony. Sends a message to be imported into the system. Allows you to override the timestamp and author of the message with your desired values. The requesting user must have the Content Management role. The user that the message is intended to have come from must also be present in the conversation. The intended message timestamp must be a valid time from the past. It cannot be a future timestamp. Optionally the original message ID can be specified to identify the imported message for the purpose of repeat imports.
      • v4StreamSidMessageCreatePost

        @POST
        @Path("/v4/stream/{sid}/message/create")
        @Consumes("multipart/form-data")
        @Produces("application/json")
        V4Message v4StreamSidMessageCreatePost​(@HeaderParam("sessionToken")
                                               String sessionToken,
                                               @PathParam("sid")
                                               String sid,
                                               String message,
                                               String data,
                                               String version,
                                               Object attachmentDetail,
                                               Object previewDetail,
                                               @HeaderParam("keyManagerToken")
                                               String keyManagerToken)
        Post a message to one existing stream. Post a new message to the given stream. The stream can be a chatroom, an IM or a multiparty IM. You may include an attachment on the message. The message can be provided as MessageMLV2 or PresentationML. Both formats support Freemarker templates. The optional parameter \"data\" can be used to provide a JSON payload containing entity data. If the message contains explicit references to entity data (in \"data-entity-id\" element attributes), this parameter is required. If the message is in MessageML and fails schema validation a client error results If the message is sent then 200 is returned. Regarding authentication, you must either use the sessionToken which was created for delegated app access or both the sessionToken and keyManagerToken together.
      • v4StreamSidMessageGet

        @GET
        @Path("/v4/stream/{sid}/message")
        @Produces("application/json")
        V4MessageList v4StreamSidMessageGet​(@PathParam("sid")
                                            String sid,
                                            @QueryParam("since")
                                            Long since,
                                            @HeaderParam("sessionToken")
                                            String sessionToken,
                                            @HeaderParam("keyManagerToken")
                                            String keyManagerToken,
                                            @QueryParam("skip")
                                            Integer skip,
                                            @QueryParam("limit")
                                            Integer limit)
        Get messages from an existing stream. A caller can fetch all unseen messages by passing the timestamp of the last message seen as the since parameter and the number of messages with the same timestamp value already seen as the skip parameter. This means that every message will be seen exactly once even in the case that an additional message is processed with the same timestamp as the last message returned by the previous call, and the case where there are more than maxMessages with the same timestamp value. This method is intended for historic queries and is generally reliable but if guaranteed delivery of every message in real time is required then the equivilent firehose method should be called.