cURL
We would not recommend to use the cURL integration for production, but it can be convenient for a quick test when you don't have an SDK lying around.
Install
brew install curl jq || sudo apt install curl jq
Example
# Prerequisites: brew install curl jq || sudo apt install curl jq
# To avoid tampering, use Signature Authentication
echo '{
"template_id": "YOUR_TEMPLATE_ID",
"auth": {
"key": "YOUR_TRANSLOADIT_KEY"
},
"steps": {
":original": {
"robot": "/upload/handle"
},
"faces_detected": {
"use": ":original",
"robot": "/image/facedetect",
"crop": true,
"faces": "max-confidence",
"format": "preserve",
"crop_padding": "10%"
},
"exported": {
"use": ["faces_detected", ":original"],
"robot": "/s3/store",
"credentials": "YOUR_AWS_CREDENTIALS",
"url_prefix": "https://demos.transloadit.com/"
}
}
}' |curl
--request POST
--form 'params=<-'
--form myfile1=@./joe-gardner-149699.jpg
https://api2.transloadit.com/assemblies
|jq