POST https://sync.api.cloudconvert.com/v2/jobs
{
"tasks": {
"import-first-file": {
"operation": "import/url",
"url": "https://my.url/file1.pdf"
},
"import-second-file": {
"operation": "import/url",
"url": "https://my.url/file2.docx"
},
"merge-my-files": {
"operation": "merge",
"input": [
"import-first-file",
"import-second-file"
],
"output_format": "pdf"
},
"export-my-file": {
"operation": "export/url",
"input": "merge-my-files"
}
},
"redirect": true
}
<?php
$job = (new Job())
->addTask(
(new Task('import/url', 'import-first-file'))
->set('url', 'https://my.url/file1.pdf')
)
->addTask(
(new Task('import/url', 'import-second-file'))
->set('url', 'https://my.url/file2.docx')
)
->addTask(
(new Task('merge', 'merge-my-files'))
->set('input', ['import-first-file', 'import-second-file'])
->set('output_format', 'pdf')
)
->addTask(
(new Task('export/url', 'export-my-file'))
->set('input', 'merge-my-files')
);
$cloudconvert->jobs()->create($job);
let exampleJob = await cloudConvert.jobs.create({
"tasks": {
"import-first-file": {
"operation": "import/url",
"url": "https://my.url/file1.pdf"
},
"import-second-file": {
"operation": "import/url",
"url": "https://my.url/file2.docx"
},
"merge-my-files": {
"operation": "merge",
"input": [
"import-first-file",
"import-second-file"
],
"output_format": "pdf"
},
"export-my-file": {
"operation": "export/url",
"input": "merge-my-files"
}
}
});
job = await cloudConvert.jobs.wait(job.id);
job = cloudconvert.jobs.create({
tasks: [
{
name: "import-first-file",
operation: "import/url",
url: "https://my-url/file1.pdf"
},
{
name: "import-second-file",
operation: "import/url",
url: "https://my-url/file2.docx"
},
{
name: "merge-my-files",
operation: "merge",
input: ["import-first-file", "import-second-file"],
output_format: "pdf"
},
{
name: "export-my-file",
operation: "export/url",
input: "merge-my-files"
},
]
})
job = cloudconvert.Job.create(payload={
'tasks': {
'import-first-file': {
'operation': 'import/url',
'url': 'https://my.url/file1.pdf'
},
'import-second-file': {
'operation': 'import/url',
'url': 'https://my.url/file2.docx'
},
'merge-my-files': {
'operation': 'merge',
'input': [
'import-first-file',
'import-second-file'
],
'output_format': 'pdf'
},
'export-my-file': {
'operation': 'export/url',
'input': 'merge-my-files'
}
}
})
final JobResponse createJobResponse = cloudConvertClient.jobs().create(
ImmutableMap.of(
"import-first-file",
new UrlImportRequest()
.setUrl("https://my.url/file1.pdf"),
"import-second-file",
new UrlImportRequest()
.setUrl("https://my.url/file2.docx"),
"merge-my-files",
new MergeFilesTaskRequest()
.setInput(ImmutableList.of("import-first-file", "import-second-file"))
.setOutputFormat("pdf")
"export-my-file",
new UrlExportRequest()
.setInput("merge-my-files")
)
).getBody();
var job = await CloudConvert.CreateJobAsync(new JobCreateRequest
{
Tasks = new
{
import_first_file = new ImportUrlCreateRequest
{
Url = "https://my.url/file1.pdf"
},
import_second_file = new ImportUrlCreateRequest
{
Url = "https://my.url/file2.docx"
},
merge_my_files = new MergeCreateRequest
{
Input = ["import_first_file", "import_second_file"],
Output_Format = "pdf"
},
export_it = new ExportUrlCreateRequest
{
Input = "merge_my_files"
}
}
});
Use our Job Builder to generate ready-to-use requests and code snippet for the
CloudConvert API.
Job Builder
API Documentation