Aspose.HTML Cloud 20.11 Release Notes

Aspose.HTML Cloud for .NET

We are pleased to announce that the Aspose.HTML Cloud API version has been upgraded to v4.0, due to significant extension of the cloud API. The following features has been exposed as API version 4.0 (for details, see v.20.11 Api Changes ):

  • a group of conversion API methods has been implemented to complete the following goals:
    • a big variety of v3.0 conversion methods has been replaced with unified interface for all supported conversion cases;
    • conversion operation may be long-time, so it has been implemented as asynchronous, following CQRS pattern. So the conversion API is reduced to 3 entry points: 1) command that starts a long-time processing; 2) query that checks the previously started operation state; 3) query that cancels the running operation. -alternative storage access API has been implemented; it has some advantages compared with existing Storage API v3.0

Old style API of version 3.0 is still available.

API changes

Common path format conventions

The source and result document paths must match the following conventions:

ProtocolTemplateDescription
http, https{protocol}://hostname/[path]/[pagename.html]Only source documents. These paths are valid Web URLs that can represent both static HTML pages or dynamic HTML content pages generated by CGI, ASP, JSP, PHP and so on.
storagestorage://storageName/[Folder1]/[Folder2]/…/FileName.ext - storage file
storage://storageName/[Folder1]/[Folder2]/…/[FolderN] - storage folder
Source and result documents. This type of paths represents files or folders in the Aspose cloud storage associated with the application user. The path specifies the storageName (can be empty for user application’s default storage) and file/folder full path in the storage. The document lifetime is controlled by the storage associated user.
appapp:///[Folder1]/[Folder2]/…/FileName.extSource and result documents. In a common case, these are results of an operation where outputPath wasn’t explicitly specified. This type of paths represents files in the internal temporary storage; they are available for download during a limited time period. Generally are used internally by client SDKs, but also can be used by other applications that use Aspose.HTML Cloud API v4.0 directly
(omitted)/[Folder1]/[Folder2]/…/FileName.extBy default, Conversion API treats these paths as path in the default cloud storage. Storage API uses only such paths, additional storage parameter may be specified or not.

New feature

Conversion API

  • POST: start a long-time conversion operation. If succeeded, returns a response with operation ID.
/convert?inputPath={inputPath}&outputFormat={outputFormat}&outputPath={outputPath}

Parameters:

