Get Category
curl --request GET \
--url https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "ahEDqV5uhjj8",
"name": "Beers/Belgian",
"parentId": "CAT-434",
"path": "apparel_and_accessories.clothing.dresses",
"globalId": "CAT-12345",
"metadata": {
"description": "All drinks available in the marketplace.",
"globalName": "Beers",
"path": "Driks/Alcoholic/Beers",
"showInStore": true
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Catalog API
Get Category
Get a single category from the catalog.
GET
/
public
/
v1
/
catalog-search-service
/
catalogs
/
categories
/
{category_id}
Get Category
curl --request GET \
--url https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/catalog-search-service/catalogs/categories/{category_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "ahEDqV5uhjj8",
"name": "Beers/Belgian",
"parentId": "CAT-434",
"path": "apparel_and_accessories.clothing.dresses",
"globalId": "CAT-12345",
"metadata": {
"description": "All drinks available in the marketplace.",
"globalName": "Beers",
"path": "Driks/Alcoholic/Beers",
"showInStore": true
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Autorisierungen
Antwort
Successful Response
Categories provide a way to organize your catalog.
Products always belong to at least one category, but can belong to more. Categories can be organized into hierarchies.
A dot-separated string representing this category's location in the hierarchy. A child category's path is formed by appending its own identifier to its parent's path. For example, if 'clothing' has path 'apparel.clothing', its child 'dresses' would have path 'apparel.clothing.dresses'. Each segment may only contain A-Za-z0-9_.
Minimum string length:
1Pattern:
^[A-Za-z0-9_-]+(\.[A-Za-z0-9_-]+)*$Beispiel:
"apparel_and_accessories.clothing.dresses"
War diese Seite hilfreich?