Upload source files
curl --request POST \
--url http://localhost:5001/api/v1/ppt/files/upload \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: multipart/form-data' \
--form 'files=<string>' \
--form files.0.items='@example-file'import requests
url = "http://localhost:5001/api/v1/ppt/files/upload"
files = { "files.0.items": ("example-file", open("example-file", "rb")) }
payload = { "files": "<string>" }
headers = {"Authorization": "Basic <encoded-value>"}
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: 'Basic <encoded-value>'}};
options.body = form;
fetch('http://localhost:5001/api/v1/ppt/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 (self-hosted)
Upload supported source files and return identifiers that can be used in self-hosted generation requests.
POST
/
api
/
v1
/
ppt
/
files
/
upload
Upload source files
curl --request POST \
--url http://localhost:5001/api/v1/ppt/files/upload \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: multipart/form-data' \
--form 'files=<string>' \
--form files.0.items='@example-file'import requests
url = "http://localhost:5001/api/v1/ppt/files/upload"
files = { "files.0.items": ("example-file", open("example-file", "rb")) }
payload = { "files": "<string>" }
headers = {"Authorization": "Basic <encoded-value>"}
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: 'Basic <encoded-value>'}};
options.body = form;
fetch('http://localhost:5001/api/v1/ppt/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?