Validates the uploaded file in GCS and returns the public URL. Call this endpoint after successfully uploading the file to the signed URL.
POST https://services.leadconnectorhq.com/conversations/messages/upload/complete
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Body
uploadId
string
default:"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
required
Upload ID from request response
filePath
string
default:"account/loc123/conversations/conv456/uuid.mp4"
required
File path from request response
locationId
string
default:"ve9EPM428h8vShlRW1KT"
required
Account ID
conversationId
string
default:"ve9EPM428h8vShlRW1KT"
required
Conversation ID
filename
string
default:"video.mp4"
required
Original filename (for response mapping)
Respuestas
200 - Upload completed successfully
Map of filename to public URL
{
"uploadedFiles": {
"video.mp4": "https://your-domain.com/conversations-assets/account/.../video.mp4"
},
"metadata": {
"size": 52428800,
"contentType": "video/mp4"
}
}
400 - Bad Request - Invalid parameters
404 - File not found in storage - upload may have failed or URL expired
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/conversations/messages/upload/complete' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"uploadId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"filePath": "account/loc123/conversations/conv456/uuid.mp4",
"locationId": "ve9EPM428h8vShlRW1KT",
"conversationId": "ve9EPM428h8vShlRW1KT",
"filename": "video.mp4"
}'
const response = await fetch('https://services.leadconnectorhq.com/conversations/messages/upload/complete', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"uploadId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "filePath": "account/loc123/conversations/conv456/uuid.mp4", "locationId": "ve9EPM428h8vShlRW1KT", "conversationId": "ve9EPM428h8vShlRW1KT", "filename": "video.mp4"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/conversations/messages/upload/complete',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"uploadId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "filePath": "account/loc123/conversations/conv456/uuid.mp4", "locationId": "ve9EPM428h8vShlRW1KT", "conversationId": "ve9EPM428h8vShlRW1KT", "filename": "video.mp4"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/conversations/messages/upload/complete');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'uploadId': 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'filePath': 'account/loc123/conversations/conv456/uuid.mp4', 'locationId': 've9EPM428h8vShlRW1KT', 'conversationId': 've9EPM428h8vShlRW1KT', 'filename': 'video.mp4'}),
]);
$data = json_decode(curl_exec($ch), true);