Skip to content

Commit 80de47e

Browse files
authored
Update REST API.md
1 parent b1bc3d1 commit 80de47e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Documentation/REST API.md

+33
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [Store group](#store-group-api-reference)
1313
* [Project info](#project-info-api-reference)
1414
* [Secure delivery](secure-delivery-api-reference)
15+
* [Convert document](convert-document-api-reference)
1516

1617

1718
## Initialization
@@ -263,3 +264,35 @@ uploadcare.getAuthenticatedUrlFromUrl(url, { (value, error) in
263264
print(value)
264265
})
265266
```
267+
268+
## Convert document ([API Reference](https://uploadcare.com/docs/transformations/document_conversion/#convert?utm_source=github&utm_medium=referral&utm_campaign=uploadcare-swift)) ##
269+
270+
You can convert multiple files with one request:
271+
272+
```swift
273+
let task1 = DocumentConversionJobSettings(forFile: file1)
274+
.format(.odt)
275+
let task2 = DocumentConversionJobSettings(forFile: file2)
276+
.format(.pdf)
277+
278+
uploadcare.convertDocumentsWithSettings([task1, task2]) { (response, error) in
279+
if let error = error {
280+
print(error)
281+
return
282+
}
283+
284+
print(response)
285+
}
286+
```
287+
288+
Alternatively you can pass custom "paths" param as array of strings (see ([documentation](https://uploadcare.com/docs/transformations/document_conversion/#convert-url-formatting?utm_source=github&utm_medium=referral&utm_campaign=uploadcare-swift))):
289+
```swift
290+
uploadcare.convertDocuments([":uuid/document/-/format/:target-format/"]) { (response, error) in
291+
if let error = error {
292+
print(error)
293+
return
294+
}
295+
296+
print(response)
297+
}
298+
```

0 commit comments

Comments
 (0)