public CreateWebHookResponse CreateWebHook(string roomName, string url, string pattern, RoomEvent eventType, string name)
 {
     using (JsonSerializerConfigScope())
     {
         var request = new CreateWebHookRequest
         {
             Event = eventType,
             Pattern = pattern,
             Url = url,
             Name = name
         };
         return CreateWebHook(roomName, request);
     }
 }
        public CreateWebHookResponse CreateWebHook(string roomName, CreateWebHookRequest request)
        {
            using (JsonSerializerConfigScope())
            {
                try
                {
                    return HipchatEndpoints.CreateWebhookEndpointFormat.Fmt(roomName)
                        .AddHipchatAuthentication(_authToken)
                        .PostJsonToUrl(request)
                        .FromJson<CreateWebHookResponse>();
                }
                catch (Exception exception)
                {
                    if (exception is WebException)
                        throw ExceptionHelpers.WebExceptionHelper(exception as WebException, "admin_room");

                    throw ExceptionHelpers.GeneralExceptionHelper(exception, "CreateWebHook");
                }
            }
        }
 public CreateWebHookResponse CreateWebHook(int roomId, string url, string pattern, RoomEvent eventType, string name)
 {
     using (JsonSerializerConfigScope())
     {
         var request = new CreateWebHookRequest
         {
             Event = eventType,
             Pattern = pattern,
             Url = url,
             Name = name
         };
         return CreateWebHook(roomId.ToString(CultureInfo.InvariantCulture), request);
     }
 }