Sunshine Conversations Client

17.0.1 · maintenance · verified Mon Apr 13

The `sunshine-conversations-client` is an auto-generated Python SDK for interacting with the Sunshine Conversations API (now part of Zendesk). It provides a programmatic interface to manage conversations, users, messages, and integrations across various messaging channels. While the library is functional and existing implementations will continue to work, Zendesk has deprecated the auto-generation and maintenance of these SDKs, encouraging users to refer directly to the OpenAPI specification or generate their own clients. The current version is 17.0.1.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to configure the client for basic authentication using environment variables for API Key ID and Secret, and then how to make a sample API call (listing app keys). Replace 'YOUR_API_KEY_ID', 'YOUR_API_SECRET', and 'YOUR_APP_ID' or set them as environment variables. Ensure you have an App ID from your Sunshine Conversations (Zendesk Admin Center) account.

import sunshine_conversations_client
from sunshine_conversations_client.rest import ApiException
import os

# Configure HTTP basic authorization (recommended)
configuration = sunshine_conversations_client.Configuration()
configuration.username = os.environ.get('SC_API_KEY_ID', 'YOUR_API_KEY_ID')
configuration.password = os.environ.get('SC_API_SECRET', 'YOUR_API_SECRET')

# Optionally, set a non-US region host (e.g., for EU)
# configuration.host = "https://api.eu-1.smooch.io"

# Create an instance of the API client
api_client = sunshine_conversations_client.ApiClient(configuration)

# Create an instance of a specific API, e.g., AppKeysApi
api_instance = sunshine_conversations_client.AppKeysApi(api_client)

app_id = os.environ.get('SC_APP_ID', 'YOUR_APP_ID')  # Replace with your App ID

try:
    # Example: List App Keys for your app
    api_response = api_instance.list_app_keys(app_id)
    print("Successfully listed App Keys:")
    for key in api_response.app_keys:
        print(f"  Key ID: {key.id}, Secret: {key.secret}")
except ApiException as e:
    print(f"Exception when calling AppKeysApi->list_app_keys: {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

view raw JSON →