Sunshine Conversations Client
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
- breaking Zendesk has officially deprecated the auto-generated Python SDKs for Sunshine Conversations. While existing implementations will continue to function, there will be no new feature development or automatic updates to these libraries based on OpenAPI specification changes. Future API changes may not be reflected in this SDK.
- gotcha Authentication can be done using Basic Authentication (API Key ID and Secret) or JSON Web Tokens (JWTs). Basic authentication is generally recommended for server-to-server calls unless specific JWT use cases are required.
- gotcha The default API region is US. If your Sunshine Conversations app is hosted in a different region (e.g., EU), you must explicitly configure the `host` in the `Configuration` object.
- gotcha Sunshine Conversations APIs are subject to rate limiting. Exceeding limits will result in a 429 Too Many Requests HTTP status code.
- breaking For legacy Sunshine Conversations subscriptions, Zendesk is migrating administration to Zendesk Admin Center or shutting down accounts by February 1, 2027. This could lead to loss of access and service disruption for unmigrated or unsupported accounts.
Install
-
pip install sunshine-conversations-client
Imports
- sunshine_conversations_client
import sunshine_conversations_client
- Configuration
from sunshine_conversations_client import Configuration
- ApiClient
from sunshine_conversations_client import ApiClient
- ApiException
from sunshine_conversations_client.rest import ApiException
Quickstart
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}")