<filename>examples/configuration_api_example.py
''' Configuration API client example usage. '''

from livechat.configuration.client import ConfigurationApi

# Get list of existing groups.
configuration_api = ConfigurationApi.get_client(token='<your access token>')
groups = configuration_api.list_groups()
print(groups.json())

# Register and unregister webhook.
webhook = configuration_api.register_webhook(
    action='incoming_chat',
    secret_key='<your secret_key>',
    url='<your url>',
    description='Your incoming chat webhook description.',
    owner_client_id='<your owner_client_id>',
    type='license')
configuration_api.enable_license_webhooks(
    owner_client_id='<your owner_client_id>')
configuration_api.disable_license_webhooks(
    owner_client_id='<your owner_client_id>')
webhook_id = webhook.json().get('id')
configuration_api.unregister_webhook(id=webhook_id,
                                     owner_client_id='<your owner_client_id>')

<filename>examples/configuration_api_example.py
''' Configuration API client example usage. '''

from livechat.configuration.client import ConfigurationApi

# Get list of existing groups.
configuration_api = ConfigurationApi.get_client(token='<your access token>')
groups = configuration_api.list_groups()
print(groups.json())

# Register and unregister webhook.
webhook = configuration_api.register_webhook(
    action='incoming_chat',
    secret_key='<your secret_key>',
    url='<your url>',
    description='Your incoming chat webhook description.',
    owner_client_id='<your owner_client_id>',
    type='license')
configuration_api.enable_license_webhooks(
    owner_client_id='<your owner_client_id>')
configuration_api.disable_license_webhooks(
    owner_client_id='<your owner_client_id>')
webhook_id = webhook.json().get('id')
configuration_api.unregister_webhook(id=webhook_id,
                                     owner_client_id='<your owner_client_id>')

Configuration API client example usage. # Get list of existing groups. # Register and unregister webhook.