All URIs are relative to https://api.smooch.io
Method | HTTP request | Description |
---|---|---|
deleteAllMessages | DELETE /v2/apps/{appId}/conversations/{conversationId}/messages | Delete All Messages |
deleteMessage | DELETE /v2/apps/{appId}/conversations/{conversationId}/messages/{messageId} | Delete Message |
listMessages | GET /v2/apps/{appId}/conversations/{conversationId}/messages | List Messages |
postMessage | POST /v2/apps/{appId}/conversations/{conversationId}/messages | Post Message |
Object deleteAllMessages(appId, conversationId)
Delete All Messages
Delete all messages of a particular conversation.
import com.zendesk.sunshine_conversations_client.ApiClient;
import com.zendesk.sunshine_conversations_client.ApiException;
import com.zendesk.sunshine_conversations_client.Configuration;
import com.zendesk.sunshine_conversations_client.auth.*;
import com.zendesk.sunshine_conversations_client.model.*;
import com.zendesk.sunshine_conversations_client.api.MessagesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.smooch.io");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("API_KEY_ID");
basicAuth.setPassword("API_KEY_SECRET");
// Uncomment this section to use JWTs instead
// HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
// bearerAuth.setBearerToken("YOUR TOKEN OR JWT");
MessagesApi apiInstance = new MessagesApi(defaultClient);
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
// Add required body parameters
try {
Object result = apiInstance.deleteAllMessages(appId, conversationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessagesApi#deleteAllMessages");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. |
Object
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Ok | - |
404 | Not found | - |
Object deleteMessage(appId, conversationId, messageId)
Delete Message
Delete a single message of a particular conversation.
import com.zendesk.sunshine_conversations_client.ApiClient;
import com.zendesk.sunshine_conversations_client.ApiException;
import com.zendesk.sunshine_conversations_client.Configuration;
import com.zendesk.sunshine_conversations_client.auth.*;
import com.zendesk.sunshine_conversations_client.model.*;
import com.zendesk.sunshine_conversations_client.api.MessagesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.smooch.io");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("API_KEY_ID");
basicAuth.setPassword("API_KEY_SECRET");
// Uncomment this section to use JWTs instead
// HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
// bearerAuth.setBearerToken("YOUR TOKEN OR JWT");
MessagesApi apiInstance = new MessagesApi(defaultClient);
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
String messageId = "029c31f25a21b47effd7be90"; // String | The id of the message.
// Add required body parameters
try {
Object result = apiInstance.deleteMessage(appId, conversationId, messageId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessagesApi#deleteMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. | |
messageId | String | The id of the message. |
Object
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Ok | - |
404 | Not found | - |
MessageListResponse listMessages(appId, conversationId, page)
List Messages
List all messages for a particular conversation. This API is paginated through cursor pagination, in the backwards direction, with the most recent (i.e. last) page of messages being returned by default. The `hasMore` flag indicates whether more messages exist in the direction you are currently paginating through. To page backwards in the history, use the `beforeCursor` or follow the `prev` link. The page size limit is fixed at 100 messages per page. ```shell /v2/apps/:appId/conversations/:conversationId/messages?page[before]=5f32b88acf6bf25073b2be56 ```
import com.zendesk.sunshine_conversations_client.ApiClient;
import com.zendesk.sunshine_conversations_client.ApiException;
import com.zendesk.sunshine_conversations_client.Configuration;
import com.zendesk.sunshine_conversations_client.auth.*;
import com.zendesk.sunshine_conversations_client.model.*;
import com.zendesk.sunshine_conversations_client.api.MessagesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.smooch.io");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("API_KEY_ID");
basicAuth.setPassword("API_KEY_SECRET");
// Uncomment this section to use JWTs instead
// HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
// bearerAuth.setBearerToken("YOUR TOKEN OR JWT");
MessagesApi apiInstance = new MessagesApi(defaultClient);
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
Page page = new Page(); // Page | Contains parameters for applying cursor pagination.
// Add required body parameters
try {
MessageListResponse result = apiInstance.listMessages(appId, conversationId, page);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessagesApi#listMessages");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. | |
page | Page | Contains parameters for applying cursor pagination. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Ok | - |
404 | Message not found | - |
MessagePostResponse postMessage(messagePost, appId, conversationId)
Post Message
Send a message in a particular conversation.
import com.zendesk.sunshine_conversations_client.ApiClient;
import com.zendesk.sunshine_conversations_client.ApiException;
import com.zendesk.sunshine_conversations_client.Configuration;
import com.zendesk.sunshine_conversations_client.auth.*;
import com.zendesk.sunshine_conversations_client.model.*;
import com.zendesk.sunshine_conversations_client.api.MessagesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.smooch.io");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("API_KEY_ID");
basicAuth.setPassword("API_KEY_SECRET");
// Uncomment this section to use JWTs instead
// HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
// bearerAuth.setBearerToken("YOUR TOKEN OR JWT");
MessagesApi apiInstance = new MessagesApi(defaultClient);
MessagePost messagePost = new MessagePost(); // MessagePost |
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
// Add required body parameters
try {
MessagePostResponse result = apiInstance.postMessage(messagePost, appId, conversationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessagesApi#postMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
messagePost | MessagePost | ||
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
423 | Message limit reached <aside class="notice">To learn more about the conversation message limit, consult the section in the introduction linked <a href="#section/Introduction/Conversation-Size-Limits">here</a>.</aside> | - |