List all folders
Lists all folders of an user.
You can filter and customize the results using query parameters.
Query Parameters
Parameter | Type | Default | Description |
---|---|---|---|
query | string | - | Filter folders by name |
page | integer | 0 | Page number for pagination |
limit | integer | 25 | Number of results per page |
Sample Request
Here’s a sample request to list all user’s folders:
GET /v1/folders
fetch(`https://api.templated.io/v1/folders`, { method: 'GET', headers: { 'Authorization': `Bearer ${API_KEY}` }, // Example with all query parameters params: { query: 'Folder 1', page: 0, limit: 25 }}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));
import requests
api_key = 'API_KEY'url = 'https://api.templated.io/v1/folders'
# Example with all query parametersparams = { 'query': 'My Folder', 'page': 0, 'limit': 25}
headers = {'Authorization': f'Bearer {api_key}'}
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200: print(response.json())else: print('Request failed. Response code:', response.status_code) print(response.text)
import java.net.HttpURLConnection;import java.net.URL;import java.io.BufferedReader;import java.io.InputStreamReader;import java.net.URLEncoder;
public class ListFolders { public static void main(String[] args) { try { String apiKey = "API_KEY";
// Example with all query parameters String queryParams = String.format("?query=%s&page=%d&limit=%d", URLEncoder.encode("My Folder", "UTF-8"), 0, 25 );
URL url = new URL("https://api.templated.io/v1/folders" + queryParams);
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("Authorization", "Bearer " + apiKey);
int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String inputLine; StringBuilder response = new StringBuilder(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString()); } else { System.out.println("Request failed. Response Code: " + responseCode); } } catch (Exception e) { e.printStackTrace(); } }}
<?php$apiKey = 'API_KEY';
// Example with all query parameters$params = array( 'query' => 'My Folder', 'page' => 0, 'limit' => 25);
$url = "https://api.templated.io/v1/folders?" . http_build_query($params);
$options =
Response
The API returns an array of JSON objects with the folder details.
[ { "id": "fld_123abc", "name": "My Templates", "createdAt": "2024-03-20T10:30:00Z", "updatedAt": "2024-03-20T10:30:00Z" }, { "id": "fld_456def", "name": "Brand Assets", "createdAt": "2024-03-19T15:45:00Z", "updatedAt": "2024-03-20T09:15:00Z" }]
Each folder object contains the following properties:
id string
The unique identifier of the folder.
name string
The name of the folder.
createdAt string
The timestamp when the folder was created.
updatedAt string
The timestamp when the folder was last updated.