Before you can make any requests to GroupDocs Cloud API you need to get Client Id and Client Secret. That will be used to invoke the GroupDocs Cloud API.
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 makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Please check article to learn how to add an SDK to your project.
Make an APIRequest from the SDK of your choice
Use the Client Id and Client Secret from the API app client you created in step one and replace it in the corresponding code. Below is an example demonstrating how to get a list of all supported file formats in GroupDocs.Merger Cloud.
Note
The GitHub repository for GroupDocs.Merger Cloud has a complete set of examples, demonstrating our API capabilities.
usingGroupDocs.Merger.Cloud.Sdk.Api;usingGroupDocs.Merger.Cloud.Sdk.Client;usingGroupDocs.Merger.Cloud.Sdk.Model;usingGroupDocs.Merger.Cloud.Sdk.Model.Requests;usingSystem;usingSystem.Collections.Generic;usingFileInfo=GroupDocs.Merger.Cloud.Sdk.Model.FileInfo;namespaceGroupDocs.Merger.Cloud.Examples.CSharp{/// <summary>/// This example demonstrates how to join multiple documents into one document./// </summary>publicclassJoinMultipleDocuments{publicstaticvoidRun(){varconfiguration=newConfiguration(Common.MyAppSid,Common.MyAppKey);varapiInstance=newDocumentApi(configuration);try{varitem1=newJoinItem{FileInfo=newFileInfo{FilePath="WordProcessing/four-pages.docx"}};varitem2=newJoinItem{FileInfo=newFileInfo{FilePath="WordProcessing/one-page.docx"}};varoptions=newJoinOptions{JoinItems=newList<JoinItem>{item1,item2},OutputPath="Output/joined.docx"};varrequest=newJoinRequest(options);varresponse=apiInstance.Join(request);Console.WriteLine("Output file path: "+response.Path);}catch(Exceptione){Console.WriteLine("Exception while calling api: "+e.Message);}}}}
packageexamples.DocumentOperations;importjava.util.Arrays;importcom.groupdocs.cloud.merger.client.*;importcom.groupdocs.cloud.merger.model.*;importcom.groupdocs.cloud.merger.model.requests.*;importcom.groupdocs.cloud.merger.api.*;importexamples.Utils;/**
* This example demonstrates how to join multiple documents into one document.
*/publicclassMerger_Java_JoinMultipleDocuments{publicstaticvoidmain(String[]args){DocumentApiapiInstance=newDocumentApi(Utils.GetConfiguration());try{FileInfofileInfo1=newFileInfo();fileInfo1.setFilePath("WordProcessing/four-pages.docx");JoinItemitem1=newJoinItem();item1.setFileInfo(fileInfo1);FileInfofileInfo2=newFileInfo();fileInfo2.setFilePath("WordProcessing/one-page.docx");JoinItemitem2=newJoinItem();item2.setFileInfo(fileInfo2);JoinOptionsoptions=newJoinOptions();options.setJoinItems(Arrays.asList(item1,item2));options.setOutputPath("output/joined.docx");JoinRequestrequest=newJoinRequest(options);DocumentResultresponse=apiInstance.join(request);System.err.println("Output file path: "+response.getPath());}catch(ApiExceptione){System.err.println("Exception while calling api:");e.printStackTrace();}}}
// For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-php-samples
$AppSid='XXXX-XXXX-XXXX-XXXX';// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$AppKey='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Merger\Configuration();$configuration->setAppSid(CommonUtils::$AppSid);$configuration->setAppKey(CommonUtils::$AppKey);$documentApi=GroupDocs\Merger\DocumentApi($configuration);$fileInfo1=newModel\FileInfo();$fileInfo1->setFilePath("WordProcessing/four-pages.docx");$item1=newModel\JoinItem();$item1->setFileInfo($fileInfo1);$fileInfo2=newModel\FileInfo();$fileInfo2->setFilePath("WordProcessing/one-page.docx");$item2=newModel\JoinItem();$item2->setFileInfo($fileInfo2);$options=newModel\JoinOptions();$options->setJoinItems([$item1,$item2]);$options->setOutputPath("Output/joined.docx");$request=newRequests\joinRequest($options);$response=$documentApi->join($request);
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samples$app_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloud$app_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.clouddocumentApi=GroupDocsMergerCloud::DocumentApi.from_keys($app_sid,$app_key)item1=GroupDocsMergerCloud::JoinItem.newitem1.file_info=GroupDocsMergerCloud::FileInfo.newitem1.file_info.file_path='WordProcessing/four-pages.docx'item2=GroupDocsMergerCloud::JoinItem.newitem2.file_info=GroupDocsMergerCloud::FileInfo.newitem2.file_info.file_path='WordProcessing/one-page.docx'options=GroupDocsMergerCloud::JoinOptions.newoptions.join_items=[item1,item2]options.output_path="Output/joined.docx"result=documentApi.join(GroupDocsMergerCloud::JoinRequest.new(options))
// For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-node-samples
global.appSid="XXXX-XXXX-XXXX-XXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.appKey="XXXXXXXXXXXXXXXX";// Get AppKey and AppSID from https://dashboard.groupdocs.cloud
global.documentApi=merger_cloud.DocumentApi.fromKeys(appSid,appKey);letitem1=newmerger_cloud.JoinItem();item1.fileInfo=newmerger_cloud.FileInfo();item1.fileInfo.filePath="WordProcessing/four-pages.docx";letitem2=newmerger_cloud.JoinItem();item2.fileInfo=newmerger_cloud.FileInfo();item2.fileInfo.filePath="WordProcessing/one-page.docx";letoptions=newmerger_cloud.JoinOptions();options.joinItems=[item1,item2];options.outputPath="Output/joined.docx";letresult=awaitdocumentApi.join(newmerger_cloud.JoinRequest(options));
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-python-samplesapp_sid="XXXX-XXXX-XXXX-XXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.cloudapp_key="XXXXXXXXXXXXXXXX"# Get AppKey and AppSID from https://dashboard.groupdocs.clouddocumentApi=groupdocs_merger_cloud.DocumentApi.from_keys(app_sid,app_key)item1=groupdocs_merger_cloud.JoinItem()item1.file_info=groupdocs_merger_cloud.FileInfo("WordProcessing/four-pages.docx")item2=groupdocs_merger_cloud.JoinItem()item2.file_info=groupdocs_merger_cloud.FileInfo("WordProcessing/one-page.docx")options=groupdocs_merger_cloud.JoinOptions()options.join_items=[item1,item2]options.output_path="Output/joined.docx"result=documentApi.join(groupdocs_merger_cloud.JoinRequest(options))
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.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.