Upload source files
curl --request POST \
--url https://api.presenton.ai/api/v3/files/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'files=<string>' \
--form files.0.items='@example-file'import requests
url = "https://api.presenton.ai/api/v3/files/upload"
files = { "files.0.items": ("example-file", open("example-file", "rb")) }
payload = { "files": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('files.0.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.presenton.ai/api/v3/files/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));[
"<string>"
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Files and Images
Upload source files (Cloud)
Upload documents or other supported source files and return identifiers that can be used in Cloud generation requests.
POST
/
api
/
v3
/
files
/
upload
Upload source files
curl --request POST \
--url https://api.presenton.ai/api/v3/files/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'files=<string>' \
--form files.0.items='@example-file'import requests
url = "https://api.presenton.ai/api/v3/files/upload"
files = { "files.0.items": ("example-file", open("example-file", "rb")) }
payload = { "files": "<string>" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('files', '<string>');
form.append('files.0.items', '{
"fileName": "example-file"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.presenton.ai/api/v3/files/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));[
"<string>"
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Was this page helpful?