Product Import API
POST https://admin.threekit.com/api/products/import
Creates new assets from the request body. Products are assets of type "item". If any of the requested assets already exist then the existing asset will be updated instead. As of now, we only support imports using a JSON file in the request.
REST Endpoint
POST https://admin.threekit.com/api/products/import?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
body | body | importReqBody | false | none |
Body Parameters
{
"sync": "string",
"files": {
"query": {
"id": "string",
"name": "string",
"metadata": [
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
]
},
"product": {
"name": "string",
"assetId": "string",
"asset": {
"assetId": "string",
"configuration": {},
"type": "string"
},
"type": "string",
"parentFolderId": "string",
"description": "string",
"keywords": [
"string"
],
"tags": [
"string"
],
"metadata": [
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
],
"attributes": [
{
"type": "Number",
"name": "Example Number Attribute",
"step": 1,
"lockToStep": false,
"defaultValue": 0
},
{
"type": "Pricing",
"name": "Pricing",
"values": [
{
"pricebook": "c072c414-a362-483f-87e8-a72957369f09",
"currencies": {
"INR": 0
}
}
],
"defaultValue": {}
},
{
"type": "Asset",
"name": "Example Asset Attribute",
"assetType": "item",
"values": [
"#exampletag",
{
"assetId": "d10bc0af-f675-4e3f-956a-2c61b7eff147"
}
],
"defaultValue": {
"assetId": ""
}
},
{
"type": "String",
"name": "Example String Attribute",
"values": [
"exampleval1",
"exampleval2"
]
}
],
"rules": [
[
{
"conditions": [
{
"attributeId": "string",
"attribute": "string",
"operator": "string",
"value": "string"
}
],
"actions": [
{
"type": "string",
"name": "string",
"label": "string",
"attribute": "string",
"attributeId": "string",
"visible": true
}
],
"name": "string"
}
]
]
}
}
}
Response Codes
{
"sync": "string",
"files": {
"query": {
"id": "string",
"name": "string",
"metadata": [
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
]
},
"product": {
"name": "string",
"assetId": "string",
"asset": {
"assetId": "string",
"configuration": {},
"type": "string"
},
"type": "string",
"parentFolderId": "string",
"description": "string",
"keywords": [
"string"
],
"tags": [
"string"
],
"metadata": [
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
],
"attributes": [
{
"type": "Number",
"name": "Example Number Attribute",
"step": 1,
"lockToStep": false,
"defaultValue": 0
},
{
"type": "Pricing",
"name": "Pricing",
"values": [
{
"pricebook": "c072c414-a362-483f-87e8-a72957369f09",
"currencies": {
"INR": 0
}
}
],
"defaultValue": {}
},
{
"type": "Asset",
"name": "Example Asset Attribute",
"assetType": "item",
"values": [
"#exampletag",
{
"assetId": "d10bc0af-f675-4e3f-956a-2c61b7eff147"
}
],
"defaultValue": {
"assetId": ""
}
},
{
"type": "String",
"name": "Example String Attribute",
"values": [
"exampleval1",
"exampleval2"
]
}
],
"rules": [
[
{
"conditions": [
{
"attributeId": "string",
"attribute": "string",
"operator": "string",
"value": "string"
}
],
"actions": [
{
"type": "string",
"name": "string",
"label": "string",
"attribute": "string",
"attributeId": "string",
"visible": true
}
],
"name": "string"
}
]
]
}
}
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | assets import success | None |
401 | Unauthorized | User is unauthorized to make the request | None |
422 | Unprocessable Entity | Format or information in imported file is not valid. | None |
Example Implementations
Code
CURL
curl --request POST \
--url 'https://admin.threekit.com/api/products/import?orgId=string' \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"sync":"string","files":{"query":{"id":"string","name":"string","metadata":[{"name":"string","defaultValue":"string","type":"string"}]},"product":{"name":"string","assetId":"string","asset":{"assetId":"string","configuration":{},"type":"string"},"type":"string","parentFolderId":"string","description":"string","keywords":["string"],"tags":["string"],"metadata":[{"name":"string","defaultValue":"string","type":"string"}],"attributes":[{"type":"Number","name":"Example Number Attribute","step":1,"lockToStep":false,"defaultValue":0},{"type":"Pricing","name":"Pricing","values":[{"pricebook":"c072c414-a362-483f-87e8-a72957369f09","currencies":{"INR":0}}],"defaultValue":{}},{"type":"Asset","name":"Example Asset Attribute","assetType":"item","values":["#exampletag",{"assetId":"d10bc0af-f675-4e3f-956a-2c61b7eff147"}],"defaultValue":{"assetId":""}},{"type":"String","name":"Example String Attribute","values":["exampleval1","exampleval2"]}],"rules":[[{"conditions":[{"attributeId":"string","attribute":"string","operator":"string","value":"string"}],"actions":[{"type":"string","name":"string","label":"string","attribute":"string","attributeId":"string","visible":true}],"name":"string"}]]}}}'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/import?orgId=string",
"headers": {
"content-type": "application/json",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
sync: 'string',
files: {
query: {
id: 'string',
name: 'string',
metadata: [ { name: 'string', defaultValue: 'string', type: 'string' } ]
},
product: {
name: 'string',
assetId: 'string',
asset: { assetId: 'string', configuration: {}, type: 'string' },
type: 'string',
parentFolderId: 'string',
description: 'string',
keywords: [ 'string' ],
tags: [ 'string' ],
metadata: [ { name: 'string', defaultValue: 'string', type: 'string' } ],
attributes: [
{
type: 'Number',
name: 'Example Number Attribute',
step: 1,
lockToStep: false,
defaultValue: 0
},
{
type: 'Pricing',
name: 'Pricing',
values: [
{
pricebook: 'c072c414-a362-483f-87e8-a72957369f09',
currencies: { INR: 0 }
}
],
defaultValue: {}
},
{
type: 'Asset',
name: 'Example Asset Attribute',
assetType: 'item',
values: [
'#exampletag',
{ assetId: 'd10bc0af-f675-4e3f-956a-2c61b7eff147' }
],
defaultValue: { assetId: '' }
},
{
type: 'String',
name: 'Example String Attribute',
values: [ 'exampleval1', 'exampleval2' ]
}
],
rules: [
[
{
conditions: [
{
attributeId: 'string',
attribute: 'string',
operator: 'string',
value: 'string'
}
],
actions: [
{
type: 'string',
name: 'string',
label: 'string',
attribute: 'string',
attributeId: 'string',
visible: true
}
],
name: 'string'
}
]
]
}
}
}));
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/import?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"sync\":\"string\",\"files\":{\"query\":{\"id\":\"string\",\"name\":\"string\",\"metadata\":[{\"name\":\"string\",\"defaultValue\":\"string\",\"type\":\"string\"}]},\"product\":{\"name\":\"string\",\"assetId\":\"string\",\"asset\":{\"assetId\":\"string\",\"configuration\":{},\"type\":\"string\"},\"type\":\"string\",\"parentFolderId\":\"string\",\"description\":\"string\",\"keywords\":[\"string\"],\"tags\":[\"string\"],\"metadata\":[{\"name\":\"string\",\"defaultValue\":\"string\",\"type\":\"string\"}],\"attributes\":[{\"type\":\"Number\",\"name\":\"Example Number Attribute\",\"step\":1,\"lockToStep\":false,\"defaultValue\":0},{\"type\":\"Pricing\",\"name\":\"Pricing\",\"values\":[{\"pricebook\":\"c072c414-a362-483f-87e8-a72957369f09\",\"currencies\":{\"INR\":0}}],\"defaultValue\":{}},{\"type\":\"Asset\",\"name\":\"Example Asset Attribute\",\"assetType\":\"item\",\"values\":[\"#exampletag\",{\"assetId\":\"d10bc0af-f675-4e3f-956a-2c61b7eff147\"}],\"defaultValue\":{\"assetId\":\"\"}},{\"type\":\"String\",\"name\":\"Example String Attribute\",\"values\":[\"exampleval1\",\"exampleval2\"]}],\"rules\":[[{\"conditions\":[{\"attributeId\":\"string\",\"attribute\":\"string\",\"operator\":\"string\",\"value\":\"string\"}],\"actions\":[{\"type\":\"string\",\"name\":\"string\",\"label\":\"string\",\"attribute\":\"string\",\"attributeId\":\"string\",\"visible\":true}],\"name\":\"string\"}]]}}}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"products": [
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"name": "ThreeKit Sofa",
"description": "The original ThreeKit sofa, now configurable!",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c",
"sku": {},
"keywords": [
"sofa",
"demo"
],
"categories": []
},
{
"id": "ae774d8d-095a-4374-b10a-dae909860597",
"name": "ThreeKit Table",
"description": "Motorized standing desk that comes in different sizes, tabletop, and leg styles.",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c",
"sku": {},
"keywords": [],
"categories": []
}
]
}
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "missing asset fields or format of fields are not valid",
"value": {
"error": {
"type": "product_data_invalid",
"message": "product data not valid on all products"
}
}
}
}
GET https://admin.threekit.com/api/products/export/:format
curl --request POST \
--url 'https://admin.threekit.com/api/products/import?orgId=string' \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"sync":"string","files":{"query":{"id":"string","name":"string","metadata":[{"name":"string","defaultValue":"string","type":"string"}]},"product":{"name":"string","assetId":"string","asset":{"assetId":"string","configuration":{},"type":"string"},"type":"string","parentFolderId":"string","description":"string","keywords":["string"],"tags":["string"],"metadata":[{"name":"string","defaultValue":"string","type":"string"}],"attributes":[{"type":"Number","name":"Example Number Attribute","step":1,"lockToStep":false,"defaultValue":0},{"type":"Pricing","name":"Pricing","values":[{"pricebook":"c072c414-a362-483f-87e8-a72957369f09","currencies":{"INR":0}}],"defaultValue":{}},{"type":"Asset","name":"Example Asset Attribute","assetType":"item","values":["#exampletag",{"assetId":"d10bc0af-f675-4e3f-956a-2c61b7eff147"}],"defaultValue":{"assetId":""}},{"type":"String","name":"Example String Attribute","values":["exampleval1","exampleval2"]}],"rules":[[{"conditions":[{"attributeId":"string","attribute":"string","operator":"string","value":"string"}],"actions":[{"type":"string","name":"string","label":"string","attribute":"string","attributeId":"string","visible":true}],"name":"string"}]]}}}'
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/import?orgId=string",
"headers": {
"content-type": "application/json",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
sync: 'string',
files: {
query: {
id: 'string',
name: 'string',
metadata: [ { name: 'string', defaultValue: 'string', type: 'string' } ]
},
product: {
name: 'string',
assetId: 'string',
asset: { assetId: 'string', configuration: {}, type: 'string' },
type: 'string',
parentFolderId: 'string',
description: 'string',
keywords: [ 'string' ],
tags: [ 'string' ],
metadata: [ { name: 'string', defaultValue: 'string', type: 'string' } ],
attributes: [
{
type: 'Number',
name: 'Example Number Attribute',
step: 1,
lockToStep: false,
defaultValue: 0
},
{
type: 'Pricing',
name: 'Pricing',
values: [
{
pricebook: 'c072c414-a362-483f-87e8-a72957369f09',
currencies: { INR: 0 }
}
],
defaultValue: {}
},
{
type: 'Asset',
name: 'Example Asset Attribute',
assetType: 'item',
values: [
'#exampletag',
{ assetId: 'd10bc0af-f675-4e3f-956a-2c61b7eff147' }
],
defaultValue: { assetId: '' }
},
{
type: 'String',
name: 'Example String Attribute',
values: [ 'exampleval1', 'exampleval2' ]
}
],
rules: [
[
{
conditions: [
{
attributeId: 'string',
attribute: 'string',
operator: 'string',
value: 'string'
}
],
actions: [
{
type: 'string',
name: 'string',
label: 'string',
attribute: 'string',
attributeId: 'string',
visible: true
}
],
name: 'string'
}
]
]
}
}
}));
req.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/import?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"sync\":\"string\",\"files\":{\"query\":{\"id\":\"string\",\"name\":\"string\",\"metadata\":[{\"name\":\"string\",\"defaultValue\":\"string\",\"type\":\"string\"}]},\"product\":{\"name\":\"string\",\"assetId\":\"string\",\"asset\":{\"assetId\":\"string\",\"configuration\":{},\"type\":\"string\"},\"type\":\"string\",\"parentFolderId\":\"string\",\"description\":\"string\",\"keywords\":[\"string\"],\"tags\":[\"string\"],\"metadata\":[{\"name\":\"string\",\"defaultValue\":\"string\",\"type\":\"string\"}],\"attributes\":[{\"type\":\"Number\",\"name\":\"Example Number Attribute\",\"step\":1,\"lockToStep\":false,\"defaultValue\":0},{\"type\":\"Pricing\",\"name\":\"Pricing\",\"values\":[{\"pricebook\":\"c072c414-a362-483f-87e8-a72957369f09\",\"currencies\":{\"INR\":0}}],\"defaultValue\":{}},{\"type\":\"Asset\",\"name\":\"Example Asset Attribute\",\"assetType\":\"item\",\"values\":[\"#exampletag\",{\"assetId\":\"d10bc0af-f675-4e3f-956a-2c61b7eff147\"}],\"defaultValue\":{\"assetId\":\"\"}},{\"type\":\"String\",\"name\":\"Example String Attribute\",\"values\":[\"exampleval1\",\"exampleval2\"]}],\"rules\":[[{\"conditions\":[{\"attributeId\":\"string\",\"attribute\":\"string\",\"operator\":\"string\",\"value\":\"string\"}],\"actions\":[{\"type\":\"string\",\"name\":\"string\",\"label\":\"string\",\"attribute\":\"string\",\"attributeId\":\"string\",\"visible\":true}],\"name\":\"string\"}]]}}}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"products": [
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"name": "ThreeKit Sofa",
"description": "The original ThreeKit sofa, now configurable!",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c",
"sku": {},
"keywords": [
"sofa",
"demo"
],
"categories": []
},
{
"id": "ae774d8d-095a-4374-b10a-dae909860597",
"name": "ThreeKit Table",
"description": "Motorized standing desk that comes in different sizes, tabletop, and leg styles.",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c",
"sku": {},
"keywords": [],
"categories": []
}
]
}
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "missing asset fields or format of fields are not valid",
"value": {
"error": {
"type": "product_data_invalid",
"message": "product data not valid on all products"
}
}
}
}
Exports assets belonging to the given organization. If no "type" parameter is provided, the default value is assumed to be "item". Thus the default behaviour of the API is to export the list of items in an organization. When tags or keywords are provided, only matching assets will be exported. Currently the only supported export format is JSON
REST Endpoint
GET https://admin.threekit.com/api/products/export/:format?orgId=[orgId]&tags=[tags]&keywords=[keywords]&type=[type]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
tags | query | string | false | Asset tags to search for |
keywords | query | string | false | Asset keywords to search for |
type | query | string | false | Specify the type of assets that need to be exported. If this parameter is not present, only the list of items will be exported. The supported values are item, model, material, texture, font, vector, scene. Multiple asset types can also be exported. |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Export assets successfully. | string |
401 | Unauthorized | User is unauthorized to make the request | None |
422 | Unprocessable Entity | An error occurred fetching the specified product(s). | None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/products/export/:format?orgId=string' \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/export/:format?orgId=string",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/export/:format?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
"string"
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "request to fetch product(s) not valid",
"value": {
"error": {
"type": "fetch_product_error",
"message": "failed to fetch product(s)"
}
}
}
}
GET https://admin.threekit.com/api/assets/export/:assetId
curl --request GET \
--url 'https://admin.threekit.com/api/products/export/:format?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/export/:format?orgId=string",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/export/:format?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
"string"
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "request to fetch product(s) not valid",
"value": {
"error": {
"type": "fetch_product_error",
"message": "failed to fetch product(s)"
}
}
}
}
Exports a single asset belonging to the given organization. AssetId given as part of the route. Currently the only supported export format is JSON so no format specification is necessary.
REST Endpoint
GET https://admin.threekit.com/api/assets/export/:assetId?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Export asset successfully. | string |
403 | Forbidden | Request is forbidden | None |
422 | Unprocessable Entity | An error occurred fetching the specified product(s). | None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/assets/export/:assetId?orgId=string' \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/assets/export/:assetId?orgId=string",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/assets/export/:assetId?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
"string"
{
"error": {
"type": "Forbidden",
"message": "Forbidden"
}
}
{
"productdataInvalid": {
"summary": "request to fetch product(s) not valid",
"value": {
"error": {
"type": "fetch_product_error",
"message": "failed to fetch product(s)"
}
}
}
}
GET https://admin.threekit.com/api/products/translations
curl --request GET \
--url 'https://admin.threekit.com/api/assets/export/:assetId?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/assets/export/:assetId?orgId=string",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/assets/export/:assetId?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
"string"
{
"error": {
"type": "Forbidden",
"message": "Forbidden"
}
}
{
"productdataInvalid": {
"summary": "request to fetch product(s) not valid",
"value": {
"error": {
"type": "fetch_product_error",
"message": "failed to fetch product(s)"
}
}
}
}
Exports translations belonging to the given organization or a specified asset in the organization. The translations will include catalog item names, names and values for attribtues and metadata, and catalog item tags.
REST Endpoint
GET https://admin.threekit.com/api/products/translations?orgId=[orgId]&assetId=[assetId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
assetId | query | string | false | export translation for single asset only. |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Export translations successfully. | string |
401 | Unauthorized | User is unauthorized to make the request | None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/products/translations?orgId=string' \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/translations?orgId=string",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/translations?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
"\"Canonical Name\",\"en\",\"fr\" \"12344\",,\"SDDS\" \"test\",, \"color\",, \"git\",, \"blue\",, \"red\",, \"ccac\",, \"new prod\",,\"DSD\" \"m2\",\"dsdsa\", \"prod\",,\"DSD\" \"attr1\",, \"attr2\",, \"m1\",, \"n1234\",\"sadas\",\"SDS\" \"[!!!LIVE MAGENTO!!!] Media Cabinet Configurator DO NOT EDIT\",\"vvvas\",\"SDS\" \"SKU\",\"vvsds\",\"SDS\" \"test model Clone\",, \"Asset\",, \"test model\",\"asss\","
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
POST https://admin.threekit.com/api/products/translations/
curl --request GET \
--url 'https://admin.threekit.com/api/products/translations?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/translations?orgId=string",
"headers": {
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/translations?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
"\"Canonical Name\",\"en\",\"fr\" \"12344\",,\"SDDS\" \"test\",, \"color\",, \"git\",, \"blue\",, \"red\",, \"ccac\",, \"new prod\",,\"DSD\" \"m2\",\"dsdsa\", \"prod\",,\"DSD\" \"attr1\",, \"attr2\",, \"m1\",, \"n1234\",\"sadas\",\"SDS\" \"[!!!LIVE MAGENTO!!!] Media Cabinet Configurator DO NOT EDIT\",\"vvvas\",\"SDS\" \"SKU\",\"vvsds\",\"SDS\" \"test model Clone\",, \"Asset\",, \"test model\",\"asss\","
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
Import translations for catalog items for an organization. The translations will be used for multilingual configurator. The endpoint only accept files in text/csv format.
REST Endpoint
POST https://admin.threekit.com/api/products/translations/?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
body | body | string(binary) | false | none |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Import translations successfully. | string |
401 | Unauthorized | User is unauthorized to make the request | None |
Example Implementations
Code
CURL
curl --request POST \
--url 'https://admin.threekit.com/api/products/translations/?orgId=string' \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: text/csv' \
--data '"string"'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/translations/?orgId=string",
"headers": {
"content-type": "text/csv",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write("\"string\"");
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/translations/?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "\"string\"",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: text/csv"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example responses
{
"translations": [
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"key": "ThreeKit Sofa",
"value": "Canapé ThreeKit",
"locale": "fr",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c"
},
{
"id": "ae774d8d-095a-4374-b10a-dae909860597",
"key": "ThreeKit Table",
"value": "Table ThreeKit",
"locale": "fr",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c"
}
]
}
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
Schemas
curl --request POST \
--url 'https://admin.threekit.com/api/products/translations/?orgId=string' \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: text/csv' \
--data '"string"'
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/products/translations/?orgId=string",
"headers": {
"content-type": "text/csv",
"authorization": "Bearer {access-token}"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write("\"string\"");
req.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/products/translations/?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "\"string\"",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer {access-token}",
"content-type: text/csv"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"translations": [
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"key": "ThreeKit Sofa",
"value": "Canapé ThreeKit",
"locale": "fr",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c"
},
{
"id": "ae774d8d-095a-4374-b10a-dae909860597",
"key": "ThreeKit Table",
"value": "Table ThreeKit",
"locale": "fr",
"orgId": "d7e8d7a2-93b1-43d5-bf20-32195396598c"
}
]
}
{
"error": {
"type": "unautorized",
"message": "unauthorized"
}
}
metadataQuery
[
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
]
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | none |
defaultValue | string | false | none | none |
type | string | false | none | none |
attribute
[
{
"type": "Number",
"name": "Example Number Attribute",
"step": 1,
"lockToStep": false,
"defaultValue": 0
},
{
"type": "Pricing",
"name": "Pricing",
"values": [
{
"pricebook": "c072c414-a362-483f-87e8-a72957369f09",
"currencies": {
"INR": 0
}
}
],
"defaultValue": {}
},
{
"type": "Asset",
"name": "Example Asset Attribute",
"assetType": "item",
"values": [
"#exampletag",
{
"assetId": "d10bc0af-f675-4e3f-956a-2c61b7eff147"
}
],
"defaultValue": {
"assetId": ""
}
},
{
"type": "String",
"name": "Example String Attribute",
"values": [
"exampleval1",
"exampleval2"
]
}
]
An array of objects, which can be used to add a list of attributes(if specified under attributes key) or metadata(if specified under metadata key) to an asset. If specified in the import file, they will be added/overriden on an asset. If they are not specified, no changes will be added/made. The attributes supported are String, Part Reference, and Image Upload (for items only).
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | Name of the attribute |
values | array | false | none | The list of values for an attribute. Depending on the attribute type, this array will hold values in different formats. 1. Attribute type "String" - In this case the values will be an array of strings. 2. Attribute type "Asset" - Depending on the type of attribute that needs to be set it will have a different format. 'a. If that attribute needs to be a part reference(non-tag), the format should be an object with "assetId" as the key and the ID of the asset as value. If this is a part reference for an "item", make sure that the value of "assetType" parameter is set to "item"'. 'b. If the attribute needs to be a part reference(tag), the format should be ["#tag"].' 'c. If that attribute needs to be a part reference(Image Upload), the format should be an object with "assetId" as the key and the ID of the asset as value. Ensure that the value of "assetType" parameter is "upload".' |
defaultValue | string | false | none | Specify a default value for an attribute. It follow the same format rules as "values" parameter, except the fact it will not be an array of values. |
type | string | false | none | Specify the attribute type. The supported values are String and Asset. |
assetType | string | false | none | Specify the asset type for part references. For an item, this should always be "item". This field is not required for a "String" attribute. |
metadata
[
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
]
An array of objects, which can be used to add a list of attributes(if specified under attributes key) or metadata(if specified under metadata key) to an asset. If specified in the import file, they will be added/overriden on an asset. If they are not specified, no changes will be added/made.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | THe name will be the metadata key |
defaultValue | string | false | none | The defaultValue will be the value for the metadata key specified in "name" |
type | string | false | none | Currently only two types of metadata are supported, "String" and "Number" |
rule
[
{
"conditions": [
{
"attributeId": "string",
"attribute": "string",
"operator": "string",
"value": "string"
}
],
"actions": [
{
"type": "string",
"name": "string",
"label": "string",
"attribute": "string",
"attributeId": "string",
"visible": true
}
],
"name": "string"
}
]
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
conditions | [object] | false | none | none |
» attributeId | string | true | none | none |
» attribute | string | false | none | optional to attributeId, add new attribute into rules |
» operator | string | true | none | none |
» value | string | true | none | none |
actions | [object] | false | none | none |
» type | string | true | none | none |
» name | string | true | none | none |
» label | string | true | none | none |
» attribute | string | false | none | optional to attributeId, add new attribute into rules |
» attributeId | string | true | none | none |
» visible | boolean | false | none | none |
name | string | false | none | none |
importReqBody
{
"sync": "string",
"files": {
"query": {
"id": "string",
"name": "string",
"metadata": [
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
]
},
"product": {
"name": "string",
"assetId": "string",
"asset": {
"assetId": "string",
"configuration": {},
"type": "string"
},
"type": "string",
"parentFolderId": "string",
"description": "string",
"keywords": [
"string"
],
"tags": [
"string"
],
"metadata": [
{
"name": "string",
"defaultValue": "string",
"type": "string"
}
],
"attributes": [
{
"type": "Number",
"name": "Example Number Attribute",
"step": 1,
"lockToStep": false,
"defaultValue": 0
},
{
"type": "Pricing",
"name": "Pricing",
"values": [
{
"pricebook": "c072c414-a362-483f-87e8-a72957369f09",
"currencies": {
"INR": 0
}
}
],
"defaultValue": {}
},
{
"type": "Asset",
"name": "Example Asset Attribute",
"assetType": "item",
"values": [
"#exampletag",
{
"assetId": "d10bc0af-f675-4e3f-956a-2c61b7eff147"
}
],
"defaultValue": {
"assetId": ""
}
},
{
"type": "String",
"name": "Example String Attribute",
"values": [
"exampleval1",
"exampleval2"
]
}
],
"rules": [
[
{
"conditions": [
{
"attributeId": "string",
"attribute": "string",
"operator": "string",
"value": "string"
}
],
"actions": [
{
"type": "string",
"name": "string",
"label": "string",
"attribute": "string",
"attributeId": "string",
"visible": true
}
],
"name": "string"
}
]
]
}
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
sync | string | false | none | Parameter to control whether the import/update process should run in sync mode or not. When sync is true, the process is completed within in a single API call (current behaviour). When sync is false, a job of type "catalog-import" is created. By default the parameter is set to "true". |
files | object | false | none | none |
» query | object | false | none | none |
»» id | string(string) | false | none | none |
»» name | string(string) | false | none | none |
»» metadata | metadataQuery | false | none | none |
» product | object | false | none | none |
»» name | string | false | none | none |
»» assetId | string | false | none | assetId linked in the item |
»» asset | object | false | none | asset linked in the item |
»»» assetId | string | false | none | none |
»»» configuration | object | false | none | none |
»»» type | string | false | none | none |
»» type | string | false | none | asset type, item/model/material/scene |
»» parentFolderId | string | false | none | uuid of the parent folder. This query parameter will be available for use when we add support for folders on the platform. * FOR FUTURE RELEASE* |
»» description | string | false | none | none |
»» keywords | [string] | false | none | none |
»» tags | [string] | false | none | none |
»» metadata | metadata | false | none | An array of objects, which can be used to add a list of attributes(if specified under attributes key) or metadata(if specified under metadata key) to an asset. If specified in the import file, they will be added/overriden on an asset. If they are not specified, no changes will be added/made. |
»» attributes | attribute | false | none | An array of objects, which can be used to add a list of attributes(if specified under attributes key) or metadata(if specified under metadata key) to an asset. If specified in the import file, they will be added/overriden on an asset. If they are not specified, no changes will be added/made. The attributes supported are String, Part Reference, and Image Upload (for items only). |
»» rules | [rule] | false | none | none |