After rendering various types of documents into HTML, Image, or Pdf, you may clean (delete) rendered pages from cloud storage using special method.
Note: This method deletes only output files, the input file remains in the storage.
Following example demonstrates on how to delete rendered document results.
API Usage
Swagger UI lets you call this REST API directly from the browser.
cURL example
# First get JSON Web Token# Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.curl -v "https://api.groupdocs.cloud/connect/token"\
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-H "Accept: application/json"# cURL example to delete rendered document filescurl -v "https://api.groupdocs.cloud/v2.0/viewer/view"\
-X DELETE \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer <jwt token>"-d "{
'FileInfo': {
'FilePath': 'SampleFiles/sample.docx'
}
}"
An empty response with status '204 No Content' is returned to confirm deletion.
SDK examples
The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samplesstringMyClientSecret="";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloudstringMyClientId="";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyClientId,MyClientSecret);varapiInstance=newViewApi(configuration);varviewOptions=newViewOptions{FileInfo=newFileInfo{FilePath="SampleFiles/sample.docx"}};// Create viewvarresponse=apiInstance.CreateView(newCreateViewRequest(viewOptions));// Delete viewvardeleteOptions=newDeleteViewOptions{FileInfo=newFileInfo{FilePath="SampleFiles/sample.docx"}};apiInstance.DeleteView(newDeleteViewRequest(deleteOptions));
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php-samples
useGroupDocs\Viewer\Model;useGroupDocs\Viewer\Model\Requests;$ClientId="";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
$ClientSecret="";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Viewer\Configuration();$configuration->setAppSid($ClientId);$configuration->setAppKey($ClientSecret);$apiInstance=newGroupDocs\Viewer\ViewApi($configuration);// Create view
$viewOptions=newModel\ViewOptions();$fileInfo=newModel\FileInfo();$fileInfo->setFilePath("SampleFiles/sample.docx");$viewOptions->setFileInfo($fileInfo);$request=newRequests\CreateViewRequest($viewOptions);$response=$apiInstance->createView($request);// Delete view
$deleteOptions=newDeleteViewOptions();$deleteOptions->setFileInfo($fileInfo);$deleteRequest=newRequests\deleteViewRequest($deleteOptions);$apiInstance->deleteView($deleteRequest);
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples
stringMyClientSecret="";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
stringMyClientId="";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyClientId,MyClientSecret);ViewApiapiInstance=newViewApi(configuration);FileInfofileInfo=newFileInfo();fileInfo.setFilePath("SampleFiles/sample.docx");ViewOptionsviewOptions=newViewOptions();viewOptions.setFileInfo(fileInfo);// Create view
ViewResultresponse=apiInstance.createView(newCreateViewRequest(viewOptions));// Delete view
DeleteViewOptionsdeleteViewOptions=newDeleteViewOptions();fileInfo.setFilePath("SampleFiles/sample.docx");DeleteViewRequestdRequest=newDeleteViewRequest(deleteViewOptions);apiInstance.deleteView(dRequest);
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby-samplesrequire'groupdocs_viewer_cloud'$client_id="XXXX-XXXX-XXXX-XXXX"# Get Client Id and Client Secret from https://dashboard.groupdocs.cloud$client_secret="XXXXXXXXXXXXXXXX"# Get Client Id and Client Secret from https://dashboard.groupdocs.cloudapiInstance=GroupDocsViewerCloud::ViewApi.from_keys($client_id,$client_secret)# Create viewviewOptions=GroupDocsViewerCloud::ViewOptions.newviewOptions.file_info=GroupDocsViewerCloud::FileInfo.newviewOptions.file_info.file_path="SampleFiles/sample.docx"request=GroupDocsViewerCloud::CreateViewRequest.new(viewOptions)response=apiInstance.create_view(request)# Delete viewdViewOptions=GroupDocsViewerCloud::DeleteViewOptions.newdViewOptions.file_info=viewOptions.file_infodRequest=GroupDocsViewerCloud::DeleteViewRequest.new(dViewOptions)apiInstance.delete_view(dRequest)
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node-samples
global.viewer#require("groupdocs-viewer-cloud");global.clientId="XXXX-XXXX-XXXX-XXXX";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
global.clientSecret="XXXXXXXXXXXXXXXX";// Get Client Id and Client Secret from https://dashboard.groupdocs.cloud
global.viewApi=viewer_cloud.ViewApi.fromKeys(clientId,clientSecret);letfileInfo=newviewer_cloud.FileInfo();fileInfo.filePath="SampleFiles/sample.docx";letviewOptions=newviewer_cloud.ViewOptions();viewOptions.fileInfo=fileInfo;// Create view
letrequest=newviewer_cloud.CreateViewRequest(viewOptions);letresponse=awaitviewApi.createView(request);// Delete view
letdvOptions=newDeleteViewOptions();dvOptions.fileInfo=fileInfo;constdelRequest=newDeleteViewRequest(dvOptions);awaitviewApi.deleteView(delRequest);
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python-samplesimportgroupdocs_viewer_cloudclient_id="XXXX-XXXX-XXXX-XXXX"# Get Client Id and Client Secret from https://dashboard.groupdocs.cloudclient_secret="XXXXXXXXXXXXXXXX"# Get Client Id and Client Secret from https://dashboard.groupdocs.cloudapiInstance=groupdocs_viewer_cloud.ViewApi.from_keys(client_id,client_secret)# Create viewview_options=groupdocs_viewer_cloud.ViewOptions()view_options.file_info=groupdocs_viewer_cloud.FileInfo()view_options.file_info.file_path="SampleFiles/sample.docx"request=groupdocs_viewer_cloud.CreateViewRequest(view_options)response=apiInstance.create_view(request)# Delete viewd_view_options=groupdocs_viewer_cloud.DeleteViewOptions()d_view_options.file_info=view_options.file_infod_request=groupdocs_viewer_cloud.DeleteViewRequest(d_view_options)apiInstance.delete_view(d_request)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.