Skip to content

Latest commit

 

History

History
491 lines (391 loc) · 19.6 KB

SwitchboardActionsApi.md

File metadata and controls

491 lines (391 loc) · 19.6 KB

sunshine_conversations_client.SwitchboardActionsApi

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

Basic Authentication (basicAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.
    accept_control_body = sunshine_conversations_client.AcceptControlBody() # AcceptControlBody | 

    try:
        # Accept Control
        api_response = api_instance.accept_control(app_id, conversation_id, accept_control_body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->accept_control: %s\n" % e)

Bearer (JWT) Authentication (bearerAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.
    accept_control_body = sunshine_conversations_client.AcceptControlBody() # AcceptControlBody | 

    try:
        # Accept Control
        api_response = api_instance.accept_control(app_id, conversation_id, accept_control_body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->accept_control: %s\n" % e)

Parameters

Name Type Description Notes
app_id str Identifies the app.
conversation_id str Identifies the conversation.
accept_control_body AcceptControlBody

Return type

object

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ok -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

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

Basic Authentication (basicAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.
    offer_control_body = sunshine_conversations_client.OfferControlBody() # OfferControlBody | 

    try:
        # Offer Control
        api_response = api_instance.offer_control(app_id, conversation_id, offer_control_body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->offer_control: %s\n" % e)

Bearer (JWT) Authentication (bearerAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.
    offer_control_body = sunshine_conversations_client.OfferControlBody() # OfferControlBody | 

    try:
        # Offer Control
        api_response = api_instance.offer_control(app_id, conversation_id, offer_control_body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->offer_control: %s\n" % e)

Parameters

Name Type Description Notes
app_id str Identifies the app.
conversation_id str Identifies the conversation.
offer_control_body OfferControlBody

Return type

object

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

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

Basic Authentication (basicAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.
    pass_control_body = sunshine_conversations_client.PassControlBody() # PassControlBody | 

    try:
        # Pass Control
        api_response = api_instance.pass_control(app_id, conversation_id, pass_control_body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->pass_control: %s\n" % e)

Bearer (JWT) Authentication (bearerAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.
    pass_control_body = sunshine_conversations_client.PassControlBody() # PassControlBody | 

    try:
        # Pass Control
        api_response = api_instance.pass_control(app_id, conversation_id, pass_control_body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->pass_control: %s\n" % e)

Parameters

Name Type Description Notes
app_id str Identifies the app.
conversation_id str Identifies the conversation.
pass_control_body PassControlBody

Return type

object

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

release_control

object release_control(app_id, conversation_id)

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

Basic Authentication (basicAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.

    try:
        # Release Control
        api_response = api_instance.release_control(app_id, conversation_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->release_control: %s\n" % e)

Bearer (JWT) Authentication (bearerAuth):

from __future__ import print_function
import time
import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.smooch.io
# See configuration.py for a list of all supported configuration parameters.
configuration = sunshine_conversations_client.Configuration(
    host = "https://api.smooch.io"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure HTTP basic authorization: basicAuth
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# Configure Bearer authorization (JWT): bearerAuth
# Uncomment this if you want to use JWTs
#configuration.access_token = 'YOUR_BEARER_TOKEN'

# Enter a context with an instance of the API client
with sunshine_conversations_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sunshine_conversations_client.SwitchboardActionsApi(api_client)
    app_id = '5d8cff3cd55b040010928b5b' # str | Identifies the app.
    conversation_id = '029c31f25a21b47effd7be90' # str | Identifies the conversation.

    try:
        # Release Control
        api_response = api_instance.release_control(app_id, conversation_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling SwitchboardActionsApi->release_control: %s\n" % e)

Parameters

Name Type Description Notes
app_id str Identifies the app.
conversation_id str Identifies the conversation.

Return type

object

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ok -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]