List All Collections
Endpointโ
GET https://api.verifik.co/v2/face-recognition/collections
Fetch all collections generated by a specific client. The only parameter required is to send the access token. With this, Verifik will identify the collections generated by this user.
Headersโ
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Paramsโ
| Name | Type | Required | Description |
|---|---|---|---|
| โ | โ | โ | No query or path parameters. Results are scoped to the authenticated client via the bearer token. |
Requestโ
- Node.js
- PHP
- Python
- Go
const fetch = require("node-fetch");
async function run() {
const res = await fetch("https://api.verifik.co/v2/face-recognition/collections", {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
});
console.log(await res.json());
}
run();
<?php
$ch = curl_init("https://api.verifik.co/v2/face-recognition/collections");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_TOKEN")
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os, requests
url = "https://api.verifik.co/v2/face-recognition/collections"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_TOKEN')}"
}
r = requests.get(url, headers=headers)
print(r.json())
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.verifik.co/v2/face-recognition/collections", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_TOKEN"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
Responseโ
- 200
- 401/403
- 400
{
"data": [
{
"_id": "65b9592267cc4f096dbe743d",
"deleted": false,
"name": "Ejemplo Ene 30",
"project": "65b955fe0577440932c77481",
"description": "default collection for project 65b955fe0577440932c77481",
"client": "6158e492dd0767a2b8b3f829",
"code": "d96db430-27d2-4f43-bcff-c4b239ac6d2e",
"updatedAt": "2024-01-30T20:16:34.841Z",
"createdAt": "2024-01-30T20:16:34.841Z",
"__v": 0
},
{
"_id": "65c2a9364d8e8d3917eaf383",
"deleted": false,
"name": "Ejemplo Feb 6",
"project": "65c2a9271ff6bd3955eececd",
"description": "default collection for project 65c2a9271ff6bd3955eececd",
"client": "6158e492dd0767a2b8b3f829",
"code": "548574d7-748c-4a75-8838-aa9aa59b00d5",
"updatedAt": "2024-02-06T21:48:39.240Z",
"createdAt": "2024-02-06T21:48:39.240Z",
"__v": 0
}
]
}
{
"message": "Access forbidden",
"code": "Forbidden"
}
{
"error": "Invalid request"
}
Notesโ
- Authentication: The bearer token determines which clientโs collections are returned.
- Shape: Successful responses wrap the array in
data. - Filtering: This endpoint does not accept query filters; it returns all collections visible to the client.