Fetches list of files and folders from the media storage
http
GET https://services.leadconnectorhq.com/medias/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. |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
offset | string | No | 5 | Number of files to skip in listing |
limit | string | No | 10 | Number of files to show in the listing |
sortBy | string | Yes | createdAt | Field to sorting the file listing by |
sortOrder | string | Yes | asc | Direction in which file needs to be sorted |
type | string | Yes | file | Type |
query | string | No | Test file | Query text |
altType | string | Yes | account | AltType |
altId | string | Yes | account Id | |
parentId | string | No | parent id or folder id | |
fetchAll | string | No | false | Fetch all files or folders |
Responses
200 - Successful response
files(string[], required): Array of File Objects
json
{
"files": {
"altId": "locationId",
"altType": "account",
"name": "file name",
"parentId": "parent folder id",
"url": "file url",
"path": "file path"
}
}Example
curl -X GET 'https://services.leadconnectorhq.com/medias/files' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28'const response = await fetch('https://services.leadconnectorhq.com/medias/files', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
},
});
const data = await response.json();import os, requests
response = requests.request(
'GET',
'https://services.leadconnectorhq.com/medias/files',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/medias/files');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
],
]);
$data = json_decode(curl_exec($ch), true);