The API resources allows you to use most of the features of Garchi Headless CMS to create your own Headless app.
This documentation is for v2 and aims to provide all the information you need to work with our API. As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).
The JavaScript and PHP examples use the official SDKs (@garchicms/garchi-node-sdk and garchicms/garchi-sdk-php); the other languages call the REST API directly. Every request is authenticated with your API token, sent as a bearer token in the Authorization header (Authorization: Bearer {YOUR_API_TOKEN}). The SDKs add that header for you when you pass your token to the client.
The API has a rate limit of 600 requests per minute. If more than 600 requests are made within a 1 minute sliding window, the API will return a 429 "Too Many Requests" status code until the rate limit resets.
The rate limit window is measured in 1 minute intervals. If the rate limit is exceeded at 10:05, requests will be throttled until at least 10:06. The rate limit counter is reset after each 1 minute window has passed, allowing another 600 requests. Getting throttled does not permanently block access; your code should handle the 429 response by retrying requests later.
Base URL
https://garchi.co.uk
Endpoints that create resources count against your plan's allowances, exactly as the dashboard and AI agents do. The API cannot create more than your plan allows.
| Resource | Allowance applies to | Create endpoint |
|---|---|---|
| Spaces | Your whole account | POST /api/v2/space |
| Pages | Each space | POST /api/v2/space/{uid}/create_page |
| Items | Each space | POST /api/v2/item |
| Categories | Each space | POST /api/v2/category |
The current allowances for each plan are listed on the pricing page.
When an allowance has been reached, nothing is created and the API responds with HTTP 422 and a limit error:
{
"message": "The items allowance for this plan has been reached.",
"errors": {
"limit": ["The items allowance for this plan has been reached."]
}
}
Use the error key to tell the cases apart:
401 — the token is missing or invalid.404 — the space or resource was not found for your account.422 with errors.limit — a plan allowance has been reached. Delete something you no longer need or upgrade your plan, then retry.422 with any other key under errors — a field in the request is invalid. Fix the request before retrying.Errors are always returned as JSON.
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_API_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by visiting your dashboard. To create a new token click here.
requires authentication
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/spaces?size=10" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.space.getAll({
size: 10,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->space->getAll([
'size' => 10,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/spaces'
params = {
'size': '10',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/spaces";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"size": "10",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/spaces';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'size': '10',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"uid": "3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1",
"name": "Jane Doe",
"logo_url": "https://assets.garchi.co.uk/examples/seller-logo.jpg",
"number_of_items": 3,
"agent_description": "This is ai agent description"
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/spaces?page=1",
"last": "https://garchi.co.uk/api/v2/spaces?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/spaces?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/spaces",
"per_page": 10,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
requires authentication
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.space.get("3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1"); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->space->get('3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1'); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/3d5f84d6-8914-4061-b9be-cbdd8bcd806fb6138bbf-296e-44b4-9cf1-03b1';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": {
"uid": "52690642-cc29-4c4d-a9dc-752d4036869e9b64f419-c900-49a8-9109-208a",
"name": "Jane Doe",
"logo_url": "https://assets.garchi.co.uk/examples/seller-logo.svg",
"number_of_items": 24,
"agent_description": "This is agent description"
}
}
Received response:
Request failed with error:
requires authentication
Creates a new space.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/space" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--form "name="Jane Doe"" \
--form "logo=@/path/to/logo.png" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.space.create({
name: "Jane Doe",
logo: logoFile, // a File or Blob, e.g. from an <input type="file">
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->space->create([
'name' => 'Jane Doe',
'logo' => '/path/to/logo.png', // path to an image file
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/space'
files = {
'logo': open('/path/to/logo.png', 'rb')
}
payload = {
"name": "\"Jane Doe\""
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'multipart/form-data'
}
response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Path> files = new HashMap<>();
files.put("logo", Path.of("/path/to/logo.png"));
builder.POST(HttpRequest.BodyPublishers.ofByteArray(files));
String body = {
"name": "\"Jane Doe\""
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "multipart/form-data");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'multipart/form-data'
]
$client = Http::withHeaders($headers);
$body = {
"name": "\"Jane Doe\""
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": {
"uid": "3cbec0da-0c9f-4cd3-99e3-0b962477816dededd79c-d150-45ec-93b6-859c2f52b234",
"name": "Jane Doe",
"logo_url": "NA",
"number_of_items": null,
"agent_description": "NA"
}
}
Example response (Plan allowance reached):
{
"message": "The space allowance for this plan has been reached.",
"errors": {
"limit": [
"The space allowance for this plan has been reached."
]
}
}
Received response:
Request failed with error:
requires authentication
Deletes space record and associated records.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" const url = new URL(
"https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"
);
const headers = {
"Authorization": "Bearer {YOUR_API_TOKEN}",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json()); $client = new \GuzzleHttp\Client();
$response = $client->post(
'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body)); import requests
import json
url = 'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('POST', url, headers=headers)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/delete/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Space details deleted successfully"
}
Received response:
Request failed with error:
requires authentication
Updates space details.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--form "name="Jane Doe"" \
--form "logo=@/path/to/logo.png" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.space.update("635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1", {
name: "Jane Doe",
logo: logoFile, // a File or Blob, e.g. from an <input type="file">
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->space->update('635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1', [
'name' => 'Jane Doe',
'logo' => '/path/to/logo.png', // path to an image file
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1'
files = {
'logo': open('/path/to/logo.png', 'rb')
}
payload = {
"name": "\"Jane Doe\""
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'multipart/form-data'
}
response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Path> files = new HashMap<>();
files.put("logo", Path.of("/path/to/logo.png"));
builder.POST(HttpRequest.BodyPublishers.ofByteArray(files));
String body = {
"name": "\"Jane Doe\""
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "multipart/form-data");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/update/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'multipart/form-data'
]
$client = Http::withHeaders($headers);
$body = {
"name": "\"Jane Doe\""
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Space details updated successfully"
}
Received response:
Request failed with error:
requires authentication
Creates a new cateogry for a space
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/category" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
\"category\": \"pariatur\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.category.create({
space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
category: "pariatur",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->category->create([
'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
'category' => 'pariatur',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/category'
payload = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"category": "pariatur"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/category";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"category": "pariatur"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/category';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"category": "pariatur"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": {
"id": 43,
"name": "Events",
"rank": 1,
"created_at": "2024-05-01 10:12:45"
}
}
Example response (Plan allowance reached):
{
"message": "The categories allowance for this plan has been reached.",
"errors": {
"limit": [
"The categories allowance for this plan has been reached."
]
}
}
Received response:
Request failed with error:
requires authentication
Deletes a category and all the associated items of that category for a space
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.category.delete({
space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
category_id: 43,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->category->delete([
'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
'category_id' => 43,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('POST', url, headers=headers)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/delete/category/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/43';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Category deleted successfully"
}
Received response:
Request failed with error:
requires authentication
Update a cateogry for a space
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/update/category/43" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
\"category\": \"magni\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.category.update({
category_id: 43,
space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
category: "magni",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->category->update([
'category_id' => 43,
'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
'category' => 'magni',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/update/category/43'
payload = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"category": "magni"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/category/43";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"category": "magni"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/update/category/43';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"category": "magni"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Category updated successfully"
}
Received response:
Request failed with error:
requires authentication
Returns all the categories of the specified space.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.space.categories("b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab"); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->space->categories('b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab'); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab/categories';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"id": 43,
"name": "Events",
"rank": 1,
"created_at": "2024-05-01 10:12:45"
},
{
"id": 44,
"name": "Workshops",
"rank": 2,
"created_at": "2024-05-02 08:30:10"
}
]
}
Received response:
Request failed with error:
requires authentication
Returns all the categories for all the spaces.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/categories" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.category.getAll(); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->category->getAll(); import requests
import json
url = 'https://garchi.co.uk/api/v2/categories'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/categories";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/categories';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"id": 43,
"name": "Events",
"rank": 1,
"created_at": "2024-05-01 10:12:45"
},
{
"id": 44,
"name": "Workshops",
"rank": 2,
"created_at": "2024-05-02 08:30:10"
}
]
}
Received response:
Request failed with error:
requires authentication
Adds a new item for a space
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/item" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\",
\"name\": \"\\\"item ABC\\\"\",
\"categories\": [
44,
45
],
\"sku\": \"SKU11111\",
\"stock\": 5,
\"price\": \"10\",
\"scratched_price\": 5,
\"detail_description\": \"This is an amazing <b>item<\\/b>\",
\"agent_description\": \"A lightweight product summary that helps AI agents understand when to recommend this item.\",
\"external_url\": \"https:\\/\\/productabc.com\",
\"slug\": \"item-abc\",
\"parent_id\": 48
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.create({
space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
name: "item ABC",
categories: [44, 45],
sku: "SKU11111",
stock: 5,
price: 10,
scratched_price: 5,
detail_description: "This is an amazing <b>item</b>",
agent_description: "A lightweight product summary that helps AI agents understand when to recommend this item.",
external_url: "https://productabc.com",
slug: "item-abc",
parent_id: 48,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->create([
'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
'name' => 'item ABC',
'categories' => [44, 45],
'sku' => 'SKU11111',
'stock' => 5,
'price' => 10,
'scratched_price' => 5,
'detail_description' => 'This is an amazing <b>item</b>',
'agent_description' => 'A lightweight product summary that helps AI agents understand when to recommend this item.',
'external_url' => 'https://productabc.com',
'slug' => 'item-abc',
'parent_id' => 48,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/item'
payload = {
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
"name": "\"item ABC\"",
"categories": [
44,
45
],
"sku": "SKU11111",
"stock": 5,
"price": "10",
"scratched_price": 5,
"detail_description": "This is an amazing <b>item<\/b>",
"agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
"external_url": "https:\/\/productabc.com",
"slug": "item-abc",
"parent_id": 48
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
"name": "\"item ABC\"",
"categories": [
44,
45
],
"sku": "SKU11111",
"stock": 5,
"price": "10",
"scratched_price": 5,
"detail_description": "This is an amazing <b>item<\/b>",
"agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
"external_url": "https:\/\/productabc.com",
"slug": "item-abc",
"parent_id": 48
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/item';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
"name": "\"item ABC\"",
"categories": [
44,
45
],
"sku": "SKU11111",
"stock": 5,
"price": "10",
"scratched_price": 5,
"detail_description": "This is an amazing <b>item<\/b>",
"agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
"external_url": "https:\/\/productabc.com",
"slug": "item-abc",
"parent_id": 48
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": {
"item_id": 50,
"sku": "SKU111111",
"external_link": null,
"slug": "item-abc",
"parent_id": null,
"children_count": 0,
"name": "Item ABC",
"stock": 5,
"price": 10,
"scratched_price": 5,
"one_liner": null,
"description": "This is an amazing <b>item</b>",
"delivery_type": null,
"main_image": "NA",
"other_images": [],
"space": {
"uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
"name": "Shop XYZ"
},
"avg_rating": null,
"scheduled_for": null,
"agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
"created": "2026-10-12 10:15:00",
"updated": "2026-10-12 10:15:00"
}
}
Example response (Plan allowance reached):
{
"message": "The items allowance for this plan has been reached.",
"errors": {
"limit": [
"The items allowance for this plan has been reached."
]
}
}
Received response:
Request failed with error:
requires authentication
Deletes an item and it's associated meta data and attributes for a space
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/delete/item" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"item_id\": 50,
\"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.delete({
item_id: 50,
space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->delete([
'item_id' => 50,
'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/delete/item'
payload = {
"item_id": 50,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/item";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"item_id": 50,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/delete/item';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"item_id": 50,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Item deleted successfully"
}
Received response:
Request failed with error:
requires authentication
Update a item for a space
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/update/item" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"item_id\": 50,
\"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\",
\"name\": \"\\\"item ABC\\\"\",
\"sku\": \"SKU11111\",
\"stock\": 5,
\"categories\": [
44
],
\"price\": 10,
\"scratched_price\": \"5\",
\"detail_description\": \"This is an amazing <b>item<\\/b>\",
\"agent_description\": \"A lightweight product summary that helps AI agents understand when to recommend this item.\",
\"external_url\": \"https:\\/\\/itemabc.com\",
\"make_public\": \"true\",
\"slug\": \"item-abc\",
\"parent_id\": 48
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.update({
item_id: 50,
space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
name: "item ABC",
sku: "SKU11111",
stock: 5,
categories: [44],
price: 10,
scratched_price: 5,
detail_description: "This is an amazing <b>item</b>",
agent_description: "A lightweight product summary that helps AI agents understand when to recommend this item.",
external_url: "https://itemabc.com",
make_public: "true",
slug: "item-abc",
parent_id: 48,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->update([
'item_id' => 50,
'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
'name' => 'item ABC',
'sku' => 'SKU11111',
'stock' => 5,
'categories' => [44],
'price' => 10,
'scratched_price' => 5,
'detail_description' => 'This is an amazing <b>item</b>',
'agent_description' => 'A lightweight product summary that helps AI agents understand when to recommend this item.',
'external_url' => 'https://itemabc.com',
'make_public' => 'true',
'slug' => 'item-abc',
'parent_id' => 48,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/update/item'
payload = {
"item_id": 50,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
"name": "\"item ABC\"",
"sku": "SKU11111",
"stock": 5,
"categories": [
44
],
"price": 10,
"scratched_price": "5",
"detail_description": "This is an amazing <b>item<\/b>",
"agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
"external_url": "https:\/\/itemabc.com",
"make_public": "true",
"slug": "item-abc",
"parent_id": 48
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/item";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"item_id": 50,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
"name": "\"item ABC\"",
"sku": "SKU11111",
"stock": 5,
"categories": [
44
],
"price": 10,
"scratched_price": "5",
"detail_description": "This is an amazing <b>item<\/b>",
"agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
"external_url": "https:\/\/itemabc.com",
"make_public": "true",
"slug": "item-abc",
"parent_id": 48
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/update/item';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"item_id": 50,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
"name": "\"item ABC\"",
"sku": "SKU11111",
"stock": 5,
"categories": [
44
],
"price": 10,
"scratched_price": "5",
"detail_description": "This is an amazing <b>item<\/b>",
"agent_description": "A lightweight product summary that helps AI agents understand when to recommend this item.",
"external_url": "https:\/\/itemabc.com",
"make_public": "true",
"slug": "item-abc",
"parent_id": 48
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Item updated successfully"
}
Received response:
Request failed with error:
requires authentication
This api allows you to add extra information or meta data for a item. The data is added as a key value pair
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/item_meta" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"meta\": [
{
\"key\": \"website\",
\"value\": \"https:\\/\\/example.com\",
\"type\": \"url\"
}
],
\"item_id\": 51
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.createMetaInfo({
meta: [
{
key: "website",
value: "https://example.com",
type: "url",
}
],
item_id: 51,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->createMetaInfo([
'meta' => [
[
'key' => 'website',
'value' => 'https://example.com',
'type' => 'url',
],
],
'item_id' => 51,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/item_meta'
payload = {
"meta": [
{
"key": "website",
"value": "https:\/\/example.com",
"type": "url"
}
],
"item_id": 51
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item_meta";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"meta": [
{
"key": "website",
"value": "https:\/\/example.com",
"type": "url"
}
],
"item_id": 51
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/item_meta';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"meta": [
{
"key": "website",
"value": "https:\/\/example.com",
"type": "url"
}
],
"item_id": 51
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"id": 606,
"key": "website",
"value": "https://example.com",
"type": "url"
}
]
}
Received response:
Request failed with error:
requires authentication
This api allows you to delete extra information or meta data for a item. The data is added as a key value pair
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/delete/item_meta" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"meta_id\": 55,
\"item_id\": 51,
\"space_uid\": \"ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.deleteMetaInfo({
meta_id: 55,
item_id: 51,
space_uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->deleteMetaInfo([
'meta_id' => 55,
'item_id' => 51,
'space_uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/delete/item_meta'
payload = {
"meta_id": 55,
"item_id": 51,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/delete/item_meta";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"meta_id": 55,
"item_id": 51,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/delete/item_meta';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"meta_id": 55,
"item_id": 51,
"space_uid": "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Item meta deleted successfully"
}
Received response:
Request failed with error:
requires authentication
This api allows you to update extra information or meta data for a item. The data is added as a key value pair
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/update/item_meta" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"key\": \"website\",
\"type\": \"url\",
\"value\": \"https:\\/\\/example.com\",
\"meta_id\": 55,
\"item_id\": 51
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.updateMetaInfo({
key: "website",
type: "url",
value: "https://example.com",
meta_id: 55,
item_id: 51,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->updateMetaInfo([
'key' => 'website',
'type' => 'url',
'value' => 'https://example.com',
'meta_id' => 55,
'item_id' => 51,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/update/item_meta'
payload = {
"key": "website",
"type": "url",
"value": "https:\/\/example.com",
"meta_id": 55,
"item_id": 51
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/update/item_meta";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"key": "website",
"type": "url",
"value": "https:\/\/example.com",
"meta_id": 55,
"item_id": 51
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/update/item_meta';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"key": "website",
"type": "url",
"value": "https:\/\/example.com",
"meta_id": 55,
"item_id": 51
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": "Item meta updated successfully"
}
Received response:
Request failed with error:
requires authentication
Returns list of all the items with pagination links for a particular space
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/space/reiciendis/items?size=3&order_key=price&order_by=desc&reactions=include&children=exclude&description=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.getBySpace({
uid: "reiciendis",
size: 3,
order_key: "price",
order_by: "desc",
reactions: "include",
children: "exclude",
description: "exclude",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->getBySpace([
'uid' => 'reiciendis',
'size' => 3,
'order_key' => 'price',
'order_by' => 'desc',
'reactions' => 'include',
'children' => 'exclude',
'description' => 'exclude',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/reiciendis/items'
params = {
'size': '3',
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/reiciendis/items";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"size": "3",
"order_key": "price",
"order_by": "desc",
"reactions": "include",
"children": "exclude",
"description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/reiciendis/items';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'size': '3',
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/items?page=1",
"last": "https://garchi.co.uk/api/v2/items?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/items?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
requires authentication
Before you use this API make sure to create embeddings from your dashboard . This endpoint returns the list of items based on semantic search. The search is based on the description and name of the items. The response body is similar to list all items api .
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/items/semantic-search?q=web+app&threshold=0.5&reactions=include&children=exclude&description=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.semanticSearch({
q: "web app",
threshold: 0.5,
reactions: "include",
children: "exclude",
description: "exclude",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->semanticSearch([
'q' => 'web app',
'threshold' => 0.5,
'reactions' => 'include',
'children' => 'exclude',
'description' => 'exclude',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/items/semantic-search'
params = {
'q': 'web app',
'threshold': '0.5',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/semantic-search";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"q": "web app",
"threshold": "0.5",
"reactions": "include",
"children": "exclude",
"description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/items/semantic-search';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'q': 'web app',
'threshold': '0.5',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"similarity": 0.82,
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
]
}
Received response:
Request failed with error:
requires authentication
This endpoint returns the list of featured items that you set from your dashboard. The response body is similar to list all items api .
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/items/featured?reactions=include&children=exclude&description=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.featured({
reactions: "include",
children: "exclude",
description: "exclude",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->featured([
'reactions' => 'include',
'children' => 'exclude',
'description' => 'exclude',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/items/featured'
params = {
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/featured";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"reactions": "include",
"children": "exclude",
"description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/items/featured';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
]
}
Received response:
Request failed with error:
requires authentication
Returns details of a single item based on the item_id or slug passed.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/item/3?reactions=include&children=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.get({
item: "3",
reactions: "include",
children: "exclude",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->get([
'item' => '3',
'reactions' => 'include',
'children' => 'exclude',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/item/3'
params = {
'reactions': 'include',
'children': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/item/3";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"reactions": "include",
"children": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/item/3';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'reactions': 'include',
'children': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
]
}
Received response:
Request failed with error:
requires authentication
Returns list of all the items with pagination links. You can also use this api to search items by their name, slug, or category.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/items?size=10&search_keyword=Web+app+with&order_key=price&order_by=desc&reactions=include&children=exclude&description=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.getAll({
size: 10,
search_keyword: "Web app with",
order_key: "price",
order_by: "desc",
reactions: "include",
children: "exclude",
description: "exclude",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->getAll([
'size' => 10,
'search_keyword' => 'Web app with',
'order_key' => 'price',
'order_by' => 'desc',
'reactions' => 'include',
'children' => 'exclude',
'description' => 'exclude',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/items'
params = {
'size': '10',
'search_keyword': 'Web app with',
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"size": "10",
"search_keyword": "Web app with",
"order_key": "price",
"order_by": "desc",
"reactions": "include",
"children": "exclude",
"description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/items';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'size': '10',
'search_keyword': 'Web app with',
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/items?page=1",
"last": "https://garchi.co.uk/api/v2/items?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/items?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
requires authentication
Based on the filters passed, does logically and of all filters and returns the list of items with pagination. The response body is similar to list all items api . The accepted filters are spaces, categories and priceOrder. If any of these filter is null or blank or empty then it will be ignored.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/items/filter?reactions=include&children=exclude&order_key=price&order_by=desc&description=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"spaces\": \"[\'2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1\']\",
\"categories\": \"[23,4,1]\",
\"priceOrder\": \"\\\"low-high\\\"\",
\"size\": \"10\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.filter({
query: {
reactions: "include",
children: "exclude",
order_key: "price",
order_by: "desc",
description: "exclude",
},
body: {
spaces: [
"2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1"
],
categories: [23, 4, 1],
priceOrder: "low-high",
size: 10,
},
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->filter([
'query' => [
'reactions' => 'include',
'children' => 'exclude',
'order_key' => 'price',
'order_by' => 'desc',
'description' => 'exclude',
],
'body' => [
'spaces' => [
'2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1',
],
'categories' => [23, 4, 1],
'priceOrder' => 'low-high',
'size' => 10,
],
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/items/filter'
payload = {
"spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
"categories": "[23,4,1]",
"priceOrder": "\"low-high\"",
"size": "10"
}
params = {
'reactions': 'include',
'children': 'exclude',
'order_key': 'price',
'order_by': 'desc',
'description': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/filter";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
"categories": "[23,4,1]",
"priceOrder": "\"low-high\"",
"size": "10"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
Map<Object, Object> params = {
"reactions": "include",
"children": "exclude",
"order_key": "price",
"order_by": "desc",
"description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/items/filter';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"spaces": "['2z5088d1-8772-2912-ab9w-cbdd8bcd806fb6138bbf-296e-94b4-9cf1-03x1']",
"categories": "[23,4,1]",
"priceOrder": "\"low-high\"",
"size": "10"
};
$client->withBody($body);
$queryParams = {
'reactions': 'include',
'children': 'exclude',
'order_key': 'price',
'order_by': 'desc',
'description': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/items?page=1",
"last": "https://garchi.co.uk/api/v2/items?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/items?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
requires authentication
Based on the filters passed for the meta data (Extra details added for an item) and the operation specified, filters the items. Does logical and of the filters. The response body is similar to list all items api .
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/items/filter/bymeta?order_key=price&order_by=desc&reactions=include&children=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"meta_filters\": [
{
\"key\": \"date\",
\"value\": \"[\'2021-11-21\', \'2020-12-12\']\",
\"operator\": \"in\"
}
]
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.filterByMeta({
query: {
order_key: "price",
order_by: "desc",
reactions: "include",
children: "exclude",
},
body: {
meta_filters: [
{
key: "date",
value: ["2021-11-21", "2020-12-12"],
operator: "in",
}
],
},
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->filterByMeta([
'query' => [
'order_key' => 'price',
'order_by' => 'desc',
'reactions' => 'include',
'children' => 'exclude',
],
'body' => [
'meta_filters' => [
[
'key' => 'date',
'value' => ['2021-11-21', '2020-12-12'],
'operator' => 'in',
],
],
],
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/items/filter/bymeta'
payload = {
"meta_filters": [
{
"key": "date",
"value": "['2021-11-21', '2020-12-12']",
"operator": "in"
}
]
}
params = {
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/filter/bymeta";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"meta_filters": [
{
"key": "date",
"value": "['2021-11-21', '2020-12-12']",
"operator": "in"
}
]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
Map<Object, Object> params = {
"order_key": "price",
"order_by": "desc",
"reactions": "include",
"children": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/items/filter/bymeta';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"meta_filters": [
{
"key": "date",
"value": "['2021-11-21', '2020-12-12']",
"operator": "in"
}
]
};
$client->withBody($body);
$queryParams = {
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
]
}
Received response:
Request failed with error:
requires authentication
This endpoint returns list of items based on items_ids given. It could be use to list specific list of items on landing page. The response body is similar to list all items api .
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/items/byids?order_key=price&order_by=desc&reactions=include&children=exclude&description=exclude" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"item_ids\": [
15,
29
]
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.getByIds({
query: {
order_key: "price",
order_by: "desc",
reactions: "include",
children: "exclude",
description: "exclude",
},
body: {
item_ids: [15, 29],
},
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->getByIds([
'query' => [
'order_key' => 'price',
'order_by' => 'desc',
'reactions' => 'include',
'children' => 'exclude',
'description' => 'exclude',
],
'body' => [
'item_ids' => [15, 29],
],
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/items/byids'
payload = {
"item_ids": [
15,
29
]
}
params = {
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/items/byids";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"item_ids": [
15,
29
]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
Map<Object, Object> params = {
"order_key": "price",
"order_by": "desc",
"reactions": "include",
"children": "exclude",
"description": "exclude",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/items/byids';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"item_ids": [
15,
29
]
};
$client->withBody($body);
$queryParams = {
'order_key': 'price',
'order_by': 'desc',
'reactions': 'include',
'children': 'exclude',
'description': 'exclude',
};
$url .= '?'. $queryParams;
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
]
}
Received response:
Request failed with error:
requires authentication
Find the published items of a space with any combination of conditions on their own fields and their metadata, including values nested inside JSON objects and lists.
A condition is `{"field": ..., "op": ..., "value": ...}`. Group conditions with `{"all": [...]}` (every one must match) or `{"any": [...]}` (at least one must match); groups can be nested. A plain list of conditions means all.
Item fields: item_id, name, slug, sku, price, scratched_price, stock, created, updated, category (category ids), type (item type slugs, such as "product").
Metadata fields: `meta.
Operators: eq, ne, gt, gte, lt, lte, between ([from, to]), in, not_in, contains, starts_with, exists, not_exists, and has_all (lists: every value present). Numbers compare as numbers, ISO dates as dates, and text case-insensitively.
Sort by up to three item or metadata fields. Results are paginated and every item has the same shape as in the other item endpoints, with all of its metadata.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"where\": {
\"all\": [
{
\"field\": \"meta.color\",
\"op\": \"in\",
\"value\": [
\"red\",
\"blue\"
]
},
{
\"field\": \"meta.specs.weight\",
\"op\": \"lte\",
\"value\": 2.5
},
{
\"any\": [
{
\"field\": \"price\",
\"op\": \"lt\",
\"value\": 50
},
{
\"field\": \"meta.on_sale\",
\"op\": \"eq\",
\"value\": true
}
]
}
]
},
\"sort\": [
{
\"field\": \"meta.specs.weight\",
\"direction\": \"asc\"
}
],
\"page\": 1,
\"size\": 10,
\"reactions\": \"exclude\",
\"children\": \"exclude\",
\"description\": \"include\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.query({
uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
where: {
all: [
{
field: "meta.color",
op: "in",
value: ["red", "blue"],
},
{
field: "meta.specs.weight",
op: "lte",
value: 2.5,
},
{
any: [
{
field: "price",
op: "lt",
value: 50,
},
{
field: "meta.on_sale",
op: "eq",
value: true,
}
],
}
],
},
sort: [
{
field: "meta.specs.weight",
direction: "asc",
}
],
page: 1,
size: 10,
reactions: "exclude",
children: "exclude",
description: "include",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->query([
'uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
'where' => [
'all' => [
[
'field' => 'meta.color',
'op' => 'in',
'value' => ['red', 'blue'],
],
[
'field' => 'meta.specs.weight',
'op' => 'lte',
'value' => 2.5,
],
[
'any' => [
[
'field' => 'price',
'op' => 'lt',
'value' => 50,
],
[
'field' => 'meta.on_sale',
'op' => 'eq',
'value' => true,
],
],
],
],
],
'sort' => [
[
'field' => 'meta.specs.weight',
'direction' => 'asc',
],
],
'page' => 1,
'size' => 10,
'reactions' => 'exclude',
'children' => 'exclude',
'description' => 'include',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query'
payload = {
"where": {
"all": [
{
"field": "meta.color",
"op": "in",
"value": [
"red",
"blue"
]
},
{
"field": "meta.specs.weight",
"op": "lte",
"value": 2.5
},
{
"any": [
{
"field": "price",
"op": "lt",
"value": 50
},
{
"field": "meta.on_sale",
"op": "eq",
"value": true
}
]
}
]
},
"sort": [
{
"field": "meta.specs.weight",
"direction": "asc"
}
],
"page": 1,
"size": 10,
"reactions": "exclude",
"children": "exclude",
"description": "include"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"where": {
"all": [
{
"field": "meta.color",
"op": "in",
"value": [
"red",
"blue"
]
},
{
"field": "meta.specs.weight",
"op": "lte",
"value": 2.5
},
{
"any": [
{
"field": "price",
"op": "lt",
"value": 50
},
{
"field": "meta.on_sale",
"op": "eq",
"value": true
}
]
}
]
},
"sort": [
{
"field": "meta.specs.weight",
"direction": "asc"
}
],
"page": 1,
"size": 10,
"reactions": "exclude",
"children": "exclude",
"description": "include"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/query';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"where": {
"all": [
{
"field": "meta.color",
"op": "in",
"value": [
"red",
"blue"
]
},
{
"field": "meta.specs.weight",
"op": "lte",
"value": 2.5
},
{
"any": [
{
"field": "price",
"op": "lt",
"value": 50
},
{
"field": "meta.on_sale",
"op": "eq",
"value": true
}
]
}
]
},
"sort": [
{
"field": "meta.specs.weight",
"direction": "asc"
}
],
"page": 1,
"size": 10,
"reactions": "exclude",
"children": "exclude",
"description": "include"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/items?page=1",
"last": "https://garchi.co.uk/api/v2/items?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/items?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 1,
"total": 1
}
}
Example response (404):
{
"error": "Space not found"
}
Example response (422):
{
"message": "The op for \"meta.color\" must be one of: eq, ne, gt, gte, lt, lte, between, in, not_in, contains, starts_with, exists, not_exists, has_all.",
"errors": {
"where.all.0.op": [
"The op for \"meta.color\" must be one of: eq, ne, gt, gte, lt, lte, between, in, not_in, contains, starts_with, exists, not_exists, has_all."
]
}
}
Received response:
Request failed with error:
requires authentication
Returns the published items inside an item, such as the variants of a product or the lessons of a course, in the order set in the dashboard. Each item has the same shape as in the other item endpoints, and its own `parent_id`.
Items can be nested up to three levels (Course → Module → Lesson); call this again with a child's id or slug to go one level deeper. The parent itself must be published, like every item the content API returns.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children?page=1&size=10&reactions=exclude&children=exclude&description=include" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.dataItem.getChildren({
uid: "ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9",
item: "oak-table",
page: 1,
size: 10,
reactions: "exclude",
children: "exclude",
description: "include",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->dataItem->getChildren([
'uid' => 'ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9',
'item' => 'oak-table',
'page' => 1,
'size' => 10,
'reactions' => 'exclude',
'children' => 'exclude',
'description' => 'include',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children'
params = {
'page': '1',
'size': '10',
'reactions': 'exclude',
'children': 'exclude',
'description': 'include',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"page": "1",
"size": "10",
"reactions": "exclude",
"children": "exclude",
"description": "include",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/ca457162-6d04-4c3a-a3f6-2ab3e21b0fd00cca6914-5e72-4d54-b9db-fcf9/items/oak-table/children';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'page': '1',
'size': '10',
'reactions': 'exclude',
'children': 'exclude',
'description': 'include',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/items?page=1",
"last": "https://garchi.co.uk/api/v2/items?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/items?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 1,
"total": 1
}
}
Example response (404):
{
"error": "Item not found"
}
Received response:
Request failed with error:
requires authentication
This api is used to get the asset (media file) for a space based on the name of the asset.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/space/assets/logo?space_uid=635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.headless.getAsset("logo", "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1"); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->headless->getAsset('logo', '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1'); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/assets/logo'
params = {
'space_uid': '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/assets/logo";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/assets/logo';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'space_uid': '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
"asset_id": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa",
"name": "logo",
"path": "https://assets.garchi.co.uk/headlessweb/11111111-1111-4111-8111-11111111111122222222-2222-4222-8222-222/logo-1700000000.jpg",
"size": "157.08KB",
"type": "uploaded-image",
"agent_description": "This is agent description"
}
Received response:
Request failed with error:
requires authentication
This api is used to get a page by slug and space_uid.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/page" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"space_uid\": \"635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1\",
\"slug\": \"\\/\",
\"lang\": \"en-US\",
\"mode\": \"draft\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.headless.getPage({
space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
slug: "/",
lang: "en-US",
mode: "draft",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->headless->getPage([
'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
'slug' => '/',
'lang' => 'en-US',
'mode' => 'draft',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/page'
payload = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"slug": "\/",
"lang": "en-US",
"mode": "draft"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/page";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"slug": "\/",
"lang": "en-US",
"mode": "draft"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/page';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"space_uid": "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
"slug": "\/",
"lang": "en-US",
"mode": "draft"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"id": "55555555-5555-4555-8555-555555555555",
"title": "Home",
"slug": "/",
"description": "a great space to be",
"json_ld": "{\"@context\":\"https://schema.org\",\"@type\":\"WebPage\",\"name\":\"Home\"}",
"agent_description": "The home page. It introduces the brand and links to the main sections.",
"image": "https://assets.garchi.co.uk/headlesswebpages/33333333-3333-4333-8333-33333333333344444444-4444-4444-8444-444/some_file.png",
"sections": [
{
"id": "99c21f3c-c434-4eb5-89ad-46e958a11081",
"name": "Card",
"description": "",
"agent_description": "A card with a title, description and image.",
"props": {
"title": "This is great",
"description": "Thanks for telling this",
"image": "https://assets.garchi.co.uk/headlessweb/33333333-3333-4333-8333-33333333333344444444-4444-4444-8444-444/header-image-1700000001",
"data-garchi-section-id": "99c21f3c-c434-4eb5-89ad-46e958a11081",
"data-garchi-page-id": "55555555-5555-4555-8555-555555555555"
},
"children": [],
"order": 0
},
{
"id": "99c210e4-330d-458f-9af3-b5eea6af228d",
"name": "Navbar",
"description": "/components/Navbar",
"agent_description": null,
"props": {
"title": "Home",
"link": "https://google.com",
"data-garchi-section-id": "99c210e4-330d-458f-9af3-b5eea6af228d",
"data-garchi-page-id": "55555555-5555-4555-8555-555555555555"
},
"children": [
{
"id": "99c3f4f6-7193-471e-a9c0-00ebca35811f",
"name": "Logo",
"description": "Main logo for the home page",
"agent_description": null,
"props": {
"src": "https://assets.garchi.co.uk/headlessweb/33333333-3333-4333-8333-33333333333344444444-4444-4444-8444-444/logo-1700000002",
"data-garchi-section-id": "99c3f4f6-7193-471e-a9c0-00ebca35811f",
"data-garchi-page-id": "55555555-5555-4555-8555-555555555555"
},
"children": [],
"order": 0
}
],
"order": 1
}
],
"created_at": "2026-01-28T18:27:52.000000Z",
"last_updated": "2026-01-28T18:27:52.000000Z"
}
Received response:
Request failed with error:
requires authentication
This api is used to create or update section templates for a space. Section templates are used to create reusable sections on a page.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/section_template" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"space_uid\": \"5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e\",
\"section_templates\": [
{
\"name\": \"HeroSection\",
\"description\": \"This is a hero section.\",
\"prev_name\": null,
\"props\": [
{
\"key\": \"icon\",
\"type\": \"select\",
\"allowed_values\": \"CheckIcon,CheckCircleIcon\"
}
]
}
]
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.headless.createOrUpdateSectionTemplates({
space_uid: "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
section_templates: [
{
name: "HeroSection",
description: "This is a hero section.",
prev_name: null,
props: [
{
key: "icon",
type: "select",
allowed_values: "CheckIcon,CheckCircleIcon",
}
],
}
],
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->headless->createOrUpdateSectionTemplates([
'space_uid' => '5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e',
'section_templates' => [
[
'name' => 'HeroSection',
'description' => 'This is a hero section.',
'prev_name' => null,
'props' => [
[
'key' => 'icon',
'type' => 'select',
'allowed_values' => 'CheckIcon,CheckCircleIcon',
],
],
],
],
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/section_template'
payload = {
"space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
"section_templates": [
{
"name": "HeroSection",
"description": "This is a hero section.",
"prev_name": null,
"props": [
{
"key": "icon",
"type": "select",
"allowed_values": "CheckIcon,CheckCircleIcon"
}
]
}
]
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/section_template";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
"section_templates": [
{
"name": "HeroSection",
"description": "This is a hero section.",
"prev_name": null,
"props": [
{
"key": "icon",
"type": "select",
"allowed_values": "CheckIcon,CheckCircleIcon"
}
]
}
]
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/section_template';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"space_uid": "5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e",
"section_templates": [
{
"name": "HeroSection",
"description": "This is a hero section.",
"prev_name": null,
"props": [
{
"key": "icon",
"type": "select",
"allowed_values": "CheckIcon,CheckCircleIcon"
}
]
}
]
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"message": "Section templates updated successfully"
}
Received response:
Request failed with error:
requires authentication
This api is used to add a blank section to a page.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/page/add_blank_section" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"page_id\": \"019c05ef-4c27-719f-91b4-798de1d47a27\",
\"section_template_id\": \"99999999-9999-4999-8999-999999999999\",
\"parent_id\": \"019c05f0-fe11-7252-acdf-b8b2de361841\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.headless.addBlankSectionToPage({
page_id: "019c05ef-4c27-719f-91b4-798de1d47a27",
section_template_id: "99999999-9999-4999-8999-999999999999",
parent_id: "019c05f0-fe11-7252-acdf-b8b2de361841",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->headless->addBlankSectionToPage([
'page_id' => '019c05ef-4c27-719f-91b4-798de1d47a27',
'section_template_id' => '99999999-9999-4999-8999-999999999999',
'parent_id' => '019c05f0-fe11-7252-acdf-b8b2de361841',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/page/add_blank_section'
payload = {
"page_id": "019c05ef-4c27-719f-91b4-798de1d47a27",
"section_template_id": "99999999-9999-4999-8999-999999999999",
"parent_id": "019c05f0-fe11-7252-acdf-b8b2de361841"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/page/add_blank_section";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"page_id": "019c05ef-4c27-719f-91b4-798de1d47a27",
"section_template_id": "99999999-9999-4999-8999-999999999999",
"parent_id": "019c05f0-fe11-7252-acdf-b8b2de361841"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/page/add_blank_section';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"page_id": "019c05ef-4c27-719f-91b4-798de1d47a27",
"section_template_id": "99999999-9999-4999-8999-999999999999",
"parent_id": "019c05f0-fe11-7252-acdf-b8b2de361841"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"id": "019c0618-798d-731a-8a7b-9af92c98155d",
"name": "TwoColumnWithImage",
"description": "layout/TwoColumnWithImage",
"parent_id": null,
"order": 1,
"page_id": "019c0617-6ea4-72a5-9c97-4bffe1c4a2c9",
"section_template_id": "99999999-9999-4999-8999-999999999999"
}
Received response:
Request failed with error:
requires authentication
This api is used to create a headless page in a space.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"title\": \"Home\",
\"description\": \"This is the home\",
\"json_ld\": \"nisi\",
\"path\": \"\\/\",
\"agent_description\": \"This page introduces the brand and should help AI agents understand its purpose.\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.headless.addPage({
space_uid: "635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1",
title: "Home",
description: "This is the home",
json_ld: "nisi",
path: "/",
agent_description: "This page introduces the brand and should help AI agents understand its purpose.",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->headless->addPage([
'space_uid' => '635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1',
'title' => 'Home',
'description' => 'This is the home',
'json_ld' => 'nisi',
'path' => '/',
'agent_description' => 'This page introduces the brand and should help AI agents understand its purpose.',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page'
payload = {
"title": "Home",
"description": "This is the home",
"json_ld": "nisi",
"path": "\/",
"agent_description": "This page introduces the brand and should help AI agents understand its purpose."
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"title": "Home",
"description": "This is the home",
"json_ld": "nisi",
"path": "\/",
"agent_description": "This page introduces the brand and should help AI agents understand its purpose."
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/635c09ed-d55f-407d-a4c0-45f5ad9f2b44c2321f02-a835-4024-9b83-c4a1/create_page';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"title": "Home",
"description": "This is the home",
"json_ld": "nisi",
"path": "\/",
"agent_description": "This page introduces the brand and should help AI agents understand its purpose."
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"id": "019c05dc-a705-702b-a203-0017f28066a5",
"title": "Example page",
"slug": "/example-page",
"description": "This is an example page",
"json_ld": null,
"agent_description": "This is an example page",
"image": null,
"sections": [],
"created_at": "2026-01-28T18:27:52.000000Z",
"last_updated": "2026-01-28T18:27:52.000000Z"
}
Example response (Plan allowance reached):
{
"message": "Page limit reached. This space has 3 of the 3 pages allowed per space on the Sandbox plan. Requests to add more will be refused until this space is below its limit of 3 pages.",
"errors": {
"limit": [
"Page limit reached. This space has 3 of the 3 pages allowed per space on the Sandbox plan. Requests to add more will be refused until this space is below its limit of 3 pages."
]
},
"plan_limit": {
"feature": "pages",
"scope": "space",
"period": null,
"unit": "count",
"used": 3,
"limit": 3,
"plan": "Sandbox",
"period_ends_on": null,
"starter_content_counts": false
}
}
Received response:
Request failed with error:
requires authentication
This api is used to list pages in a space.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/space/nobis/pages" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.space.listPages("nobis"); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->space->listPages('nobis'); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/nobis/pages'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/nobis/pages";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/nobis/pages';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
[
{
"id": "66666666-6666-4666-8666-666666666666",
"title": "Pricing",
"slug": "/pricing",
"description": "Generate amazing social media content from your video",
"json_ld": null,
"agent_description": null,
"image": null,
"sections": [
{
"id": "77777777-7777-4777-8777-777777777777",
"page_id": "66666666-6666-4666-8666-666666666666",
"section_template_id": "99999999-9999-4999-8999-999999999999",
"parent_id": null,
"order": 0,
"createdBy": 186,
"lastUpdatedBy": 186,
"created_at": "2025-02-26T21:40:10.000000Z",
"updated_at": "2025-02-26T21:40:10.000000Z",
"deleted_at": null
}
],
"created_at": "2025-02-26T21:39:49.000000Z",
"last_updated": "2025-07-25T19:08:57.000000Z"
},
{
"id": "88888888-8888-4888-8888-888888888888",
"title": "Privacy policy",
"slug": "/privacy_policy",
"description": "Privacy policy",
"json_ld": null,
"agent_description": null,
"image": null,
"sections": [],
"created_at": "2025-02-26T21:39:49.000000Z",
"last_updated": "2025-07-25T19:08:57.000000Z"
}
]
Received response:
Request failed with error:
requires authentication
This api is used to list section templates for a space. Section templates are used to create reusable sections on a page.
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.space.listSectionTemplates("5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e"); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->space->listSectionTemplates('5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e'); import requests
import json
url = 'https://garchi.co.uk/api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates'
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/space/5f0b3b2d-3b4e-4b6e-8b3e-3e3e3e3e3e3e/section_templates';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
[
{
"name": "TwoColumnWithImage",
"description": "layout/TwoColumnWithImage",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "image",
"type": "media",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000100"
},
{
"key": "image_position",
"type": "select",
"allowed_values": "left,right",
"id": "019c0618-0000-7000-8000-000000000101"
},
{
"key": "description",
"type": "richtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000102"
},
{
"key": "is_video",
"type": "select",
"allowed_values": "yes,no",
"id": "019c0618-0000-7000-8000-000000000103"
},
{
"key": "title",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000104"
},
{
"key": "cta_text_2",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000105"
},
{
"key": "cta_link_2",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000106"
},
{
"key": "cta_text",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000107"
},
{
"key": "cta_link",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000108"
}
],
"id": "99999999-9999-4999-8999-000000000001"
},
{
"name": "FAQItem",
"description": "",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "answer",
"type": "longtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000200"
},
{
"key": "question",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000201"
}
],
"id": "99999999-9999-4999-8999-000000000002"
},
{
"name": "PricingCard",
"description": "garchi/PricingCard",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "features",
"type": "longtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000300"
},
{
"key": "isFeatured",
"type": "select",
"allowed_values": "yes,no",
"id": "019c0618-0000-7000-8000-000000000301"
},
{
"key": "price",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000302"
},
{
"key": "description",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000303"
},
{
"key": "index",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000304"
},
{
"key": "stripe_price_id",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000305"
},
{
"key": "cta_text",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000306"
},
{
"key": "name",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000307"
}
],
"id": "99999999-9999-4999-8999-000000000003"
},
{
"name": "Markdown",
"description": "Markdown",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "content",
"type": "richtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000400"
},
{
"key": "className",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000401"
}
],
"id": "99999999-9999-4999-8999-000000000004"
},
{
"name": "Feature",
"description": "garchi/Feature",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "icon",
"type": "icon_lucid",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000500"
},
{
"key": "title",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000501"
},
{
"key": "description",
"type": "longtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000502"
}
],
"id": "99999999-9999-4999-8999-000000000005"
},
{
"name": "Features",
"description": "garchi/Features",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "title",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000600"
},
{
"key": "subtitle",
"type": "longtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000601"
}
],
"id": "99999999-9999-4999-8999-000000000006"
},
{
"name": "YoutubeVideo",
"description": "garchi/YoutubeVideo",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "videoId",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000700"
},
{
"key": "style",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000701"
},
{
"key": "height",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000702"
},
{
"key": "width",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000703"
}
],
"id": "99999999-9999-4999-8999-000000000007"
},
{
"name": "Workflow",
"description": "garchi/Workflow",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "description",
"type": "longtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000800"
},
{
"key": "title",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000801"
},
{
"key": "cta_text",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000802"
}
],
"id": "99999999-9999-4999-8999-000000000008"
},
{
"name": "CTA",
"description": "garchi/CTA",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "ctaLink",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000900"
},
{
"key": "title",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000901"
},
{
"key": "description",
"type": "longtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000902"
},
{
"key": "ctaText",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000000903"
}
],
"id": "99999999-9999-4999-8999-000000000009"
},
{
"name": "Hero",
"description": "garchi/Hero",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "words",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000001000"
},
{
"key": "description",
"type": "longtext",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000001001"
},
{
"key": "ctaLink",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000001002"
},
{
"key": "title",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000001003"
},
{
"key": "ctaText",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000001004"
}
],
"id": "99999999-9999-4999-8999-000000000010"
},
{
"name": "FAQ",
"description": "ui/faq",
"agent_description": null,
"prev_name": "",
"props": [],
"id": "99999999-9999-4999-8999-000000000011"
},
{
"name": "Pricing",
"description": "garchi/Pricing",
"agent_description": null,
"prev_name": "",
"props": [
{
"key": "title",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000001200"
},
{
"key": "subheading",
"type": "text",
"allowed_values": "",
"id": "019c0618-0000-7000-8000-000000001201"
}
],
"id": "99999999-9999-4999-8999-000000000012"
}
]
Received response:
Request failed with error:
requires authentication
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/reviews/item" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"item_id\": 4,
\"rating\": 4,
\"review_body\": \"This is a best selling item.\",
\"user_email\": \"jane.doe@example.com\",
\"user_name\": \"Jane\",
\"parent_id\": 4
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.review.create({
item_id: 4,
rating: 4,
review_body: "This is a best selling item.",
user_email: "jane.doe@@example.com",
user_name: "Jane",
parent_id: 4,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->review->create([
'item_id' => 4,
'rating' => 4,
'review_body' => 'This is a best selling item.',
'user_email' => 'jane.doe@@example.com',
'user_name' => 'Jane',
'parent_id' => 4,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/reviews/item'
payload = {
"item_id": 4,
"rating": 4,
"review_body": "This is a best selling item.",
"user_email": "jane.doe@example.com",
"user_name": "Jane",
"parent_id": 4
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/item";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"item_id": 4,
"rating": 4,
"review_body": "This is a best selling item.",
"user_email": "jane.doe@example.com",
"user_name": "Jane",
"parent_id": 4
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/reviews/item';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"item_id": 4,
"rating": 4,
"review_body": "This is a best selling item.",
"user_email": "jane.doe@example.com",
"user_name": "Jane",
"parent_id": 4
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": {
"review_id": 15,
"review_body": "This is a best selling item",
"rating": 4,
"user": {
"name": "Jane",
"email": "jane.doe@@example.com"
},
"item_id": 15,
"reviewed_at": "2022-02-23T23:00:45.000000Z",
"parent": null
}
}
Received response:
Request failed with error:
requires authentication
Edits a review. Only provided fields will be updated rest will be ignored.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/reviews/edit" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"review_id\": 4,
\"review_body\": \"This is an amazing seller.\",
\"rating\": 4
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.review.update({
review_id: 4,
review_body: "This is an amazing seller.",
rating: 4,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->review->update([
'review_id' => 4,
'review_body' => 'This is an amazing seller.',
'rating' => 4,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/reviews/edit'
payload = {
"review_id": 4,
"review_body": "This is an amazing seller.",
"rating": 4
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/edit";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"review_id": 4,
"review_body": "This is an amazing seller.",
"rating": 4
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/reviews/edit';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"review_id": 4,
"review_body": "This is an amazing seller.",
"rating": 4
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"message": "1 reviews updated"
}
Received response:
Request failed with error:
requires authentication
Permenantly deletes a specific review.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/reviews/delete" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"review_id\": 11
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.review.delete(11); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->review->delete(11); import requests
import json
url = 'https://garchi.co.uk/api/v2/reviews/delete'
payload = {
"review_id": 11
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/delete";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"review_id": 11
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/reviews/delete';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"review_id": 11
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"message": "1 reviews deleted"
}
Received response:
Request failed with error:
requires authentication
Returns the reviews for an item
Example request:
curl --request GET \
--get "https://garchi.co.uk/api/v2/reviews/item/15?size=10" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" // npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.review.getByItem("15", {
size: 10,
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->review->getByItem('15', [
'size' => 10,
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/reviews/item/15'
params = {
'size': '10',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/reviews/item/15";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
Map<Object, Object> params = {
"size": "10",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/reviews/item/15';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}'
]
$client = Http::withHeaders($headers);
$queryParams = {
'size': '10',
};
$url .= '?'. $queryParams;
$response = $client->GET($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"review_id": 15,
"review_body": "This is a best selling item",
"rating": 4,
"user": {
"name": "Jane",
"email": "jane.doe@@example.com"
},
"item_id": 15,
"reviewed_at": "2022-02-23T23:00:45.000000Z",
"parent": null,
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"replies": [
{
"review_id": 16,
"review_body": "Thanks for the feedback!",
"rating": 5,
"user": {
"name": "Garchi Support",
"email": "support@@example.com"
},
"item_id": 15,
"reviewed_at": "2022-02-24T09:12:10.000000Z",
"parent": 15,
"reactions": [],
"replies": []
}
]
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/reviews/item/15?page=1",
"last": "https://garchi.co.uk/api/v2/reviews/item/15?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/reviews/item/15?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/reviews/item/15",
"per_page": 5,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
requires authentication
Compound query is useful when you want to fetch data using complex filters. It is advisable to use compound query only in limited cases as it involves querying using multiple conditions which can be slow.
You need to provide the dataset to query, the fields to query, the conditions for the fields, the values for the conditions and the logic whether to perform logical and/or of the conditions.
Field restriction varies based on the dataset.
Allowed fields for items [item_id, name, slug, description, categories, ratings, price, created, published]
Allowed fields for categories [category_id, category_name]
Allowed fields for reviews [review_id, item_id, rating, review, created]
You can have duplicate fields in the fields array.
The response schema depends on the dataset. Depending on the dataset the response schema will be as follows:
items: list all items api .
reviews: get reviews for an item api .
categories: get all categories api .
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/compound_query?order_key=created&order_by=desc" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"dataset\": \"items\",
\"fields\": [
\"name\",
\"price\"
],
\"conditions\": [
\"eq\",
\"lte\"
],
\"values\": [
\"Apple\",
100
],
\"logic\": \"[\\\"and\\\"]\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.compoundQuery.query({
dataset: "items",
fields: ["name", "price"],
conditions: ["eq", "lte"],
values: ["Apple", 100],
logic: ["and"],
}, {
order_key: "created",
order_by: "desc",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->compoundQuery->query([
'dataset' => 'items',
'fields' => ['name', 'price'],
'conditions' => ['eq', 'lte'],
'values' => ['Apple', 100],
'logic' => ['and'],
], [
'order_key' => 'created',
'order_by' => 'desc',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/compound_query'
payload = {
"dataset": "items",
"fields": [
"name",
"price"
],
"conditions": [
"eq",
"lte"
],
"values": [
"Apple",
100
],
"logic": "[\"and\"]"
}
params = {
'order_key': 'created',
'order_by': 'desc',
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload, params=params)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/compound_query";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"dataset": "items",
"fields": [
"name",
"price"
],
"conditions": [
"eq",
"lte"
],
"values": [
"Apple",
100
],
"logic": "[\"and\"]"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
Map<Object, Object> params = {
"order_key": "created",
"order_by": "desc",
};
builder.uri(URI.create(url + "?" + toQueryString(params)));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/compound_query';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"dataset": "items",
"fields": [
"name",
"price"
],
"conditions": [
"eq",
"lte"
],
"values": [
"Apple",
100
],
"logic": "[\"and\"]"
};
$client->withBody($body);
$queryParams = {
'order_key': 'created',
'order_by': 'desc',
};
$url .= '?'. $queryParams;
$response = $client->POST($url);
$responseBody = $response->json(); Example response (200):
{
"data": [
{
"item_id": 26,
"sku": "WD-101",
"external_link": "",
"slug": "example-product",
"parent_id": null,
"children_count": 0,
"name": "Example Product",
"stock": 100,
"price": 40,
"scratched_price": null,
"one_liner": "Best book for beginners",
"description": "<p><strong>This book is fantastic</strong></p>\n<ol>\n<li>This</li>\n<li>Book</li>\n<li>is</li>\n<li>Fantastic</li>\n</ol>",
"categories": [
{
"id": 22,
"name": "Web Development Bootcamp",
"rank": null
}
],
"delivery_type": "can_deliver",
"main_image": "https://assets.garchi.co.uk/examples/product-main.png",
"other_images": [
"https://assets.garchi.co.uk/examples/product-1.png",
"https://assets.garchi.co.uk/examples/product-2.png"
],
"attributes": [
{
"id": 16,
"name": "Book Cover",
"min": "1",
"options": [
{
"id": 29,
"sku": "WD-101-PAPER",
"name": "Paper",
"price": 0.5
},
{
"id": 30,
"sku": "WD-101-BOUND",
"name": "Binded",
"price": 1
}
]
}
],
"space": {
"uid": "b5f0d08a-7600-4b9e-81e9-1ffaf5ddb8d2cf268eeb-000a-4bfd-bba6-09ab",
"name": "Books"
},
"avg_rating": null,
"scheduled_for": null,
"item_meta": [
{
"id": 11,
"key": "website",
"value": "https://example.com",
"type": "url"
}
],
"reactions": [
{
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
],
"agent_description": "A beginner-friendly book that teaches web development step by step.",
"created": "2022-11-06 20:52:39",
"updated": "2023-07-08 15:09:16"
}
],
"links": {
"first": "https://garchi.co.uk/api/v2/items?page=1",
"last": "https://garchi.co.uk/api/v2/items?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://garchi.co.uk/api/v2/items?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://garchi.co.uk/api/v2/items",
"per_page": 10,
"to": 1,
"total": 1
}
}
Received response:
Request failed with error:
requires authentication
Creates a reaction for review, item. If the reaction already exists it will be deleted and a new one will be added.
Example request:
curl --request POST \
"https://garchi.co.uk/api/v2/manage-reaction" \
--header "Authorization: Bearer {YOUR_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{
\"reaction\": \"like\",
\"user_identifier\": \"jane.doe@example.com\",
\"review_id\": 4,
\"item_id\": 4,
\"reaction_for\": \"review\"
}"
// npm install @garchicms/garchi-node-sdk
import GarchiCMS from "@garchicms/garchi-node-sdk";
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
const garchi = new GarchiCMS({ api_key: "YOUR_API_TOKEN" });
const response = await garchi.reaction.manage({
reaction: "like",
user_identifier: "jane.doe@@example.com",
review_id: 4,
item_id: 4,
reaction_for: "review",
}); // composer require garchicms/garchi-sdk-php
use GarchiCMS\GarchiCMS;
// The SDK sends your API token as "Authorization: Bearer <token>" on every request.
$garchi = new GarchiCMS("YOUR_API_TOKEN");
$response = $garchi->reaction->manage([
'reaction' => 'like',
'user_identifier' => 'jane.doe@@example.com',
'review_id' => 4,
'item_id' => 4,
'reaction_for' => 'review',
]); import requests
import json
url = 'https://garchi.co.uk/api/v2/manage-reaction'
payload = {
"reaction": "like",
"user_identifier": "jane.doe@example.com",
"review_id": 4,
"item_id": 4,
"reaction_for": "review"
}
headers = {
'Authorization': 'Bearer {YOUR_API_TOKEN}',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json() import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
String baseUrl = "https://garchi.co.uk";
String endpointUri = "api/v2/manage-reaction";
URI url = URI.create(baseUrl + endpointUri);
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder(url);
String body = {
"reaction": "like",
"user_identifier": "jane.doe@example.com",
"review_id": 4,
"item_id": 4,
"reaction_for": "review"
};
builder.POST(HttpRequest.BodyPublishers.ofString(body));
builder.header("Authorization", "Bearer {YOUR_API_TOKEN}");
builder.header("Content-Type", "application/json");
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
// Parse JSON response
JSONObject json = new JSONObject(response.body());
use Illuminate\Support\Facades\Http;
$url = 'https://garchi.co.uk/api/v2/manage-reaction';
$headers = [
'Authorization' => 'Bearer {YOUR_API_TOKEN}',
'Content-Type' => 'application/json'
]
$client = Http::withHeaders($headers);
$body = {
"reaction": "like",
"user_identifier": "jane.doe@example.com",
"review_id": 4,
"item_id": 4,
"reaction_for": "review"
};
$client->withBody($body);
$response = $client->POST($url);
$responseBody = $response->json(); Example response (Existing reaction removed):
{
"message": "Reaction deleted"
}
Example response (200):
{
"data": {
"reaction_id": "9b08ce6c-350c-4f00-9858-37a866bd626f",
"reaction": "like",
"user_identifier": "jane.doe@@example.com",
"created_at": "2024-01-07T09:54:12.000000Z",
"updated_at": "2024-01-07T09:54:12.000000Z"
}
}
Received response:
Request failed with error: