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(appId, conversationCreateBody)
Create Conversation
Create a conversation for the specified user(s).
var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';
// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';
var apiInstance = new SunshineConversationsClient.ConversationsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationCreateBody = new SunshineConversationsClient.ConversationCreateBody(); // ConversationCreateBody |
apiInstance.createConversation(appId, conversationCreateBody).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationCreateBody | ConversationCreateBody |
- Content-Type: application/json
- Accept: application/json
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.
var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';
// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';
var apiInstance = new SunshineConversationsClient.ConversationsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
apiInstance.deleteConversation(appId, conversationId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. |
Object
- Content-Type: Not defined
- Accept: application/json
{String: Object} downloadMessageRef(appId, conversationId, downloadMessageRefBody)
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.
var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';
// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';
var apiInstance = new SunshineConversationsClient.ConversationsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
var downloadMessageRefBody = {"userId":"6e416caac6a5e9544e3fb6d7","apple":{"interactiveDataRef":{"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 |
apiInstance.downloadMessageRef(appId, conversationId, downloadMessageRefBody).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. | |
downloadMessageRefBody | DownloadMessageRefBody |
{String: Object}
- Content-Type: application/json
- Accept: application/json
ConversationResponse getConversation(appId, conversationId)
Get Conversation
Fetches an individual conversation.
var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';
// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';
var apiInstance = new SunshineConversationsClient.ConversationsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
apiInstance.getConversation(appId, conversationId).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. |
- Content-Type: Not defined
- Accept: application/json
ConversationListResponse listConversations(appId, filter, opts)
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 ```
var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';
// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';
var apiInstance = new SunshineConversationsClient.ConversationsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var filter = new SunshineConversationsClient.ConversationListFilter(); // ConversationListFilter | Contains parameters for filtering the results.
var opts = {
'page': new SunshineConversationsClient.Page() // Page | Contains parameters for applying cursor pagination.
};
apiInstance.listConversations(appId, filter, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
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
ConversationResponse updateConversation(appId, conversationId, conversationUpdateBody)
Update Conversation
Updates a conversation record.
var SunshineConversationsClient = require('sunshine-conversations-client');
var defaultClient = SunshineConversationsClient.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR_USERNAME';
basicAuth.password = 'YOUR_PASSWORD';
// Uncomment this section to use JWTs instead
// var bearerAuth = defaultClient.authentications['bearerAuth'];
// bearerAuth.accessToken = 'YOUR_ACCESS_TOKEN';
var apiInstance = new SunshineConversationsClient.ConversationsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
var conversationUpdateBody = new SunshineConversationsClient.ConversationUpdateBody(); // ConversationUpdateBody |
apiInstance.updateConversation(appId, conversationId, conversationUpdateBody).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
appId | String | Identifies the app. | |
conversationId | String | Identifies the conversation. | |
conversationUpdateBody | ConversationUpdateBody |
- Content-Type: application/json
- Accept: application/json