RainbowSubmarineTest3356::ConversationApi
All URIs are relative to https://api.smooch.io/v1
Method | HTTP request | Description |
---|---|---|
get_messages | GET /appusers/userId/messages | |
reset_unread_count | POST /appusers/userId/conversation/read | |
trigger_typing_activity | POST /appusers/userId/conversation/activity |
get_messages
GetMessagesResponse get_messages(user_id, , opts)
Get the specified app users messages.
Example
# load the gem
require 'rainbow-submarine-test-3356'
# setup authorization
RainbowSubmarineTest3356.configure do |config|
# Configure API key authorization: appToken
config.api_key['app-token'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['app-token'] = 'Bearer'
# Configure API key authorization: jwt
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = RainbowSubmarineTest3356::ConversationApi.new
user_id = "user_id_example" # String | Identifies the user. Can be either the smoochId or the userId.
opts = {
before: "before_example", # String | Timestamp of message. The API will return 100 messages before the specified timestamp (excluding any messages with the provided timestamp).
after: "after_example" # String | Timestamp of message. The API will return 100 messages after the specified timestamp (excluding any messages with the provided timestamp).
}
begin
result = api_instance.get_messages(user_id, , opts)
p result
rescue RainbowSubmarineTest3356::ApiError => e
puts "Exception when calling ConversationApi->get_messages: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
user_id | String | Identifies the user. Can be either the smoochId or the userId. | |
before | String | Timestamp of message. The API will return 100 messages before the specified timestamp (excluding any messages with the provided timestamp). | [optional] |
after | String | Timestamp of message. The API will return 100 messages after the specified timestamp (excluding any messages with the provided timestamp). | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
reset_unread_count
reset_unread_count(user_id, )
Reset the unread count of the conversation to 0. If the conversation has not yet been created for the specified app user 404 will be returned.
Example
# load the gem
require 'rainbow-submarine-test-3356'
# setup authorization
RainbowSubmarineTest3356.configure do |config|
# Configure API key authorization: appToken
config.api_key['app-token'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['app-token'] = 'Bearer'
# Configure API key authorization: jwt
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = RainbowSubmarineTest3356::ConversationApi.new
user_id = "user_id_example" # String | Identifies the user. Can be either the smoochId or the userId.
begin
api_instance.reset_unread_count(user_id, )
rescue RainbowSubmarineTest3356::ApiError => e
puts "Exception when calling ConversationApi->reset_unread_count: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
user_id | String | Identifies the user. Can be either the smoochId or the userId. |
Return type
nil (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
trigger_typing_activity
trigger_typing_activity(user_id, typing_activity_trigger)
Notify Smooch when an app maker starts or stops typing a response.
Example
# load the gem
require 'rainbow-submarine-test-3356'
# setup authorization
RainbowSubmarineTest3356.configure do |config|
# Configure API key authorization: appToken
config.api_key['app-token'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['app-token'] = 'Bearer'
# Configure API key authorization: jwt
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = RainbowSubmarineTest3356::ConversationApi.new
user_id = "user_id_example" # String | Identifies the user. Can be either the smoochId or the userId.
typing_activity_trigger = RainbowSubmarineTest3356::TypingActivityTrigger.new # TypingActivityTrigger | Supported properties for a triggerTypingActivity request.
begin
api_instance.trigger_typing_activity(user_id, typing_activity_trigger)
rescue RainbowSubmarineTest3356::ApiError => e
puts "Exception when calling ConversationApi->trigger_typing_activity: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
user_id | String | Identifies the user. Can be either the smoochId or the userId. | |
typing_activity_trigger | TypingActivityTrigger | Supported properties for a triggerTypingActivity request. |
Return type
nil (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json