Authenticating with Event Hub

To establish a connection to the SignalR Event Hub endpoint, it is first required to obtain an EndpointID by using the Connection Management API operation. The EndpointID from the response must be presented as a Bearer token within the Authorization header of the SignalR connection request.

$(document).ready(function(){
    const oauth_token = "{TOKEN HERE}";
    
    const ZSIP_API = "https://{API Host Here}/v3/";
    const NewConnection_OperationID = "events/connections";
    
    $.ajax({
        url: ZSIP_API + NewConnection_OperationID,
        type: 'POST',
        beforeSend: function (xhr) {
            xhr.setRequestHeader('Authorization', 'Bearer ' + oauth_token);
        },
        contentType: 'application/json',
        data: JSON.stringify({
            Mode: 'read',
            Filters: [
                {
                    FilterTemplate: "dashboard"
                }
            ]
        }),
        success: function(data) {
            connectToEventHub(data.EndpointURI, data.EndpointID);
        },
        error: function() {
            console.log("API request failure");
        }
    });
});

Response success

Response Schema: application/json
EndpointURI
string

Endpoint URI for the SignalR EventHub connection.

EndpointID
string

The unique ID of the connection, this must be passed in the Authorization header as a bearer token when establishing the SignalR connection.

object
HubName
string

Friendly name of the hub.

HubTypeID
string

Globally unique identifier representing the type of hub.

HubInstanceID
string

Globally unique identifier representing the particular hub instance.

application/json
{
  • "EndpointID": "3F2504E0-4F89-11D3-9A0C-0305E82C3301",
  • "HubInfo": {
    }
}