@Beta public class RecastMessenger extends Object
Be aware that this class is in Beta (as indicated by the annotation) and therefore subject to breaking changes.
Constructor and Description |
---|
RecastMessenger(String token)
Allows to create an object for communication for sending messages to a conversation.
|
RecastMessenger(String token,
String broadcastUri)
Allows the creation with a new broadcast uri
|
RecastMessenger(String token,
String uriStart,
String uriEnd)
note that start and string url each have to start and end with a / save "the.start/uri/" and "/uriEnd" the final
composition with the conversation Id is: "the.start/uri/{conversationID}/uriEnd"
|
Modifier and Type | Method and Description |
---|---|
int |
broadcastMessage(ResponseInterface... responseMessages)
broadcasts a message to all conversations
|
int |
sendMessage(String conversationId,
ResponseInterface... responseMessages)
Sends an array of Messages to the given conversation
|
public RecastMessenger(@Nonnull String token)
token
- the plain token as given by recast without "Token"public RecastMessenger(@Nonnull String token, @Nonnull String uriStart, @Nonnull String uriEnd)
token
- the token to be useduriStart
- the start/beginning of the uri as given in the example aboveuriEnd
- the ending of the uri as given in the example abovepublic int sendMessage(@Nonnull String conversationId, @Nonnull ResponseInterface... responseMessages) throws ShouldNotHappenException
conversationId
- the conversation id as a stringresponseMessages
- an array of response messages. Can include multiple of texts, cards, ...ShouldNotHappenException
- if an error occurspublic int broadcastMessage(@Nonnull ResponseInterface... responseMessages) throws ShouldNotHappenException
responseMessages
- an array of response messages. Can include multiple of texts, cards, ...ShouldNotHappenException
- if an error occursCopyright © 2020 SAP SE. All rights reserved.