Set attachments on an existing message (replaces existing). Maximum 5 URLs. Supported for TYPE_CUSTOM_CALL (34) and TYPE_CALL (1) with subType EXTERNAL_CALL.
PUT https://services.leadconnectorhq.com/conversations/messages/{messageId}/attachments
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Path parameters
messageId
string
default: "ve9EPM428h8vShlRW1KT"
required
Message Id
Body
Array of attachment URLs to set on the message (replaces existing). Maximum 5 URLs.
Respuestas
200 - Successfully set message attachments
403 - Message type does not support attachment updates
Ejemplo
curl -X PUT 'https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"attachments": [
"https://provider.com/recordings/call-123.mp3"
]
}'
const response = await fetch ( 'https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments' , {
method: 'PUT' ,
headers: {
Authorization: `Bearer ${ process . env . LEADWAY_TOKEN } ` ,
Version: '2021-07-28' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({ "attachments" : [ "https://provider.com/recordings/call-123.mp3" ]}),
});
const data = await response . json ();
import os, requests
response = requests.request(
'PUT' ,
'https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments' ,
headers = {
'Authorization' : f "Bearer { os.environ[ 'LEADWAY_TOKEN' ] } " ,
'Version' : '2021-07-28' ,
'Content-Type' : 'application/json' ,
},
json = { "attachments" : [ "https://provider.com/recordings/call-123.mp3" ]},
)
data = response.json()
<? php
$ch = curl_init ( 'https://services.leadconnectorhq.com/conversations/messages/YOUR_messageId/attachments' );
curl_setopt_array ( $ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_CUSTOMREQUEST => 'PUT' ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv ( 'LEADWAY_TOKEN' ),
'Version: 2021-07-28' ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => json_encode ({ 'attachments' : [ 'https://provider.com/recordings/call-123.mp3' ]}),
]);
$data = json_decode ( curl_exec ( $ch ), true );