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 convert documentcurl -v "https://api.groupdocs.cloud/v2.0/conversion/conversion"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer <jwt token>"-d "{
'FilePath': 'WordProcessing/four-pages.docx',
'Format': 'html',
'ConvertOptions': {
'FromPage': 1,
'PagesCount': 1,
'FixedLayout': true,
'FixedLayoutShowBorders': true
},
'OutputPath': 'Output'
}"
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Conversion Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.
//For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet-samplesstringMyClientSecret="";//Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudstringMyClientId="";//Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyClientId,MyClientSecret);//Create necessary API instancesvarapiInstance=newConvertApi(configuration);//Prepare convert settingsvarsettings=newConvertSettings{FilePath="WordProcessing/four-pages.docx",Format="html",ConvertOptions=newWebConvertOptions{FromPage=1,PagesCount=1,FixedLayout=true,FixedLayoutShowBorders=true},OutputPath="converted"};//Convert to specified formatvarresponse=apiInstance.ConvertDocument(newConvertDocumentRequest(settings));
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-java-samples
StringMyClientSecret="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
StringMyClientId="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyClientId,MyClientSecret);// Create API instance
ConvertApiapiInstance=newConvertApi(configuration);// Prepare convert settings
ConvertSettingssettings=newConvertSettings();settings.setFilePath("WordProcessing/four-pages.docx");settings.setFormat("html");WebConvertOptionsconvertOptions=newWebConvertOptions();convertOptions.setFromPage(1);convertOptions.setPagesCount(1);convertOptions.setFixedLayout(true);convertOptions.setFixedLayoutShowBorders(true);settings.setConvertOptions(convertOptions);settings.setOutputPath("converted");List<StoredConvertedResult>result=apiInstance.convertDocument(newConvertDocumentRequest(settings));
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-php-samples
useGroupDocs\Conversion\Model;useGroupDocs\Conversion\Model\Requests;$ClientId="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud$ClientSecret="";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud$configuration=newGroupDocs\Conversion\Configuration();$configuration->setAppSid($ClientId);$configuration->setAppKey($ClientSecret);$apiInstance=newGroupDocs\Conversion\ConvertApi($configuration);// Prepare convert settings
$settings=newModel\ConvertSettings();$settings->setFilePath("WordProcessing/four-pages.docx");$settings->setFormat("html");$convertOptions=newModel\WebConvertOptions();$convertOptions->setFromPage(1);$convertOptions->setPagesCount(1);$convertOptions->setFixedLayout(true);$convertOptions->setFixedLayoutShowBorders(true);$settings->setConvertOptions($convertOptions);$settings->setOutputPath("converted");// Convert
$result=$apiInstance->convertDocument(newRequests\ConvertDocumentRequest($settings));
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-node-samples
global.conversion_cloud=require("groupdocs-conversion-cloud");global.clientId="XXXX-XXXX-XXXX-XXXX";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
global.clientSecret="XXXXXXXXXXXXXXXX";*GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud
global.convertApi=conversion_cloud.ConvertApi.fromKeys(clientId,clientSecret);letsettings=newconversion_cloud.ConvertSettings();settings.filePath="WordProcessing/four-pages.docx";settings.format="html";letconvertOptions=newconversion_cloud.WebConvertOptions();convertOptions.fromPage=1;convertOptions.pagesCount=1;convertOptions.fixedLayout=true;convertOptions.fixedLayoutShowBorders=true;settings.convertOptions=convertOptionssettings.outputPath="converted";letresult=awaitconvertApi.convertDocument(newconversion_cloud.ConvertDocumentRequest(settings));
# For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-python-samplesimportgroupdocs_conversion_cloudclient_id="XXXX-XXXX-XXXX-XXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloudclient_secret="XXXXXXXXXXXXXXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=groupdocs_conversion_cloud.ConvertApi.from_keys(Common.client_id,Common.client_secret)# Prepare convert settingssettings=groupdocs_conversion_cloud.ConvertSettings()settings.file_path="WordProcessing/four-pages.docx"settings.format="html"convertOptions=groupdocs_conversion_cloud.WebConvertOptions()convertOptions.from_page=1convertOptions.pages_count=1convertOptions.fixed_layout=TrueconvertOptions.fixed_layout_show_borders=Truesettings.convert_options=convertOptionssettings.output_path="converted"# Convertresult=apiInstance.convert_document(groupdocs_conversion_cloud.ConvertDocumentRequest(settings))
# For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-ruby-samplesrequire'groupdocs_conversion_cloud'$client_id="XXXX-XXXX-XXXX-XXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud$client_secret="XXXXXXXXXXXXXXXX"=GetClientIdandClientSecretfromhttps://dashboard.groupdocs.cloud# Create necessary API instancesapiInstance=GroupDocsConversionCloud::ConvertApi.from_keys($client_id,$client_secret)# Prepare convert settingssettings=GroupDocsConversionCloud::ConvertSettings.newsettings.file_path="WordProcessing/four-pages.docx"settings.format="html"convertOptions=GroupDocsConversionCloud::WebConvertOptions.newconvertOptions.from_page=1convertOptions.pages_count=1convertOptions.fixed_layout=trueconvertOptions.fixed_layout_show_borders=truesettings.convert_options=convertOptionssettings.output_path="converted"# Convertresult=apiInstance.convert_document(GroupDocsConversionCloud::ConvertDocumentRequest.new(settings))
// For complete examples and data files, please go to https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples
packageconvertimport("fmt""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go-samples/config""github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-go/models")funcConvertToHtml(){settings:=models.ConvertSettings{Format:"html",FilePath:"WordProcessing/four-pages.docx",OutputPath:"converted",ConvertOptions:&models.WebConvertOptions{FromPage:1,PagesCount:1,FixedLayout:true,FixedLayoutShowBorders:true,},}result,_,err:=config.Client.ConvertApi.ConvertDocument(config.Ctx,settings)iferr!=nil{fmt.Printf("ConvertToHtml error: %v\n",err)return}fmt.Printf("Document converted successfully: %v\n",result[0].Url)}
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.