All URIs are relative to https://api.smooch.io
| Method | HTTP request | Description |
|---|---|---|
| create_conversation | POST /v2/apps/{appId}/conversations | Create Conversation |
| delete_conversation | DELETE /v2/apps/{appId}/conversations/{conversationId} | Delete Conversation |
| get_conversation | GET /v2/apps/{appId}/conversations/{conversationId} | Get Conversation |
| list_conversations | GET /v2/apps/{appId}/conversations | List Conversations |
| update_conversation | PATCH /v2/apps/{appId}/conversations/{conversationId} | Update Conversation |
ConversationResponse create_conversation(app_id, conversation_create_body)
Create Conversation
Create a conversation for the specified user(s).
# load the gem
require 'sunshine-conversations-client'
# setup authorization
SunshineConversationsClient.configure do |config|
# Configure HTTP basic authorization: basicAuth
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this line to use JWTs
# config.access_token = 'YOUR_JWT'
end
api_instance = SunshineConversationsClient::ConversationsApi.new
app_id = '5d8cff3cd55b040010928b5b' # String | Identifies the app.
conversation_create_body = SunshineConversationsClient::ConversationCreateBody.new # ConversationCreateBody |
# Be sure to add the required body parameters
begin
#Create Conversation
result = api_instance.create_conversation(app_id, conversation_create_body)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling ConversationsApi->create_conversation: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_create_body | ConversationCreateBody |
- Content-Type: application/json
- Accept: application/json
Object delete_conversation(app_id, conversation_id)
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.
# load the gem
require 'sunshine-conversations-client'
# setup authorization
SunshineConversationsClient.configure do |config|
# Configure HTTP basic authorization: basicAuth
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this line to use JWTs
# config.access_token = 'YOUR_JWT'
end
api_instance = SunshineConversationsClient::ConversationsApi.new
app_id = '5d8cff3cd55b040010928b5b' # String | Identifies the app.
conversation_id = '029c31f25a21b47effd7be90' # String | Identifies the conversation.
# Be sure to add the required body parameters
begin
#Delete Conversation
result = api_instance.delete_conversation(app_id, conversation_id)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling ConversationsApi->delete_conversation: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_id | String | Identifies the conversation. |
Object
- Content-Type: Not defined
- Accept: application/json
ConversationResponse get_conversation(app_id, conversation_id)
Get Conversation
Fetches an individual conversation.
# load the gem
require 'sunshine-conversations-client'
# setup authorization
SunshineConversationsClient.configure do |config|
# Configure HTTP basic authorization: basicAuth
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this line to use JWTs
# config.access_token = 'YOUR_JWT'
end
api_instance = SunshineConversationsClient::ConversationsApi.new
app_id = '5d8cff3cd55b040010928b5b' # String | Identifies the app.
conversation_id = '029c31f25a21b47effd7be90' # String | Identifies the conversation.
# Be sure to add the required body parameters
begin
#Get Conversation
result = api_instance.get_conversation(app_id, conversation_id)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling ConversationsApi->get_conversation: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_id | String | Identifies the conversation. |
- Content-Type: Not defined
- Accept: application/json
ConversationListResponse list_conversations(app_id, 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
# load the gem
require 'sunshine-conversations-client'
# setup authorization
SunshineConversationsClient.configure do |config|
# Configure HTTP basic authorization: basicAuth
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this line to use JWTs
# config.access_token = 'YOUR_JWT'
end
api_instance = SunshineConversationsClient::ConversationsApi.new
app_id = '5d8cff3cd55b040010928b5b' # String | Identifies the app.
filter = SunshineConversationsClient::ConversationListFilter.new # ConversationListFilter | Contains parameters for filtering the results.
# Be sure to add the required body parameters
opts = {
page: SunshineConversationsClient::Page.new # Page | Contains parameters for applying cursor pagination.
}
begin
#List Conversations
result = api_instance.list_conversations(app_id, filter, opts)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling ConversationsApi->list_conversations: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | 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 update_conversation(app_id, conversation_id, conversation_update_body)
Update Conversation
Updates a conversation record.
# load the gem
require 'sunshine-conversations-client'
# setup authorization
SunshineConversationsClient.configure do |config|
# Configure HTTP basic authorization: basicAuth
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this line to use JWTs
# config.access_token = 'YOUR_JWT'
end
api_instance = SunshineConversationsClient::ConversationsApi.new
app_id = '5d8cff3cd55b040010928b5b' # String | Identifies the app.
conversation_id = '029c31f25a21b47effd7be90' # String | Identifies the conversation.
conversation_update_body = SunshineConversationsClient::ConversationUpdateBody.new # ConversationUpdateBody |
# Be sure to add the required body parameters
begin
#Update Conversation
result = api_instance.update_conversation(app_id, conversation_id, conversation_update_body)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling ConversationsApi->update_conversation: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_id | String | Identifies the conversation. | |
| conversation_update_body | ConversationUpdateBody |
- Content-Type: application/json
- Accept: application/json