# Event Handlers - Interface Definition

EventHandlers RESTful interface definition

Get all eventhandlers
URL | http://<server>/dialogicwebservice/mediacontrol/eventhandlers?appid=<appid>
Method | GET
Returns | 200 OK & XML (dialogic/eventhandler+xml)
Create a new eventhandler
URL | http://<server>/dialogicwebservice/mediacontrol/eventhandlers?appid=<appid>
Method | POST
Request Body | XML (dialogic/eventhandler+xml)
Returns | 201 Created & Location + XML (dialogic/eventhandler+xml)
415 Unsupported Media Type
Get a specific eventhandler
URL | http://<server>/dialogicwebservice/mediacontrol/eventhandlers/<identifier>?appid=<appid>
Method | GET Note: The client has to keep the connection open in order to receive the events)
Returns | 200 OK & Transfer-Encoding: chunked/xml (dialogic/event+xml)
404 Not Found
Delete a specific eventhandlers
URL | http://<server>/dialogicwebservice/mediacontrol/eventhandlers/<identifier>?appid=<appid>
Method | DELETE
Returns | 204 No Content
404 Not Found
Update a specific eventhandler
URL | http://<server>/dialogicwebservice/mediacontrol/eventhandlers/<identifier>?appid=<appid>
Method | PUT
Request Body | XML (dialogic/eventhandler+xml)
Returns | 200 OK & Location
404 Not Found
415 Unsupported Media Type

dialogic/eventhandlers, dialogic/event XML definitions

<eventhandlers size="<size>">
<eventhandler identifier=" <identifier> "appid=" <appid> "
href="http://server/dialogicwebservice/mediacontrol/eventhandlers/<identifier>" >
<eventsubscribe resourceid="<resourceid>" resourcetype="<resourcetype>" type="<eventtype>"/>
</eventhandler>
…
</eventhandlers>
size= “<size of xml >”
<event type="<eventtype>" data="<data>" resourceid="<resourceid> " resourcetype="<resourcetype>">
</event>

If size= 0, it means that the eventhandler is being deleted. The client should close the http connection.

For more information refer to Event Handlers.