カテゴリのインポート
Product Recommendation API を使用して商品をインポートする前に、商品カテゴリ階層全体を Kameleoon にインポートします。
curl --request POST \
--url https://api.products.kameleoon.com/import/categories \
--header 'Content-Type: application/json' \
--data '
{
"shop_id": "eehj3eu84299kg5ghw5a6743r8",
"shop_secret": "pmd5362597thrgq8k256ep01t0",
"categories": [
{
"id": "footwearID",
"name": "footwear",
"url": "https://example.com/footwear",
"alias": "kicks"
},
{
"id": "shoesID",
"name": "shoes",
"parent": "footwearID"
},
{
"id": "bootsID",
"name": "boots",
"parent": "footwearID"
}
]
}
'import requests
url = "https://api.products.kameleoon.com/import/categories"
payload = {
"shop_id": "eehj3eu84299kg5ghw5a6743r8",
"shop_secret": "pmd5362597thrgq8k256ep01t0",
"categories": [
{
"id": "footwearID",
"name": "footwear",
"url": "https://example.com/footwear",
"alias": "kicks"
},
{
"id": "shoesID",
"name": "shoes",
"parent": "footwearID"
},
{
"id": "bootsID",
"name": "boots",
"parent": "footwearID"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
shop_id: 'eehj3eu84299kg5ghw5a6743r8',
shop_secret: 'pmd5362597thrgq8k256ep01t0',
categories: [
{
id: 'footwearID',
name: 'footwear',
url: 'https://example.com/footwear',
alias: 'kicks'
},
{id: 'shoesID', name: 'shoes', parent: 'footwearID'},
{id: 'bootsID', name: 'boots', parent: 'footwearID'}
]
})
};
fetch('https://api.products.kameleoon.com/import/categories', 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.products.kameleoon.com/import/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'shop_id' => 'eehj3eu84299kg5ghw5a6743r8',
'shop_secret' => 'pmd5362597thrgq8k256ep01t0',
'categories' => [
[
'id' => 'footwearID',
'name' => 'footwear',
'url' => 'https://example.com/footwear',
'alias' => 'kicks'
],
[
'id' => 'shoesID',
'name' => 'shoes',
'parent' => 'footwearID'
],
[
'id' => 'bootsID',
'name' => 'boots',
'parent' => 'footwearID'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.products.kameleoon.com/import/categories"
payload := strings.NewReader("{\n \"shop_id\": \"eehj3eu84299kg5ghw5a6743r8\",\n \"shop_secret\": \"pmd5362597thrgq8k256ep01t0\",\n \"categories\": [\n {\n \"id\": \"footwearID\",\n \"name\": \"footwear\",\n \"url\": \"https://example.com/footwear\",\n \"alias\": \"kicks\"\n },\n {\n \"id\": \"shoesID\",\n \"name\": \"shoes\",\n \"parent\": \"footwearID\"\n },\n {\n \"id\": \"bootsID\",\n \"name\": \"boots\",\n \"parent\": \"footwearID\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.products.kameleoon.com/import/categories")
.header("Content-Type", "application/json")
.body("{\n \"shop_id\": \"eehj3eu84299kg5ghw5a6743r8\",\n \"shop_secret\": \"pmd5362597thrgq8k256ep01t0\",\n \"categories\": [\n {\n \"id\": \"footwearID\",\n \"name\": \"footwear\",\n \"url\": \"https://example.com/footwear\",\n \"alias\": \"kicks\"\n },\n {\n \"id\": \"shoesID\",\n \"name\": \"shoes\",\n \"parent\": \"footwearID\"\n },\n {\n \"id\": \"bootsID\",\n \"name\": \"boots\",\n \"parent\": \"footwearID\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.products.kameleoon.com/import/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"shop_id\": \"eehj3eu84299kg5ghw5a6743r8\",\n \"shop_secret\": \"pmd5362597thrgq8k256ep01t0\",\n \"categories\": [\n {\n \"id\": \"footwearID\",\n \"name\": \"footwear\",\n \"url\": \"https://example.com/footwear\",\n \"alias\": \"kicks\"\n },\n {\n \"id\": \"shoesID\",\n \"name\": \"shoes\",\n \"parent\": \"footwearID\"\n },\n {\n \"id\": \"bootsID\",\n \"name\": \"boots\",\n \"parent\": \"footwearID\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success"
}{
"status": "error",
"message": "Incorrect shop credentials"
}クエリパラメーターのリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
shop_id | String | Yes | ストアキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
shop_secret | String | Yes | シークレットキー。Kameleoon アプリの Recommendations > Settings > Store settings で確認できます。キーについては、カスタマーサクセスマネージャーにもお問い合わせいただけます。 |
categories | List | Yes | カテゴリオブジェクトのリスト。categories に必要なパラメーターはこの表を参照してください。 |
webhook | String | No | Webhook URL。インポート完了時に POST リクエストが送信されます。 |
webhook は、リクエストが完了したことを開発者に通知するために使用されます。API 呼び出しで指定されたすべてのカテゴリがインポートされ完全に利用可能になると、指定された Webhook に POST リクエストが送信されます。カテゴリを Kameleoon で処理するのに数分かかることがあるため、多数のカテゴリをインポートする場合は webhook の使用を強く推奨します。商品インポートエンドポイントを使用して商品をインポートしている場合、Webhook を使用することで、商品インポートを開始する前にすべてのカテゴリが完全に処理されたことを保証できます。カテゴリは最初に Kameleoon で処理する必要があるため、既知のカテゴリがない商品はインポート中に無視されます。成功したリクエストの例:{
"status": "success"
}
{
"status": "error",
"message": "MESSAGE"
}
categories オブジェクトのパラメーターリスト
| パラメーター | 型 | 必須 | 説明 |
|---|---|---|---|
id | String | Yes | カテゴリに割り当てられた一意の ID |
name | String | Yes | カテゴリの名前 |
parent | String/NULL | Optional | カテゴリが階層構造の場合、このフィールドにはこのカテゴリの親を定義します |
url | String | Optional | カテゴリに関連付ける URL |
alias | String | Optional | カテゴリのエイリアス |
JSON リクエスト例
{
"shop_id": "eehj3eu84299kg5ghw5a6743r8",
"shop_secret": "pmd5362597thrgq8k256ep01t0",
"categories": [
{
"id": "footwearID",
"name": "footwear",
"url": "https://example.com/footwear",
"alias": "kicks"
},
{
"id": "shoesID",
"name": "shoes",
"parent": "footwearID"
},
{
"id": "bootsID",
"name": "boots",
"parent": "footwearID"
}
]
}
ボディ
Store Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary.
Secret Key. Find this in Recommendations > Settings > Store settings in the Kameleoon app. Contact your Customer Success Manager for the key if necessary.
A list of category objects.
Show child attributes
Show child attributes
The webhook URL where a POST request is sent upon completion of the import. Recommended for large imports, since processing can take several minutes.
レスポンス
Import accepted. Verified against a live response on 2026-09-24: this endpoint returns an empty 204 response on success, not a JSON body — the {"status": "success"} shape only applies to the asynchronous webhook callback payload, if a webhook was provided.
Request outcome.
success このページは役に立ちましたか?
curl --request POST \
--url https://api.products.kameleoon.com/import/categories \
--header 'Content-Type: application/json' \
--data '
{
"shop_id": "eehj3eu84299kg5ghw5a6743r8",
"shop_secret": "pmd5362597thrgq8k256ep01t0",
"categories": [
{
"id": "footwearID",
"name": "footwear",
"url": "https://example.com/footwear",
"alias": "kicks"
},
{
"id": "shoesID",
"name": "shoes",
"parent": "footwearID"
},
{
"id": "bootsID",
"name": "boots",
"parent": "footwearID"
}
]
}
'import requests
url = "https://api.products.kameleoon.com/import/categories"
payload = {
"shop_id": "eehj3eu84299kg5ghw5a6743r8",
"shop_secret": "pmd5362597thrgq8k256ep01t0",
"categories": [
{
"id": "footwearID",
"name": "footwear",
"url": "https://example.com/footwear",
"alias": "kicks"
},
{
"id": "shoesID",
"name": "shoes",
"parent": "footwearID"
},
{
"id": "bootsID",
"name": "boots",
"parent": "footwearID"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
shop_id: 'eehj3eu84299kg5ghw5a6743r8',
shop_secret: 'pmd5362597thrgq8k256ep01t0',
categories: [
{
id: 'footwearID',
name: 'footwear',
url: 'https://example.com/footwear',
alias: 'kicks'
},
{id: 'shoesID', name: 'shoes', parent: 'footwearID'},
{id: 'bootsID', name: 'boots', parent: 'footwearID'}
]
})
};
fetch('https://api.products.kameleoon.com/import/categories', 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.products.kameleoon.com/import/categories",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'shop_id' => 'eehj3eu84299kg5ghw5a6743r8',
'shop_secret' => 'pmd5362597thrgq8k256ep01t0',
'categories' => [
[
'id' => 'footwearID',
'name' => 'footwear',
'url' => 'https://example.com/footwear',
'alias' => 'kicks'
],
[
'id' => 'shoesID',
'name' => 'shoes',
'parent' => 'footwearID'
],
[
'id' => 'bootsID',
'name' => 'boots',
'parent' => 'footwearID'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.products.kameleoon.com/import/categories"
payload := strings.NewReader("{\n \"shop_id\": \"eehj3eu84299kg5ghw5a6743r8\",\n \"shop_secret\": \"pmd5362597thrgq8k256ep01t0\",\n \"categories\": [\n {\n \"id\": \"footwearID\",\n \"name\": \"footwear\",\n \"url\": \"https://example.com/footwear\",\n \"alias\": \"kicks\"\n },\n {\n \"id\": \"shoesID\",\n \"name\": \"shoes\",\n \"parent\": \"footwearID\"\n },\n {\n \"id\": \"bootsID\",\n \"name\": \"boots\",\n \"parent\": \"footwearID\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.products.kameleoon.com/import/categories")
.header("Content-Type", "application/json")
.body("{\n \"shop_id\": \"eehj3eu84299kg5ghw5a6743r8\",\n \"shop_secret\": \"pmd5362597thrgq8k256ep01t0\",\n \"categories\": [\n {\n \"id\": \"footwearID\",\n \"name\": \"footwear\",\n \"url\": \"https://example.com/footwear\",\n \"alias\": \"kicks\"\n },\n {\n \"id\": \"shoesID\",\n \"name\": \"shoes\",\n \"parent\": \"footwearID\"\n },\n {\n \"id\": \"bootsID\",\n \"name\": \"boots\",\n \"parent\": \"footwearID\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.products.kameleoon.com/import/categories")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"shop_id\": \"eehj3eu84299kg5ghw5a6743r8\",\n \"shop_secret\": \"pmd5362597thrgq8k256ep01t0\",\n \"categories\": [\n {\n \"id\": \"footwearID\",\n \"name\": \"footwear\",\n \"url\": \"https://example.com/footwear\",\n \"alias\": \"kicks\"\n },\n {\n \"id\": \"shoesID\",\n \"name\": \"shoes\",\n \"parent\": \"footwearID\"\n },\n {\n \"id\": \"bootsID\",\n \"name\": \"boots\",\n \"parent\": \"footwearID\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success"
}{
"status": "error",
"message": "Incorrect shop credentials"
}