Updates a single file or folder by ID
POST https://services.leadconnectorhq.com/medias/{id}
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
id
string
default:"686f9817f0d3165be9fbcef6"
required
Unique identifier of the file or folder to update
Body
name
string
default:"Updated File Name.pdf"
required
New name for the file or folder
altType
string
default:"account"
required
Type of entity that owns the file or folder Posibles valores: ‘account’
altId
string
default:"sx6wyHhbFdRXh302LLNR"
required
Account identifier that owns the file or folder
Respuestas
200 - Successful response
{
"updated": true,
"traceId": "33a641a2-c4a6-4123-aa82-c5b84f1a14ee"
}
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/medias/YOUR_id' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"name": "Updated File Name.pdf",
"altType": "account",
"altId": "sx6wyHhbFdRXh302LLNR"
}'
const response = await fetch('https://services.leadconnectorhq.com/medias/YOUR_id', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name": "Updated File Name.pdf", "altType": "account", "altId": "sx6wyHhbFdRXh302LLNR"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/medias/YOUR_id',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"name": "Updated File Name.pdf", "altType": "account", "altId": "sx6wyHhbFdRXh302LLNR"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/medias/YOUR_id');
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({'name': 'Updated File Name.pdf', 'altType': 'account', 'altId': 'sx6wyHhbFdRXh302LLNR'}),
]);
$data = json_decode(curl_exec($ch), true);