def update_webhook():
    webhook_config = dict(enabled=True)

    try:
        webhook_client = MessageBusWebhooksClient(api_key)
        result = webhook_client.update_webhook(webhook_key, webhook_config)
    except MessageBusResponseError, error:
        raise error
def create_webhook():
    webhook_config = dict(
        uri="http://domain.com/events/messagebus/message.accept", enabled=False, event_type="message.accept")

    try:
        webhook_client = MessageBusWebhooksClient(api_key)
        results = webhook_client.create_webhook(webhook_config)
    except MessageBusResponseError, error:
        raise error
Exemplo n.º 3
0
def create_webhook():
    webhook_config = dict(
        uri="http://domain.com/events/messagebus/message.accept",
        enabled=False,
        event_type="message.accept")

    try:
        webhook_client = MessageBusWebhooksClient(api_key)
        results = webhook_client.create_webhook(webhook_config)
    except MessageBusResponseError, error:
        raise error
def get_webhooks():
    try:
        webhooks_client = MessageBusWebhooksClient(api_key)
        results = webhooks_client.get_webhooks()
    except MessageBusResponseError, error:
        print error.message
def delete_webhook():
    try:
        webhook_client = MessageBusWebhooksClient(api_key)
        results = webhook_client.delete_webhook(webhook_key)
    except MessageBusResponseError, error:
        raise error
def get_webhook():
    try:
        webhooks_client = MessageBusWebhooksClient(api_key)
        result = webhooks_client.get_webhook(webhook_key)
    except MessageBusResponseError, error:
        print error.message