Updates metadata or status of multiple files and folders
http
PUT https://services.leadconnectorhq.com/medias/update-filesAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | sx6wyHhbFdRXh302LLNR | Account identifier |
altType | string | Yes | account | Type of entity that owns the files Possible values: 'account' |
filesToBeUpdated(object[], required): Array of file objects to be updatedid(string, required): Unique identifier of the file or folder to be updated Example:686f9817f0d3165be9fbcef6name(string): New name for the file or folder Example:Updated File Name.pdf
Responses
200 - Successful response
json
[
{
"updated": true,
"id": "686f9817f0d3165be9fbcef6"
}
]Example
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);