diff --git a/twilio/twilio-tests.ts b/twilio/twilio-tests.ts index 30e9892078..d7f2c60993 100644 --- a/twilio/twilio-tests.ts +++ b/twilio/twilio-tests.ts @@ -228,5 +228,5 @@ twilio.validateRequest(token, str, 'http://example.herokuapp.com', { query: 'val twilio.validateExpressRequest({}, 'YOUR_TWILIO_AUTH_TOKEN'); twilio.validateExpressRequest({}, 'YOUR_TWILIO_AUTH_TOKEN', {}); twilio.webhook({ validate: false }); - +twilio.webhook("MYAUTHTOKEN", { validate: false }); diff --git a/twilio/twilio.d.ts b/twilio/twilio.d.ts index d6af461760..8bd6911113 100644 --- a/twilio/twilio.d.ts +++ b/twilio/twilio.d.ts @@ -446,7 +446,8 @@ declare namespace twilio { // For interop with node middleware chains export interface MiddlewareFunction { (request: Http.ClientRequest, response: Http.ClientResponse, next: MiddlewareFunction): void; } - export function webhook(options?: string | webhookOptions): MiddlewareFunction; + export function webhook(authToken: string, options?: webhookOptions): MiddlewareFunction; + export function webhook(options?: webhookOptions): MiddlewareFunction; export function validateRequest(authToken: string, twilioHeader: string, url: string, params?: any): boolean; export function validateExpressRequest(request: express.Request, authToken: string, options?: WebhookExpressOptions): boolean;