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