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 join several documents into one
curl -v "https://api.groupdocs.cloud/v1.0/merger/join"\
-X POST \
-H "Content-Type: application/json"\
-H "Accept: application/json"\
-H "Authorization: Bearer
<jwt token>"-d "{
'JoinItems':
[
{
'FileInfo':
{
'FilePath': 'Img/task1.jpg'
}
},
{
'FileInfo':
{
'FilePath': 'Img/task2.jpg'
},
'ImageJoinMode': 'Vertical'
}
],
'OutputPath': 'Output/joined.jpg'
}"
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. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check the article to learn how to add an SDK to your project.
// For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-dotnet-samplesstringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudstringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyClientId,MyClientSecret);varapiInstance=newDocumentApi(configuration);try{varitem1=newJoinItem{FileInfo=newFileInfo{FilePath="Img/task1.jpg"}};varitem2=newJoinItem{FileInfo=newFileInfo{FilePath="Img/task2.jpg"},ImageJoinMode=JoinItem.ImageJoinModeEnum.Vertical};varoptions=newJoinOptions{JoinItems=newList<JoinItem>{item1,item2},OutputPath="Output/joined.jpg",};varrequest=newJoinRequest(options);varresponse=apiInstance.Join(request);Console.WriteLine("Output file path: "+response.Path);}catch(Exceptione){Console.WriteLine("Exception while calling api: "+e.Message);}
// For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-java-samples
StringMyClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
StringMyClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
Configurationconfiguration=newConfiguration(MyClientId,MyClientSecret);DocumentApiapiInstance=newDocumentApi(configuration);try{FileInfofileInfo1=newFileInfo();fileInfo1.setFilePath("Img/task1.jpg");JoinItemitem1=newJoinItem();item1.setFileInfo(fileInfo1);FileInfofileInfo2=newFileInfo();fileInfo2.setFilePath("Img/task2.jpg");JoinItemitem2=newJoinItem();item2.setFileInfo(fileInfo2);item2.setImageJoinMode(ImageJoinModeEnum.VERTICAL);JoinOptionsoptions=newJoinOptions();options.setJoinItems(Arrays.asList(item1,item2));options.setOutputPath("Output/joined.jpg");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
useGroupDocs\Merger\Model;useGroupDocs\Merger\Model\Requests;$ClientId="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$ClientSecret="";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
$configuration=newGroupDocs\Merger\Configuration();$configuration->setAppSid($ClientId);$configuration->setAppKey($ClientSecret);$documentApi=newGroupDocs\Merger\DocumentApi($configuration);$fileInfo1=newModel\FileInfo();$fileInfo1->setFilePath("Img/task1.jpg");$item1=newModel\JoinItem();$item1->setFileInfo($fileInfo1);$fileInfo2=newModel\FileInfo();$fileInfo2->setFilePath("Img/task2.jpg");$item2=newModel\JoinItem();$item2->setFileInfo($fileInfo2);$шеуь2->setImageJoinMode(Model\JoinItem::IMAGE_JOIN_MODE_VERTICAL);$options=newModel\JoinOptions();$options->setJoinItems([$item1,$item2]);$options->setOutputPath("Output/joined.jpg");$request=newRequests\joinRequest($options);$response=$documentApi->join($request);echo"Output file path: ".$response->getPath();echo"\n";
// For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-node-samples
global.merger_cloud=require("groupdocs-merger-cloud");global.clientId="XXXX-XXXX-XXXX-XXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.clientSecret="XXXXXXXXXXXXXXXX";// Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
global.documentApi=merger_cloud.DocumentApi.fromKeys(clientId,clientSecret);letitem1=newmerger_cloud.JoinItem();item1.fileInfo=newmerger_cloud.FileInfo();item1.fileInfo.filePath="Img/task1.jpg";letitem2=newmerger_cloud.JoinItem();item2.fileInfo=newmerger_cloud.FileInfo();item2.fileInfo.filePath="Img/task2.jpg";item2.imageJoinMode=merger_cloud.JoinItem.ImageJoinModeEnum.Vertical;letoptions=newmerger_cloud.JoinOptions();options.joinItems=[item1,item2];options.outputPath="Output/joined_continous.docx";letresult=awaitdocumentApi.join(newmerger_cloud.JoinRequest(options));console.log("Output file path: "+result.path);
# For complete examples and data files, please go to https://github.com/groupdocs-merger_cloud-cloud/groupdocs-merger_cloud-cloud-python-samplesfromgroupdocs_merger_cloudimport*importgroupdocs_merger_cloudclient_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloudclient_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.clouddocumentApi=groupdocs_merger_cloud.DocumentApi.from_keys(client_id,client_secret)item1=groupdocs_merger_cloud.JoinItem()item1.file_info=groupdocs_merger_cloud.FileInfo("Img/task1.jpg")item2=groupdocs_merger_cloud.JoinItem()item2.file_info=groupdocs_merger_cloud.FileInfo("Img/task2.jpg")item2.image_join_mode="Vertical"options=groupdocs_merger_cloud.JoinOptions()options.join_items=[item1,item2]options.output_path="Output/joined.jpg"result=documentApi.join(groupdocs_merger_cloud.JoinRequest(options))print("Output file path = "+result.path)
# For complete examples and data files, please go to https://github.com/groupdocs-merger-cloud/groupdocs-merger-cloud-ruby-samplesrequire'groupdocs_merger_cloud'$client_id="XXXX-XXXX-XXXX-XXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud$client_secret="XXXXXXXXXXXXXXXX"# Get ClientId and ClientSecret from https://dashboard.groupdocs.clouddocumentApi=GroupDocsMergerCloud::DocumentApi.from_keys($client_id,$client_secret)item1=GroupDocsMergerCloud::JoinItem.newitem1.file_info=GroupDocsMergerCloud::FileInfo.newitem1.file_info.file_path='Img/task1.jpg'item2=GroupDocsMergerCloud::JoinItem.newitem2.file_info=GroupDocsMergerCloud::FileInfo.newitem2.file_info.file_path='Img/task2.jpg'item2.image_join_mode='Vertical'options=GroupDocsMergerCloud::JoinOptions.newoptions.join_items=[item1,item2]options.output_path="Output/joined.jpg"result=documentApi.join(GroupDocsMergerCloud::JoinRequest.new(options))puts("Output file path: "+result.path)
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.