Chat
Generate upload URL
Used to upload anything from the client to S3 bucket
POST
/
v2
/
generate-upload-url
The presignedUrl
and formData
fields can be then used to upload the file to the S3 bucket, directly from the browser if necessary. Here is an example:
// data contains the presignedUrl and formData fields from the response
const formData = new FormData()
Object.entries(data.formData).forEach(([key, value]) => {
formData.append(key, value)
})
formData.append('file', file)
const upload = await fetch(data.presignedUrl, {
method: 'POST',
body: formData,
})
Body
application/json
sessionId
string
requiredfileName
string
requiredfileType
string
Response
200 - application/json
presignedUrl
string
requiredformData
object
requiredfileUrl
string
required