NameDescriptionPassed inRequired
inputPathLocation of source document to be converted.Query+
outputFormatFormat the source document will be converted to. Supported values: PDF, XPS, MHTML, MD, JPG, PNG, BMP, GIF, TIFFQuery+
outputPathLocation where the conversion result will be saved. By default, the result document will be saved to internal temporary storage (see app:// paths above)Query-
widthResult document page or image width in in points (1/96 inch)Body-
heightResult document page or image height in in points (1/96 inch)Body-
leftmarginResult document page or image left margin in points (1/96 inch)Body-
rightmarginResult document page or image right margin in points (1/96 inch)Body-
topmarginResult document page or image top margin in points (1/96 inch)Body-
bottommarginResult document page or image bottom margin in points (1/96 inch)Body-
resolutionResolution of resulting image. Default is 96 dpi. Applicable only to image formats.Body-
jpegqualityJPEG image quality, valid values from 0 to 100. Default is 96. Applicable only to JPEG image format.Body-
usegitUse GIT flavor of Markdown (false by default). Applicable only to MD format.Body-
  • GET: check the previously started operation state by its ID. Returns the state object; if state code is “completed”, the response object will contain a list of converted file paths. The conversion results are stored in the cloud storage and will be available for download using cloud paths from the response.
/convert/{id}

Parameters:

NameDescriptionPassed inRequired
idID of conversion task previously started.Path+
  • DELETE: cancel the previously started operation by its ID
/convert/{id}

Parameters:

NameDescriptionPassed inRequired
idID of conversion task previously started.Path+

Storage API

The main difference of Storage API v4.0 from v3.0 is that storage paths are specified in the query parameters, not in the API command URL path; it allows to avoid issues that may occur when file/folder paths contain spaces or national characters.

Storage
  • GET: check if a specified storage exists and is associated with application user:
/storage/exist/storage?storageName={storageName}

Parameters:

NameDescriptionPassed inRequired
storageNameStorage name.Query+
  • GET: check if specified file or folder exists in the specified or default storage.
/storage/exist?path={path}&storageName={storageName}&versionId={versionId}

Parameters:

NameDescriptionPassed inRequired
pathObject (file or folder) path in the storage.Query+
storageNameStorage name, or default storage if not specified.Query-
versionIdVersion ID of the specified file, or last version by default. Ignored for foldersQuery-
  • GET: return a total and used disc space in bytes of the specified storage.
/storage/disc?storageName={storageName}

Parameters:

NameDescriptionPassed inRequired
storageNameStorage nameQuery+
  • GET: return a list of versions of specified file, if versioning is supported by the specified or default storage.
/storage/versions?path={path}&storageName={storageName}

Parameters:

NameDescriptionPassed inRequired
pathFile path in the storage.Query+
storageNameStorage name, or default storage if not specified.Query-
Folder
  • GET: return a list of files and folders in the specified folder (or in the root folder by default) of the storage.
/folder?path={path}&storageName={storageName}

Parameters:

NameDescriptionPassed inRequired
pathFolder path in the storage.Query+
storageNameStorage name, or default storage if not specified.Query-
  • POST: create a folder
/folder?path={path}&storageName={storageName}

Parameters:

NameDescriptionPassed inRequired
pathFolder path to be created.Query+
storageNameStorage name, or default storage if not specified.Query-
  • PUT: copy the specified folder with files and subfolders to the new path.
/folder/copy?srcpath={srcPath}&destpath={destPath}&srcstoragename={srcStorageName}&srcstoragename={destStorageName}

Parameters:

NameDescriptionPassed inRequired
srcPathSource folder path to be copied.Query+
destPathDestination folder pathQuery+
srcStorageNameSource folder storage name, or default storage if not specified.Query-
destStorageNameDestination folder storage name, or default storage if not specified.Query-
  • PUT: move the specified folder with files and subfolders to the new path.
/folder/move?srcpath={srcPath}&destpath={destPath}&srcstoragename={srcStorageName}&srcstoragename={destStorageName}

Parameters:

NameDescriptionPassed inRequired
srcPathSource folder path to be moved.Query+
destPathDestination folder pathQuery+
srcStorageNameSource folder storage name, or default storage if not specified.Query-
destStorageNameDestination folder storage name, or default storage if not specified.Query-
  • DELETE: delete the specified folder.
/folder?path={path}&storageName={storageName}

Parameters:

NameDescriptionPassed inRequired
pathFolder path to be deleted.Query+
storageNameStorage name, or default storage if not specified.Query-
File
  • GET: download a file. Response object contains the raw data of the file.
/file?path={path}&storageName={storageName}&versionId={versionId}

Parameters:

NameDescriptionPassed inRequired
pathFile path to be downloaded.Query+
storageNameStorage name, or default storage if not specified.Query-
versionIdFile version ID, or the last version by defaultQuery-
  • POST: upload a file. If file exists, new version of the file will be added on the same location.
/file?path={path}&storageName={storageName}

Parameters:

NameDescriptionPassed inRequired
pathFile uploading path.Query+
storageNameStorage name, or default storage if not specified.Query-
-File content to upload; it must be passed in the HTTP request body.
Requires an HTTP header Content-Type=application/multipart-data
Body+
  • PUT: copy the specified file to another path (if versionId is specified, this version will be copied)
/file/copy?srcpath={srcPath}&destpath={destPath}&srcstoragename={srcStorageName}&srcstoragename={destStorageName}&versionId={versionId}

Parameters:

NameDescriptionPassed inRequired
srcPathSource file path to be copied.Query+
destPathDestination file/folder pathQuery+
srcStorageNameSource file storage name, or default storage if not specified.Query-
destStorageNameDestination file storage name, or default storage if not specified.Query-
versionIdFile version ID, or the last version by defaultQuery-
  • PUT: move the specified file to another path (if versionId is specified, this version will be copied to new location and deleted)
/file/move?srcpath={srcPath}&destpath={destPath}&srcstoragename={srcStorageName}&srcstoragename={destStorageName}&versionId={versionId}

Parameters:

NameDescriptionPassed inRequired
srcPathSource file path to be moved.Query+
destPathDestination file/folder pathQuery+
srcStorageNameSource file storage name, or default storage if not specified.Query-
destStorageNameDestination file storage name, or default storage if not specified.Query-
versionIdFile version ID, or the last version by defaultQuery-
  • DELETE: delete a file. Only last version will be deleted by default; if versionId is specified, only this version will be deleted.
/file?path={path}&storageName={storageName}&versionId={versionId}

Parameters:

NameDescriptionPassed inRequired
pathFile path to be deleted.Query+
storageNameStorage name, or default storage if not specified.Query-
versionIdFile version ID, or the last version by defaultQuery-