Skip to content

Latest commit

 

History

History
119 lines (85 loc) · 4.63 KB

EventsApi.md

File metadata and controls

119 lines (85 loc) · 4.63 KB

swagger_client.EventsApi

All URIs are relative to http://localhost:8088/ari

Method HTTP request Description
events_get GET /events WebSocket connection for events.
events_user_event_name_post POST /events/user/{eventName} Generate a user event.

events_get

Message events_get(app, subscribe_all=subscribe_all)

WebSocket connection for events.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = swagger_client.EventsApi(swagger_client.ApiClient(configuration))
app = ['app_example'] # list[str] | Applications to subscribe to.
subscribe_all = true # bool | Subscribe to all Asterisk events. If provided, the applications listed will be subscribed to all events, effectively disabling the application specific subscriptions. Default is 'false'. (optional)

try:
    # WebSocket connection for events.
    api_response = api_instance.events_get(app, subscribe_all=subscribe_all)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling EventsApi->events_get: %s\n" % e)

Parameters

Name Type Description Notes
app list[str] Applications to subscribe to.
subscribe_all bool Subscribe to all Asterisk events. If provided, the applications listed will be subscribed to all events, effectively disabling the application specific subscriptions. Default is 'false'. [optional]

Return type

Message

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

events_user_event_name_post

events_user_event_name_post(event_name, application, source=source, variables=variables)

Generate a user event.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basicAuth
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = swagger_client.EventsApi(swagger_client.ApiClient(configuration))
event_name = 'event_name_example' # str | Event name
application = 'application_example' # str | The name of the application that will receive this event
source = ['source_example'] # list[str] | URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName} (optional)
variables = [swagger_client.ConfigTuple()] # list[ConfigTuple] | The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } } (optional)

try:
    # Generate a user event.
    api_instance.events_user_event_name_post(event_name, application, source=source, variables=variables)
except ApiException as e:
    print("Exception when calling EventsApi->events_user_event_name_post: %s\n" % e)

Parameters

Name Type Description Notes
event_name str Event name
application str The name of the application that will receive this event
source list[str] URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName} [optional]
variables list[ConfigTuple] The "variables" key in the body object holds custom key/value pairs to add to the user event. Ex. { "variables": { "key": "value" } } [optional]

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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