Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.symphonyoss.symphony.agent.api;
import org.symphonyoss.symphony.agent.invoker.ApiException;
import org.symphonyoss.symphony.agent.invoker.ApiClient;
import org.symphonyoss.symphony.agent.invoker.Configuration;
import org.symphonyoss.symphony.agent.invoker.Pair;
import javax.ws.rs.core.GenericType;
import org.symphonyoss.symphony.agent.model.Error;
import java.io.File;
import org.symphonyoss.symphony.agent.model.ImportResponseList;
import org.symphonyoss.symphony.agent.model.Message;
import org.symphonyoss.symphony.agent.model.MessageImportList;
import org.symphonyoss.symphony.agent.model.MessageList;
import org.symphonyoss.symphony.agent.model.MessageSearchQuery;
import org.symphonyoss.symphony.agent.model.MessageSubmission;
import org.symphonyoss.symphony.agent.model.V2ImportResponseList;
import org.symphonyoss.symphony.agent.model.V2Message;
import org.symphonyoss.symphony.agent.model.V2MessageImportList;
import org.symphonyoss.symphony.agent.model.V2MessageList;
import org.symphonyoss.symphony.agent.model.V2MessageSubmission;
import org.symphonyoss.symphony.agent.model.V4ImportResponseList;
import org.symphonyoss.symphony.agent.model.V4Message;
import org.symphonyoss.symphony.agent.model.V4MessageImportList;
import org.symphonyoss.symphony.agent.model.V4MessageList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2017-10-14T03:33:40.723-04:00")
public class MessagesApi {
private ApiClient apiClient;
public MessagesApi() {
this(Configuration.getDefaultApiClient());
}
public MessagesApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* 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.
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param messageList (required)
* @return ImportResponseList
* @throws ApiException if fails to make API call
*/
public ImportResponseList v1MessageImportPost(String sessionToken, String keyManagerToken, MessageImportList messageList) throws ApiException {
Object localVarPostBody = messageList;
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1MessageImportPost");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v1MessageImportPost");
}
// verify the required parameter 'messageList' is set
if (messageList == null) {
throw new ApiException(400, "Missing the required parameter 'messageList' when calling v1MessageImportPost");
}
// create path and map variables
String localVarPath = "/v1/message/import".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param query The search query. See above for the query syntax. (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param skip No. of results to skip. (optional)
* @param limit Max no. of results to return. If no value is provided, 50 is the default. (optional)
* @param scope Describes where content should be searched for that query. It can exclusively apply to Symphony content or to one Connector. (optional)
* @return V4MessageList
* @throws ApiException if fails to make API call
*/
public V4MessageList v1MessageSearchGet(String query, String sessionToken, String keyManagerToken, Integer skip, Integer limit, String scope) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'query' is set
if (query == null) {
throw new ApiException(400, "Missing the required parameter 'query' when calling v1MessageSearchGet");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1MessageSearchGet");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v1MessageSearchGet");
}
// create path and map variables
String localVarPath = "/v1/message/search".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip", skip));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scope", scope));
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Search messages
* Search messages according to the specified criteria.
* @param query The search query. See above for the query syntax. (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param skip No. of results to skip. (optional)
* @param limit Max no. of results to return. If no value is provided, 50 is the default. (optional)
* @param scope Describes where content should be searched for that query. It can exclusively apply to Symphony content or to one Connector. (optional)
* @return V4MessageList
* @throws ApiException if fails to make API call
*/
public V4MessageList v1MessageSearchPost(MessageSearchQuery query, String sessionToken, String keyManagerToken, Integer skip, Integer limit, String scope) throws ApiException {
Object localVarPostBody = query;
// verify the required parameter 'query' is set
if (query == null) {
throw new ApiException(400, "Missing the required parameter 'query' when calling v1MessageSearchPost");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1MessageSearchPost");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v1MessageSearchPost");
}
// create path and map variables
String localVarPath = "/v1/message/search".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip", skip));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "scope", scope));
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sid Stream ID (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param message (required)
* @return Message
* @throws ApiException if fails to make API call
*/
public Message v1StreamSidMessageCreatePost(String sid, String sessionToken, String keyManagerToken, MessageSubmission message) throws ApiException {
Object localVarPostBody = message;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v1StreamSidMessageCreatePost");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1StreamSidMessageCreatePost");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v1StreamSidMessageCreatePost");
}
// verify the required parameter 'message' is set
if (message == null) {
throw new ApiException(400, "Missing the required parameter 'message' when calling v1StreamSidMessageCreatePost");
}
// create path and map variables
String localVarPath = "/v1/stream/{sid}/message/create".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sid Stream ID (required)
* @param since Timestamp of first required message. This is a long integer value representing milliseconds since Jan 1 1970 (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param offset No. of messages to skip. (optional)
* @param maxMessages Max No. of messages to return. If no value is provided, 50 is the default. (optional)
* @return MessageList
* @throws ApiException if fails to make API call
*/
public MessageList v1StreamSidMessageGet(String sid, Long since, String sessionToken, String keyManagerToken, Integer offset, Integer maxMessages) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v1StreamSidMessageGet");
}
// verify the required parameter 'since' is set
if (since == null) {
throw new ApiException(400, "Missing the required parameter 'since' when calling v1StreamSidMessageGet");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v1StreamSidMessageGet");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v1StreamSidMessageGet");
}
// create path and map variables
String localVarPath = "/v1/stream/{sid}/message".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "since", since));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "maxMessages", maxMessages));
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param messageList (required)
* @return V2ImportResponseList
* @throws ApiException if fails to make API call
*/
public V2ImportResponseList v2MessageImportPost(String sessionToken, String keyManagerToken, V2MessageImportList messageList) throws ApiException {
Object localVarPostBody = messageList;
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v2MessageImportPost");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v2MessageImportPost");
}
// verify the required parameter 'messageList' is set
if (messageList == null) {
throw new ApiException(400, "Missing the required parameter 'messageList' when calling v2MessageImportPost");
}
// create path and map variables
String localVarPath = "/v2/message/import".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sid Stream ID (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param message (required)
* @return V2Message
* @throws ApiException if fails to make API call
*/
public V2Message v2StreamSidMessageCreatePost(String sid, String sessionToken, String keyManagerToken, V2MessageSubmission message) throws ApiException {
Object localVarPostBody = message;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v2StreamSidMessageCreatePost");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v2StreamSidMessageCreatePost");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v2StreamSidMessageCreatePost");
}
// verify the required parameter 'message' is set
if (message == null) {
throw new ApiException(400, "Missing the required parameter 'message' when calling v2StreamSidMessageCreatePost");
}
// create path and map variables
String localVarPath = "/v2/stream/{sid}/message/create".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sid Stream ID (required)
* @param since Timestamp of first required message. This is a long integer value representing milliseconds since Jan 1 1970 (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param offset No. of messages to skip. (optional)
* @param limit Max No. of messages to return. If no value is provided, 50 is the default. (optional)
* @return V2MessageList
* @throws ApiException if fails to make API call
*/
public V2MessageList v2StreamSidMessageGet(String sid, Long since, String sessionToken, String keyManagerToken, Integer offset, Integer limit) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v2StreamSidMessageGet");
}
// verify the required parameter 'since' is set
if (since == null) {
throw new ApiException(400, "Missing the required parameter 'since' when calling v2StreamSidMessageGet");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v2StreamSidMessageGet");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v2StreamSidMessageGet");
}
// create path and map variables
String localVarPath = "/v2/stream/{sid}/message".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "since", since));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sid Stream ID (required)
* @param sessionToken Authorization token used to make delegated calls. (required)
* @param message (required)
* @param keyManagerToken Key Manager authentication token. (optional)
* @return V2Message
* @throws ApiException if fails to make API call
*/
public V2Message v3StreamSidMessageCreatePost(String sid, String sessionToken, V2MessageSubmission message, String keyManagerToken) throws ApiException {
Object localVarPostBody = message;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v3StreamSidMessageCreatePost");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v3StreamSidMessageCreatePost");
}
// verify the required parameter 'message' is set
if (message == null) {
throw new ApiException(400, "Missing the required parameter 'message' when calling v3StreamSidMessageCreatePost");
}
// create path and map variables
String localVarPath = "/v3/stream/{sid}/message/create".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param messageList (required)
* @return V4ImportResponseList
* @throws ApiException if fails to make API call
*/
public V4ImportResponseList v4MessageImportPost(String sessionToken, String keyManagerToken, V4MessageImportList messageList) throws ApiException {
Object localVarPostBody = messageList;
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v4MessageImportPost");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v4MessageImportPost");
}
// verify the required parameter 'messageList' is set
if (messageList == null) {
throw new ApiException(400, "Missing the required parameter 'messageList' when calling v4MessageImportPost");
}
// create path and map variables
String localVarPath = "/v4/message/import".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sid Stream ID (required)
* @param sessionToken Authorization token used to make delegated calls. (required)
* @param keyManagerToken Key Manager authentication token. (optional)
* @param message The message payload in MessageML. (optional)
* @param data Optional message data in EntityJSON. (optional)
* @param version Optional message version in the format \"major.minor\". If empty, defaults to the latest supported version. (optional)
* @param attachment Optional file attachment. (optional)
* @param preview Optional attachment preview. (optional)
* @return V4Message
* @throws ApiException if fails to make API call
*/
public V4Message v4StreamSidMessageCreatePost(String sid, String sessionToken, String keyManagerToken, String message, String data, String version, File attachment, File preview) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v4StreamSidMessageCreatePost");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v4StreamSidMessageCreatePost");
}
// create path and map variables
String localVarPath = "/v4/stream/{sid}/message/create".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
if (message != null)
localVarFormParams.put("message", message);
if (data != null)
localVarFormParams.put("data", data);
if (version != null)
localVarFormParams.put("version", version);
if (attachment != null)
localVarFormParams.put("attachment", attachment);
if (preview != null)
localVarFormParams.put("preview", preview);
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data", "application/x-www-form-urlencoded"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* 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.
* @param sid Stream ID (required)
* @param since Timestamp of first required message. This is a long integer value representing milliseconds since Jan 1 1970 (required)
* @param sessionToken Session authentication token. (required)
* @param keyManagerToken Key Manager authentication token. (required)
* @param skip No. of messages to skip. (optional)
* @param limit Max No. of messages to return. If no value is provided, 50 is the default. The maximum supported value is 500. (optional)
* @return V4MessageList
* @throws ApiException if fails to make API call
*/
public V4MessageList v4StreamSidMessageGet(String sid, Long since, String sessionToken, String keyManagerToken, Integer skip, Integer limit) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'sid' is set
if (sid == null) {
throw new ApiException(400, "Missing the required parameter 'sid' when calling v4StreamSidMessageGet");
}
// verify the required parameter 'since' is set
if (since == null) {
throw new ApiException(400, "Missing the required parameter 'since' when calling v4StreamSidMessageGet");
}
// verify the required parameter 'sessionToken' is set
if (sessionToken == null) {
throw new ApiException(400, "Missing the required parameter 'sessionToken' when calling v4StreamSidMessageGet");
}
// verify the required parameter 'keyManagerToken' is set
if (keyManagerToken == null) {
throw new ApiException(400, "Missing the required parameter 'keyManagerToken' when calling v4StreamSidMessageGet");
}
// create path and map variables
String localVarPath = "/v4/stream/{sid}/message".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "sid" + "\\}", apiClient.escapeString(sid.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "since", since));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip", skip));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
if (sessionToken != null)
localVarHeaderParams.put("sessionToken", apiClient.parameterToString(sessionToken));
if (keyManagerToken != null)
localVarHeaderParams.put("keyManagerToken", apiClient.parameterToString(keyManagerToken));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}