SunshineConversationsClient::SwitchboardActionsApi
August 27, 2025 ยท View on GitHub
All URIs are relative to https://api.smooch.io
| Method | HTTP request | Description |
|---|---|---|
| accept_control | POST /v2/apps/{appId}/conversations/{conversationId}/acceptControl | Accept Control |
| offer_control | POST /v2/apps/{appId}/conversations/{conversationId}/offerControl | Offer Control |
| pass_control | POST /v2/apps/{appId}/conversations/{conversationId}/passControl | Pass Control |
| release_control | POST /v2/apps/{appId}/conversations/{conversationId}/releaseControl | Release Control |
accept_control
Object accept_control(app_id, conversation_id, accept_control_body)
Accept Control
The acceptControl action transfers the control of the conversation to the pending switchboard integration. When using integration auth scope, a 403 is returned if the pending switchboard integration is not the authenticated integration.
Example
# 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::SwitchboardActionsApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
conversation_id = 029c31f25a21b47effd7be90 # String | Identifies the conversation.
accept_control_body = # AcceptControlBody |
# Be sure to add the required body parameters
begin
#Accept Control
result = api_instance.accept_control(app_id, conversation_id, accept_control_body)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling SwitchboardActionsApi->accept_control: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_id | String | Identifies the conversation. | |
| accept_control_body | AcceptControlBody |
Return type
Object
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
offer_control
Object offer_control(app_id, conversation_id, offer_control_body)
Offer Control
The offerControl action will invite a switchboard integration to accept control of the conversation (changing its status to pending), and trigger a webhook signal to that integration indicating that they have been offered control of the conversation. Invalidates previous offerControl actions.
Example
# 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::SwitchboardActionsApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
conversation_id = 029c31f25a21b47effd7be90 # String | Identifies the conversation.
offer_control_body = # OfferControlBody |
# Be sure to add the required body parameters
begin
#Offer Control
result = api_instance.offer_control(app_id, conversation_id, offer_control_body)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling SwitchboardActionsApi->offer_control: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_id | String | Identifies the conversation. | |
| offer_control_body | OfferControlBody |
Return type
Object
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
pass_control
Object pass_control(app_id, conversation_id, pass_control_body)
Pass Control
The passControl action marks the named switchboard integration as active and transitions all the other switchboard integrations to standby status. The passControl action is idempotent if either the target switchboardIntegration is specified explicitly by its id or name, or the next keyword is used for the switchboardIntegration field, and the invoking integration can be identified by its OAuth token or Custom Integration API Key credentials. Duplicate passControl actions using the next keyword and their metadata are disregarded. For more information, see Switchboard passControl.
Example
# 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::SwitchboardActionsApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
conversation_id = 029c31f25a21b47effd7be90 # String | Identifies the conversation.
pass_control_body = # PassControlBody |
# Be sure to add the required body parameters
begin
#Pass Control
result = api_instance.pass_control(app_id, conversation_id, pass_control_body)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling SwitchboardActionsApi->pass_control: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_id | String | Identifies the conversation. | |
| pass_control_body | PassControlBody |
Return type
Object
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
release_control
Object release_control(app_id, conversation_id, opts)
Release Control
The releaseControl action releases the control of the conversation by nullifying its switchboard state. When using integration auth scope, a 403 is returned if the active switchboard integration is not the authenticated integration.
Example
# 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::SwitchboardActionsApi.new
app_id = 5d8cff3cd55b040010928b5b # String | Identifies the app.
conversation_id = 029c31f25a21b47effd7be90 # String | Identifies the conversation.
# Be sure to add the required body parameters
opts = {
release_control_body: # ReleaseControlBody |
}
begin
#Release Control
result = api_instance.release_control(app_id, conversation_id, opts)
p result
rescue SunshineConversationsClient::ApiError => e
puts "Exception when calling SwitchboardActionsApi->release_control: #{e}"
end
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| app_id | String | Identifies the app. | |
| conversation_id | String | Identifies the conversation. | |
| release_control_body | ReleaseControlBody | [optional] |
Return type
Object
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json