JavaScript
import Honcho from 'honcho-ai';
const client = new Honcho({
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
async function main() {
const collection = await client.apps.users.collections.getByName('app_id', 'user_id', 'name');
console.log(collection.id);
}
main();import os
from honcho import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
collection = client.apps.users.collections.get_by_name(
name="name",
app_id="app_id",
user_id="user_id",
)
print(collection.id)curl --request GET \
--url http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"user_id": "<string>",
"app_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}collections
Get Collection By Name
Get a Collection by Name
GET
/
v1
/
apps
/
{app_id}
/
users
/
{user_id}
/
collections
/
name
/
{name}
JavaScript
import Honcho from 'honcho-ai';
const client = new Honcho({
apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});
async function main() {
const collection = await client.apps.users.collections.getByName('app_id', 'user_id', 'name');
console.log(collection.id);
}
main();import os
from honcho import Honcho
client = Honcho(
api_key=os.environ.get("HONCHO_API_KEY"), # This is the default and can be omitted
)
collection = client.apps.users.collections.get_by_name(
name="name",
app_id="app_id",
user_id="user_id",
)
print(collection.id)curl --request GET \
--url http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/apps/{app_id}/users/{user_id}/collections/name/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"user_id": "<string>",
"app_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"metadata": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the app
ID of the user
Name of the collection to retrieve
⌘I