Data Tables API
POST https://admin.threekit.com/api/datatables
Import csv file and convert it into a threekit datatable. When using endpoint via API, columnInfo and name must be specified.
REST Endpoint
POST https://admin.threekit.com/api/datatables?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 | datatable imported successfully | 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/datatables?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/datatables?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/datatables?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
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"name": "cassbh",
"version": 15,
"columnInfo": [
{
"name": "SKU",
"type": "String"
},
{
"name": "Size",
"type": "String"
},
{
"name": "Color",
"type": "String"
},
{
"name": "Product name",
"type": "Boolean"
}
],
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "malformed format",
"value": {
"error": {
"type": "malformed_format",
"message": "malformed_format"
}
}
}
}
GET https://admin.threekit.com/api/datatables
curl --request POST \
--url 'https://admin.threekit.com/api/datatables?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/datatables?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/datatables?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;
}
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"name": "cassbh",
"version": 15,
"columnInfo": [
{
"name": "SKU",
"type": "String"
},
{
"name": "Size",
"type": "String"
},
{
"name": "Color",
"type": "String"
},
{
"name": "Product name",
"type": "Boolean"
}
],
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "malformed format",
"value": {
"error": {
"type": "malformed_format",
"message": "malformed_format"
}
}
}
}
return a list of datatables
REST Endpoint
GET https://admin.threekit.com/api/datatables?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 | datatable list | None |
401 | Unauthorized | User is unauthorized to make the request | None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/datatables?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/datatables?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/datatables?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
{
"datatables": [
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null
},
{
"id": "0896910a-c0f6-4f08-8f7f-7009edf950a7",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cass",
"version": 1,
"columnInfo": "0805b839-5758-48b0-a81d-3eea7aed4234",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T17:31:11.470Z",
"updatedAt": "2021-02-08T17:31:45.236Z",
"deletedAt": null
}
]
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
GET https://admin.threekit.com/api/datatables/{datatableId}
curl --request GET \
--url 'https://admin.threekit.com/api/datatables?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables?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/datatables?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;
}
{
"datatables": [
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null
},
{
"id": "0896910a-c0f6-4f08-8f7f-7009edf950a7",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cass",
"version": 1,
"columnInfo": "0805b839-5758-48b0-a81d-3eea7aed4234",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T17:31:11.470Z",
"updatedAt": "2021-02-08T17:31:45.236Z",
"deletedAt": null
}
]
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
Get a datatable based on its id.
REST Endpoint
GET https://admin.threekit.com/api/datatables/{datatableId}?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
datatableId | path | string | true | ID of the datatable |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetch datatable based on tableId | None |
401 | Unauthorized | User is unauthorized to make the request | None |
404 | Not Found | Datatable not found | None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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
[
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
]
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"error": {
"type": "data_not_found",
"message": "Data not found"
}
}
PUT https://admin.threekit.com/api/datatables/{datatableId}
curl --request GET \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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;
}
[
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
]
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"error": {
"type": "data_not_found",
"message": "Data not found"
}
}
Update a datatable by importing a new csv file. When using endpoint via API, columnInfo and name must be specified.
REST Endpoint
PUT https://admin.threekit.com/api/datatables/{datatableId}?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
datatableId | path | string | true | ID of the datatable |
body | body | string(binary) | false | none |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | datatable imported successfully | 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 PUT \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string' \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: text/csv' \
--data '"string"'
Node.JS
var http = require("https");
var options = {
"method": "PUT",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"name": "cassbh",
"version": 15,
"columnInfo": [
{
"name": "SKU",
"type": "String"
},
{
"name": "Size",
"type": "String"
},
{
"name": "Color",
"type": "String"
},
{
"name": "Product name",
"type": "Boolean"
}
],
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "malformed format",
"value": {
"error": {
"type": "malformed_format",
"message": "malformed_format"
}
}
}
}
DELETE https://admin.threekit.com/api/datatables/{datatableId}
curl --request PUT \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string' \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: text/csv' \
--data '"string"'
var http = require("https");
var options = {
"method": "PUT",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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;
}
{
"id": "6e4b65b7-862b-4cd9-b183-c07d82d5beed",
"name": "cassbh",
"version": 15,
"columnInfo": [
{
"name": "SKU",
"type": "String"
},
{
"name": "Size",
"type": "String"
},
{
"name": "Color",
"type": "String"
},
{
"name": "Product name",
"type": "Boolean"
}
],
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"productdataInvalid": {
"summary": "malformed format",
"value": {
"error": {
"type": "malformed_format",
"message": "malformed_format"
}
}
}
}
Delete a datatable
REST Endpoint
DELETE https://admin.threekit.com/api/datatables/{datatableId}?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
datatableId | path | string | true | ID of the datatable |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response after deleting a datatable | None |
401 | Unauthorized | User is unauthorized to make the request | None |
422 | Unprocessable Entity | Datatable already deleted | None |
Example Implementations
Code
CURL
curl --request DELETE \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string' \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "DELETE",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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
[
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": "2021-08-19T14:44:48.882Z",
"deletedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a"
}
]
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"error": {
"type": "delete_datatable_error",
"message": "Datatable already deleted"
}
}
POST https://admin.threekit.com/api/datatables/{datatableId}/restore
curl --request DELETE \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "DELETE",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0?orgId=string",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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;
}
[
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": "2021-08-19T14:44:48.882Z",
"deletedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a"
}
]
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"error": {
"type": "delete_datatable_error",
"message": "Datatable already deleted"
}
}
Restore a datatable
REST Endpoint
POST https://admin.threekit.com/api/datatables/{datatableId}/restore?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
datatableId | path | string | true | ID of the datatable |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response after restoring a datatable | None |
401 | Unauthorized | User is unauthorized to make the request | None |
422 | Unprocessable Entity | Datatable already restored | None |
Example Implementations
Code
CURL
curl --request POST \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/restore?orgId=string' \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/restore?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/restore?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_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
[
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
]
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"error": {
"type": "restore_datatable_error",
"message": "Datatable already restored"
}
}
GET https://admin.threekit.com/api/datatables/{datatableId}/download
curl --request POST \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/restore?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/restore?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/restore?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_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;
}
[
{
"id": "ec9c58e5-59f7-4bda-a5e5-21579864a141",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"name": "cassbh",
"version": "15,",
"columnInfo": "16227872-9da9-4b78-a169-191a4dfd08c9",
"createdBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"updatedBy": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"createdAt": "2021-02-08T19:11:38.845Z",
"updatedAt": "2021-02-10T23:28:13.012Z",
"deletedAt": null,
"deletedBy": null
}
]
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
{
"error": {
"type": "restore_datatable_error",
"message": "Datatable already restored"
}
}
Download a datatable in its current version.
REST Endpoint
GET https://admin.threekit.com/api/datatables/{datatableId}/download?orgId=[orgId]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
datatableId | path | string | true | ID of the datatable |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Download a datatable 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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/download?orgId=string' \
--header 'accept: text/csv' \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/download?orgId=string",
"headers": {
"accept": "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.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/download?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(
"accept: text/csv",
"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
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
GET https://admin.threekit.com/api/datatables/{datatableId}/row
curl --request GET \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/download?orgId=string' \
--header 'accept: text/csv' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/download?orgId=string",
"headers": {
"accept": "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.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/download?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(
"accept: text/csv",
"authorization: Bearer {access-token}"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
Get a row value from a datatable based on request query
REST Endpoint
GET https://admin.threekit.com/api/datatables/{datatableId}/row?orgId=[orgId]&where=[where]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
datatableId | path | string | true | ID of the datatable |
where | query | array[object] | true | row query to get a row from a datatable |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | row value from query | None |
401 | Unauthorized | User is unauthorized to make the request | None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/row?where=%5Bobject%20Object%5D&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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/row?where=%5Bobject%20Object%5D&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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/row?where=%5Bobject%20Object%5D&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
{
"id": "add79556-9474-4e85-b829-40a5276c443c",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"tableId": "e4b777f4-98f4-4d9f-932e-75dfd0477dac",
"value": {
"SKU": "sofa-s-b",
"Size": "s",
"Color": "#000000",
"Product name": "sofa"
},
"version": "0,",
"createdAt": "2021-02-05T21:47:24.643Z"
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
GET https://admin.threekit.com/api/datatables/{datatableId}/rows
curl --request GET \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/row?where=%5Bobject%20Object%5D&orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/row?where=%5Bobject%20Object%5D&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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/row?where=%5Bobject%20Object%5D&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;
}
{
"id": "add79556-9474-4e85-b829-40a5276c443c",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"tableId": "e4b777f4-98f4-4d9f-932e-75dfd0477dac",
"value": {
"SKU": "sofa-s-b",
"Size": "s",
"Color": "#000000",
"Product name": "sofa"
},
"version": "0,",
"createdAt": "2021-02-05T21:47:24.643Z"
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
Get list of rows from a datatable based on request query
REST Endpoint
GET https://admin.threekit.com/api/datatables/{datatableId}/rows?orgId=[orgId]&version=[version]&all=[all]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgId | query | string | true | ID of the organization which the assets belong to |
datatableId | path | string | true | ID of the datatable |
version | query | number | false | Get datatable rows for a specific version of the table. By default it will fetch the latest version |
all | query | boolean | false | Fetch all rows in a datatable without applying pagination to the response |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Fetch all rows from a table in an org | None |
401 | Unauthorized | User is unauthorized to make the request | None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/rows?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/rows?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/rows?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
{
"count": 2,
"page": 1,
"perPage": 50,
"rows": [
{
"id": "f2ef159c-82e3-4de7-8daf-f1affc25e398",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"tableId": "e4b777f4-98f4-4d9f-932e-75dfd0477dac",
"value": {
"SKU": "sofa-s-b",
"Size": "s",
"Color": "#000000",
"Product name": "sofa"
},
"version": "0,",
"createdAt": "2021-02-05T21:47:24.643Z"
},
{
"id": "add79556-9474-4e85-b829-40a5276c443c",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"tableId": "e4b777f4-98f4-4d9f-932e-75dfd0477dac",
"value": {
"SKU": "sofa-s-c",
"Size": "l",
"Color": "#FFFFFF",
"Product name": "sofa"
},
"version": "0,",
"createdAt": "2021-02-05T21:47:24.643Z"
}
]
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}
curl --request GET \
--url 'https://admin.threekit.com/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/rows?orgId=string' \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/rows?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/datatables/4c807590-e00f-474d-b2ab-820c82e1edd0/rows?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;
}
{
"count": 2,
"page": 1,
"perPage": 50,
"rows": [
{
"id": "f2ef159c-82e3-4de7-8daf-f1affc25e398",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"tableId": "e4b777f4-98f4-4d9f-932e-75dfd0477dac",
"value": {
"SKU": "sofa-s-b",
"Size": "s",
"Color": "#000000",
"Product name": "sofa"
},
"version": "0,",
"createdAt": "2021-02-05T21:47:24.643Z"
},
{
"id": "add79556-9474-4e85-b829-40a5276c443c",
"orgId": "c9563be2-5644-4a9b-ad6c-55b82705700a",
"tableId": "e4b777f4-98f4-4d9f-932e-75dfd0477dac",
"value": {
"SKU": "sofa-s-c",
"Size": "l",
"Color": "#FFFFFF",
"Product name": "sofa"
},
"version": "0,",
"createdAt": "2021-02-05T21:47:24.643Z"
}
]
}
{
"error": {
"type": "unauthorized",
"message": "unauthorized"
}
}