JavaScript
import Hyperspell from '@hyperspell/hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const folders = await client.folders.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(folders.folders);import os
from hyperspell import Hyperspell
client = Hyperspell(
api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted
)
folders = client.folders.list(
connection_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(folders.folders)package main
import (
"context"
"fmt"
"github.com/hyperspell/hyperspell-go"
"github.com/hyperspell/hyperspell-go/option"
)
func main() {
client := hyperspell.NewClient(
option.WithAPIKey("My API Key"),
)
folders, err := client.Folders.List(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
hyperspell.FolderListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", folders.Folders)
}
hyperspell folders list \
--api-key 'My API Key' \
--connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request GET \
--url https://api.hyperspell.com/connections/{connection_id}/folders \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperspell.com/connections/{connection_id}/folders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.hyperspell.com/connections/{connection_id}/folders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/connections/{connection_id}/folders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"folders": [
{
"provider_folder_id": "<string>",
"name": "<string>",
"has_children": true,
"parent_folder_id": "<string>",
"policy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Folders
List folders for a connection
List one level of folders from the user’s connected source.
Returns folders decorated with their explicit folder policy (if any). Use parent_id to drill into subfolders.
GET
/
connections
/
{connection_id}
/
folders
JavaScript
import Hyperspell from '@hyperspell/hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const folders = await client.folders.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(folders.folders);import os
from hyperspell import Hyperspell
client = Hyperspell(
api_key=os.environ.get("HYPERSPELL_API_KEY"), # This is the default and can be omitted
)
folders = client.folders.list(
connection_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(folders.folders)package main
import (
"context"
"fmt"
"github.com/hyperspell/hyperspell-go"
"github.com/hyperspell/hyperspell-go/option"
)
func main() {
client := hyperspell.NewClient(
option.WithAPIKey("My API Key"),
)
folders, err := client.Folders.List(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
hyperspell.FolderListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", folders.Folders)
}
hyperspell folders list \
--api-key 'My API Key' \
--connection-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request GET \
--url https://api.hyperspell.com/connections/{connection_id}/folders \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperspell.com/connections/{connection_id}/folders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.hyperspell.com/connections/{connection_id}/folders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperspell.com/connections/{connection_id}/folders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"folders": [
{
"provider_folder_id": "<string>",
"name": "<string>",
"has_children": true,
"parent_folder_id": "<string>",
"policy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
APIKeyAsUser
API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Path Parameters
Query Parameters
Parent folder ID. Omit for root-level folders.
Response
Successful Response
Folders at this level
Show child attributes
Show child attributes
Was this page helpful?
⌘I