Creates a new folder in the media storage
POST https://services.leadconnectorhq.com/medias/folder
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 Id
altType
string
default:"account"
required
Type of entity (account only) Posibles valores: ‘account’
name
string
default:"New Folder"
required
Name of the folder to be created
parentId
string
default:"64af50c42d567a3b4f5989e0"
ID of the parent folder (optional)
Respuestas
200 - Returns the newly created folder object
altId
string
default:"sx6wyHhbFdRXh302LLNR"
required
Account identifier that owns this folder
altType
string
default:"account"
required
Type of entity that owns the folder Posibles valores: ‘account’
name
string
default:"New Folder"
required
Name of the folder
parentId
string
default:"64af50c42d567a3b4f5989e0"
ID of the parent folder (null for root folders)
type
string
default:"folder"
required
Type of the object (always ‘folder’ for folders)
Whether the folder has been deleted
Whether there are pending uploads to this folder
Primary category of content stored in the folder
Sub-category of content stored in the folder
Whether the folder is private and not publicly accessible
Whether the folder has been moved from its original account
Whether the data migration process has been completed for this folder
Whether this is a system-generated application folder
Whether the folder is essential and should not be deleted
Current status of the folder
lastUpdatedBy
string
default:"user-uuid-123"
ID of the user who last updated the folder
{
"altId": "sx6wyHhbFdRXh302LLNR",
"altType": "account",
"name": "New Folder",
"parentId": "64af50c42d567a3b4f5989e0",
"type": "folder",
"deleted": false,
"pendingUpload": false,
"category": "image",
"subCategory": "logo",
"isPrivate": false,
"relocatedFolder": false,
"migrationCompleted": true,
"appFolder": false,
"isEssential": false,
"status": "string",
"lastUpdatedBy": "user-uuid-123"
}
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/medias/folder' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "sx6wyHhbFdRXh302LLNR",
"altType": "account",
"name": "New Folder",
"parentId": "64af50c42d567a3b4f5989e0"
}'
const response = await fetch('https://services.leadconnectorhq.com/medias/folder', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "sx6wyHhbFdRXh302LLNR", "altType": "account", "name": "New Folder", "parentId": "64af50c42d567a3b4f5989e0"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/medias/folder',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "sx6wyHhbFdRXh302LLNR", "altType": "account", "name": "New Folder", "parentId": "64af50c42d567a3b4f5989e0"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/medias/folder');
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({'altId': 'sx6wyHhbFdRXh302LLNR', 'altType': 'account', 'name': 'New Folder', 'parentId': '64af50c42d567a3b4f5989e0'}),
]);
$data = json_decode(curl_exec($ch), true);