All URIs are relative to https://api.smooch.io
Method | HTTP request | Description |
---|---|---|
joinConversation | POST /v2/apps/{appId}/conversations/{conversationId}/join | Join Conversation |
leaveConversation | POST /v2/apps/{appId}/conversations/{conversationId}/leave | Leave Conversation |
listParticipants | GET /v2/apps/{appId}/conversations/{conversationId}/participants | List Participants |
ParticipantResponse joinConversation(appId, conversationId, participantJoinBody)
Join Conversation
Adds a user to a conversation using either their userId or userExternalId. The endpoint only supports adding a participant to a sdkGroup 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.ParticipantsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
var participantJoinBody = new SunshineConversationsClient.ParticipantJoinBody(); // ParticipantJoinBody |
apiInstance.joinConversation(appId, conversationId, participantJoinBody).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. | |
participantJoinBody | ParticipantJoinBody |
- Content-Type: application/json
- Accept: application/json
Object leaveConversation(appId, conversationId, participantLeaveBody)
Leave Conversation
Removes a user from a conversation using either their userId, userExternalId, or participantId.
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.ParticipantsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
var participantLeaveBody = new SunshineConversationsClient.ParticipantLeaveBody(); // ParticipantLeaveBody |
apiInstance.leaveConversation(appId, conversationId, participantLeaveBody).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. | |
participantLeaveBody | ParticipantLeaveBody |
Object
- Content-Type: application/json
- Accept: application/json
ParticipantListResponse listParticipants(appId, conversationId, opts)
List Participants
Lists all the participants of a particular conversation. This API is paginated through cursor pagination. ```shell /v2/apps/:appId/conversations/:conversationId/participants?page[before]=26508c10541a4b0ff472e5e2 ```
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.ParticipantsApi();
var appId = "5d8cff3cd55b040010928b5b"; // String | Identifies the app.
var conversationId = "029c31f25a21b47effd7be90"; // String | Identifies the conversation.
var opts = {
'page': new SunshineConversationsClient.Page() // Page | Contains parameters for applying cursor pagination.
};
apiInstance.listParticipants(appId, conversationId, 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. | |
conversationId | String | Identifies the conversation. | |
page | Page | Contains parameters for applying cursor pagination. | [optional] |
- Content-Type: Not defined
- Accept: application/json