public static int GetConvertedUri(string documentUri,
                                   string fromExtension,
                                   string toExtension,
                                   string documentRevisionId,
                                   bool isAsync,
                                   out string convertedDocumentUri)
 {
     var docServiceConnector = new DocumentService(
         StudioKeySettings.GetKey(),
         StudioKeySettings.GetSKey(),
         TenantStatisticsProvider.GetUsersCount())
         {
             ConvertTimeout = ConvertTimeout
         };
     try
     {
         return docServiceConnector.GetConvertedUri(
             DocumentConverterUrl,
             documentUri,
             fromExtension,
             toExtension,
             documentRevisionId,
             isAsync,
             out convertedDocumentUri);
     }
     catch (Exception e)
     {
         throw CustomizeError(e.Message);
     }
 }
        public static string GenerateValidateKey(string documentRevisionId)
        {
            var docServiceConnector = new DocumentService(
                StudioKeySettings.GetKey(),
                StudioKeySettings.GetSKey(),
                TenantStatisticsProvider.GetUsersCount());

            string userIp = null;
            try
            {
                if (HttpContext.Current != null) userIp = HttpContext.Current.Request.UserHostAddress;
            }
            catch
            {
                userIp = string.Empty;
            }

            return docServiceConnector.GenerateValidateKey(documentRevisionId, userIp);
        }
 public static string GetExternalUri(Stream fileStream, string contentType, string documentRevisionId)
 {
     var docServiceConnector = new DocumentService(
         StudioKeySettings.GetKey(),
         StudioKeySettings.GetSKey(),
         TenantStatisticsProvider.GetUsersCount())
         {
             ConvertTimeout = ConvertTimeout
         };
     try
     {
         return docServiceConnector.GetExternalUri(
             DocumentStorageUrl,
             fileStream,
             contentType,
             documentRevisionId);
     }
     catch (Exception e)
     {
         throw CustomizeError(e.Message);
     }
 }