private void DeleteDocumentInIDBDocs(DeleteDocumentRequest request)
 {
     try
     {
         var response = _docManagementService.Delete(request);
         if (!response.IsValid)
         {
             throw new Exception("The file was not deleted");
         }
     }
     catch (Exception e)
     {
         Logger.GetLogger().WriteError(
             "PMRPublicController", "Error when deleting report in IDBDocs: ", e);
         throw;
     }
 }
        public IHttpActionResult Delete([FromUri] Guid document_id)
        {
            if (IsTokenValid() && authenticationService.IsAllowedToDeleteDocument(GetTokenUserEmail(), document_id))
            {
                try
                {
                    documentManagementService.Delete(document_id);

                    return(Ok(document_id));
                }
                catch (MissingDocumentException e)
                {
                    return(BadRequest(e.Message));
                }
                catch (Exceptions e)
                {
                    return(BadRequest(e.Message));
                }
            }

            return(Unauthorized());
        }