All URIs are relative to https://api.smooch.io
Method | HTTP request | Description |
---|---|---|
createConversation | POST /v2/apps/{appId}/conversations | Create Conversation |
deleteConversation | DELETE /v2/apps/{appId}/conversations/{conversationId} | Delete Conversation |
downloadMessageRef | POST /v2/apps/{appId}/conversations/{conversationId}/download | Download Message Ref |
getConversation | GET /v2/apps/{appId}/conversations/{conversationId} | Get Conversation |
listConversations | GET /v2/apps/{appId}/conversations | List Conversations |
updateConversation | PATCH /v2/apps/{appId}/conversations/{conversationId} | Update Conversation |
ConversationResponse createConversation(conversationCreateBody, appId)
Create Conversation
Create a conversation for the specified user(s).
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.ConversationsApi;
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");
ConversationsApi apiInstance = new ConversationsApi(defaultClient);
ConversationCreateBody conversationCreateBody = new ConversationCreateBody(); // ConversationCreateBody |
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
// Add required body parameters
try {
ConversationResponse result = apiInstance.createConversation(conversationCreateBody, appId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConversationsApi#createConversation");
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 |
---|---|---|---|
conversationCreateBody | ConversationCreateBody | ||
appId | String | Identifies the app. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
404 | App not found | - |
Object deleteConversation(appId, conversationId)
Delete Conversation
Delete an entire conversation record, along with its messages and attachments. Note that the default conversation cannot be deleted, but the messages contained can be.
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.ConversationsApi;
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");
ConversationsApi apiInstance = new ConversationsApi(defaultClient);
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
// Add required body parameters
try {
Object result = apiInstance.deleteConversation(appId, conversationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConversationsApi#deleteConversation");
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 | - |
400 | Conversation c93bb9c14dde8ffb94564eae cannot be deleted because it is the default. | - |
404 | Conversation not found | - |
Object downloadMessageRef(downloadMessageRefBody, appId, conversationId)
Download Message Ref
When a third party channel provides a reference of a data, this API can be used to download the reference and fetch the full data. Currently, only apple channel is supported.
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.ConversationsApi;
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");
ConversationsApi apiInstance = new ConversationsApi(defaultClient);
DownloadMessageRefBody downloadMessageRefBody = {"userId":"6e416caac6a5e9544e3fb6d7","apple":{"interactiveDateRef":{"url":"https://p61-content.icloud.com/M58C0A1A2EB62B6E899B4F28996E8DA229E1914295299C39944B2F2CA7482AE50.C01USN00","bid":"com.apple.messages.MSMessageExtensionBalloonPlugin:0000000000:com.apple.icloud.apps.messages.business.extension","key":"00c0d1827fdc858fe7b42421de1fb289c2ee0a9463d787ce4f118506f970bd6e38","signature":"81a619c81da5a01c6139219a5d20e17430c631e1eb","owner":"M58C0A2A1EB62B4E859B4F28996E8DA229E1914295299C39944B2F2CA7482AE50.C01USN00"}}}; // DownloadMessageRefBody |
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
// Add required body parameters
try {
Object result = apiInstance.downloadMessageRef(downloadMessageRefBody, appId, conversationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConversationsApi#downloadMessageRef");
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 |
---|---|---|---|
downloadMessageRefBody | DownloadMessageRefBody | ||
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. |
Object
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Ok | - |
ConversationResponse getConversation(appId, conversationId)
Get Conversation
Fetches an individual 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.ConversationsApi;
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");
ConversationsApi apiInstance = new ConversationsApi(defaultClient);
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
// Add required body parameters
try {
ConversationResponse result = apiInstance.getConversation(appId, conversationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConversationsApi#getConversation");
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. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Ok | - |
404 | Conversation not found | - |
ConversationListResponse listConversations(appId, filter, page)
List Conversations
Lists all conversations that a user is part of. This API is paginated through cursor pagination. ```shell /v2/apps/:appId/conversations?filter[userId]=42589ad070d43be9b00ff7e5 ```
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.ConversationsApi;
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");
ConversationsApi apiInstance = new ConversationsApi(defaultClient);
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
ConversationListFilter filter = new ConversationListFilter(); // ConversationListFilter | Contains parameters for filtering the results.
Page page = new Page(); // Page | Contains parameters for applying cursor pagination.
// Add required body parameters
try {
ConversationListResponse result = apiInstance.listConversations(appId, filter, page);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConversationsApi#listConversations");
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. | |
filter | ConversationListFilter | Contains parameters for filtering the results. | |
page | Page | Contains parameters for applying cursor pagination. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Ok | - |
400 | Invalid page query parameters | - |
404 | User not found | - |
ConversationResponse updateConversation(conversationUpdateBody, appId, conversationId)
Update Conversation
Updates a conversation record.
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.ConversationsApi;
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");
ConversationsApi apiInstance = new ConversationsApi(defaultClient);
ConversationUpdateBody conversationUpdateBody = new ConversationUpdateBody(); // ConversationUpdateBody |
String appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
String conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
// Add required body parameters
try {
ConversationResponse result = apiInstance.updateConversation(conversationUpdateBody, appId, conversationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ConversationsApi#updateConversation");
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 |
---|---|---|---|
conversationUpdateBody | ConversationUpdateBody | ||
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Ok | - |
404 | Conversation not found | - |