curl -sS -X PUT 'https://apis.lucela.kr/v1/direct/listings/2f6c1d8e-4b3a-4e5f-9a7c-1d2e3f4a5b6c/product-content' \
-H "X-Lucela-API-Key: $LUCELA_API_KEY" \
-H "Authorization: Bearer $LUCELA_DIRECT_TOKEN" \
-H 'If-Match: "r1.v1"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"schemaVersion":"1.0.0","detailBlocks":[{"kind":"TEXT","text":"원목 상판 · 철제 다리 · 2019년 구매"}]}'
import os, uuid, requests
r = requests.request(
"PUT", "https://apis.lucela.kr/v1/direct/listings/2f6c1d8e-4b3a-4e5f-9a7c-1d2e3f4a5b6c/product-content",
headers={
"X-Lucela-API-Key": os.environ["LUCELA_API_KEY"],
"Authorization": "Bearer " + os.environ["LUCELA_DIRECT_TOKEN"],
"If-Match": '"r1.v1"',
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"schemaVersion": "1.0.0",
"detailBlocks": [
{
"kind": "TEXT",
"text": "원목 상판 · 철제 다리 · 2019년 구매",
},
],
},
timeout=20,
)
print(r.status_code, r.json())
const res = await fetch("https://apis.lucela.kr/v1/direct/listings/2f6c1d8e-4b3a-4e5f-9a7c-1d2e3f4a5b6c/product-content", {
method: "PUT",
headers: {
"X-Lucela-API-Key": process.env.LUCELA_API_KEY,
"Authorization": `Bearer ${process.env.LUCELA_DIRECT_TOKEN}`,
"If-Match": '"r1.v1"',
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"schemaVersion": "1.0.0",
"detailBlocks": [
{
"kind": "TEXT",
"text": "원목 상판 · 철제 다리 · 2019년 구매"
}
]
}),
});
console.log(res.status, await res.json());