Thomas Carlton
Thomas Carlton

Reputation: 5958

How to get events raised from Twilio callback webhooks?

We are using Twilio Video in an App.

We set up the webhook such that Twilio sends the events to our application.

We managed to authenticate the requests from twilio using the following code:

    public static bool IsValidRequest(HttpRequest request)        {
        var _requestValidator = new RequestValidator(AuthToken);
        var requestUrl = RequestRawUrl(request);
        var parameters = ToDictionary(request.Form);
        var signature = request.Headers["X-Twilio-Signature"];
        return _requestValidator.Validate(requestUrl, parameters, signature);
    }

But we were unable to find the event label that was raised from Twilio. As described Here we are expecting to identify the request by the event raised such as : room-created, room-ended, participant-connected, etc.

How can we get the Event that was raised from the HttpRequest sent by Twilio?

Upvotes: 0

Views: 157

Answers (1)

philnash
philnash

Reputation: 73029

Twilio developer evangelist here.

According to the request parameters that are sent to a room status callback webhook the request parameter you are looking for is the StatusCallbackEvent. For example:

public static string getEventName(HttpRequest request) {
    return request.form['StatusCallbackEvent'];
}

Upvotes: 1

Related Questions