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