POST https://admin.threekit.com/api/configurations
Saves the configuration of a product and generates a shortID which can be used to retrieve the configuration, in place of the UUID. Files can also be stored along with the configuration provided a mapping is provided for the filenames to a unique key which cna then be used to fetch the file using the "fetch attachment API"
REST Endpoint
POST https://admin.threekit.com/api/configurations?bearer_token=[bearer_token]&orgId=[orgId]
Query Parameters
Name |
In |
Type |
Required |
Description |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
orgId |
query |
string |
false |
Organization ID. |
body |
body |
configurationBody |
true |
Configuration information to be saved. |
Body Parameters
{
"orgId": "7f6a52b7-a10b-4945-836a-5fecc24ee914",
"productId": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productVersion": "exampleVersionNumber",
"variant": {
"ExampleVariantField1": "ExampleValue1"
},
"metadata": {
"SKU": "exampleSKU"
},
"files": "string",
"shortId": "46Juzcyx",
"customerId": "bba8a2d8-528e-4a20-beea-bc59f7863dcb",
"attachments": {
"key": "testfile.png"
}
}
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Successful POST request, response body will include the created configuration details. |
None |
401 |
Unauthorized |
User is not authenticated. They must be authenticated to use this service. |
None |
403 |
Forbidden |
User is authenticated but lacks authorization to use this service |
None |
422 |
Unprocessable Entity |
The configuration information provided in the request is missing mandatory fields. Or the mapping defined when multiple files are provided in the request, is incorrect. |
None |
Example Implementations
Code
CURL
curl --request POST \
--url https://admin.threekit.com/api/configurations \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"orgId":"7f6a52b7-a10b-4945-836a-5fecc24ee914","productId":"e5d536ec-e89c-46fc-8773-7e54ba70517a","productVersion":"exampleVersionNumber","variant":{"ExampleVariantField1":"ExampleValue1"},"metadata":{"SKU":"exampleSKU"},"files":"string","shortId":"46Juzcyx","customerId":"bba8a2d8-528e-4a20-beea-bc59f7863dcb","attachments":{"key":"testfile.png"}}'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/configurations",
"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({
orgId: '7f6a52b7-a10b-4945-836a-5fecc24ee914',
productId: 'e5d536ec-e89c-46fc-8773-7e54ba70517a',
productVersion: 'exampleVersionNumber',
variant: { ExampleVariantField1: 'ExampleValue1' },
metadata: { SKU: 'exampleSKU' },
files: 'string',
shortId: '46Juzcyx',
customerId: 'bba8a2d8-528e-4a20-beea-bc59f7863dcb',
attachments: { key: 'testfile.png' }
}));
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/configurations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"orgId\":\"7f6a52b7-a10b-4945-836a-5fecc24ee914\",\"productId\":\"e5d536ec-e89c-46fc-8773-7e54ba70517a\",\"productVersion\":\"exampleVersionNumber\",\"variant\":{\"ExampleVariantField1\":\"ExampleValue1\"},\"metadata\":{\"SKU\":\"exampleSKU\"},\"files\":\"string\",\"shortId\":\"46Juzcyx\",\"customerId\":\"bba8a2d8-528e-4a20-beea-bc59f7863dcb\",\"attachments\":{\"key\":\"testfile.png\"}}",
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
[
{
"id": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productId": "b227b582-4e16-4a30-870d-a3dc8ecbe5fd",
"productVersion": "exampleVersionNumber",
"variant": {
"ExampleVariantField1": "ExampleValue1"
},
"metadata": {},
"shortId": "46Juzcyx",
"createdAt": "2019-06-06 15:10:25.471+00",
"attachments": {}
}
]
[
{
"id": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productId": "b227b582-4e16-4a30-870d-a3dc8ecbe5fd",
"productVersion": "exampleVersionNumber",
"variant": {
"ExampleVariantField1": "ExampleValue1"
},
"metadata": {},
"shortId": "46Juzcyx",
"thumbnail": "sha256-ea44cae9ff01f902269d1c5b419b22f6405a02b0e0d434e7814b6761444fda01-br",
"createdAt": "2019-06-06 15:10:25.471+00",
"attachments": {}
}
]
[
{
"id": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productId": "b227b582-4e16-4a30-870d-a3dc8ecbe5fd",
"productVersion": "exampleVersionNumber",
"variant": {
"ExampleVariantField1": "ExampleValue1"
},
"metadata": {},
"shortId": "46Juzcyx",
"createdAt": "2019-06-06 15:10:25.471+00",
"attachments": {
"key1": "https://admin.threekit.com/api/files/7ae7dda3-4e3c-4497-9806-af71aaa800d7/content",
"key2": "https://admin.threekit.com/api/files/5a5436dc-e872-4c1c-8de0-78ab777dff26/content"
}
}
]
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "Forbidden"
}
}
{
"error": {
"code": "create_configuration_error",
"message": "Create configuration error"
}
}
{
"error": {
"code": "create_configuration_error",
"message": "filenames and attachment mappings do not match"
}
}
GET https://admin.threekit.com/api/configurations
Retrieves a list of all configurations associated with an organization. Each configuration will have the following information.
- id - Configuration ID
- productId - ID of the product
- productVersion - Version of the product. NOTE --- This is related to our publishing workflow, which is still in the process of being implemented. As of now, this parameter can be safely ignored.
- shortId - Automatically generated shortID. It can be used in place of the id field
- variant - Configuration variant information (If present). This refers to the product attributes and their values.
- metadata - Metadata information associated with the configuration (If present)
- orgId - Organization ID
- thumbnail - Hash of the thumbnail of the configuration (If present)
- createdAt - Configuration creation timestamp
REST Endpoint
GET https://admin.threekit.com/api/configurations?bearer_token=[bearer_token]&orgId=[orgId]&productId=[productId]&productVersion=[productVersion]&shortId=[shortId]&sku=[sku]&metadata=[metadata]&fullConfiguration=[fullConfiguration]
Query Parameters
Name |
In |
Type |
Required |
Description |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
orgId |
query |
string |
false |
Organization ID. |
productId |
query |
string |
false |
Product ID. |
productVersion |
query |
string |
false |
Product version. |
shortId |
query |
string |
false |
Short ID. |
sku |
query |
string |
false |
SKU of the configuration. |
metadata |
query |
string |
false |
Arbitrary metadata to be used to fetch list of configurations. Since it is a query string parameter, it needs to be correctly stringified and encoded. Example 'metadata={%22Example%20Key%22:%Value%22}' |
fullConfiguration |
query |
boolean |
false |
Fetches detailed information about the configuration, specifically item name and item metadata for part references. **NOTE - The current implementation assumes that the format of the variant field is identical to how the player stores configuration. For a custom format, there is a possibility that it may not work |
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Successful GET request. Response body will include list of configurations. |
None |
401 |
Unauthorized |
User is not authenticated. They must be authenticated to use this service. |
None |
403 |
Forbidden |
User is authenticated but lacks authorization to use this service |
None |
404 |
Not Found |
No configurations exist in the database, based on the query parameter(s) provided. |
None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/configurations \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/configurations",
"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/configurations",
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
{
"configurations": [
{
"id": "0dcbbee1-352e-4f3b-b87d-3c007b33b3f1",
"productId": "77a70069-212a-4c9a-be20-bc054bbd0127",
"productVersion": "exampleVersionNumber2",
"orgId": "b386f503-d2d3-425d-8b2b-5e4c39da510d",
"variant": {
"Pillows": "Hide"
},
"metadata": {
"SKU": "exampleSKU"
},
"shortId": "hwX6aOr7",
"thumbnail": "sha256-ea44cae9ff01f902269d1c5b419b22g6405q02b0e0d434e7814b676354fda01",
"createdAt": "2019-06-06 15:10:25.471+00"
},
{
"id": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productId": "b227b582-4e16-4a30-870d-a3dc8ecbe5fd",
"productVersion": "exampleVersionNumber",
"variant": {},
"metadata": {
"SKU": "exampleSKU"
},
"shortId": "46Juzcyx",
"thumbnail": "sha256-ea44cae9ff01f902269d1c5b419b22f6405a02b0e0d434e7814b6761444fda01",
"createdAt": "2019-06-06 15:10:25.471+00"
}
]
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "Forbidden"
}
}
{
"error": {
"code": "configurations_not_found",
"message": "Configurations not found"
}
}
GET https://admin.threekit.com/api/configurations/sku
Retrieves a list of all configurations associated with a SKU. Each configuration will have the following information.
- id - Configuration ID
- productId - ID of the product
- productVersion - Version of the product. NOTE --- This is related to our publishing workflow, which is still in the process of being implemented. As of now, this parameter can be safely ignored.
- shortId - Automatically generated shortID. It can be used in place of the id field
- variant - Configuration variant information (If present). This refers to the product attributes and their values.
- metadata - Metadata information associated with the configuration (If present)
- orgId - Organization ID
- thumbnail - Hash of the thumbnail of the configuration (If present)
- createdAt - Configuration creation timestamp
- scope - Scope of the SKU, only allows 'GTIN', 'UPC' and 'org'
- identifier - Identifier of the SKU
REST Endpoint
GET https://admin.threekit.com/api/configurations/sku?bearer_token=[bearer_token]&sku=[sku]&orgId=[orgId]
Query Parameters
Name |
In |
Type |
Required |
Description |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
sku |
query |
string |
true |
SKU of the configuration. |
orgId |
query |
string |
false |
Organization ID. |
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Successful GET request. Response body will include list of configurations. |
None |
401 |
Unauthorized |
User is not authenticated. They must be authenticated to use this service. |
None |
404 |
Not Found |
SKU was not passed |
None |
Example Implementations
Code
CURL
curl --request GET \
--url 'https://admin.threekit.com/api/configurations/sku?sku=xyz-123' \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/configurations/sku?sku=xyz-123",
"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/configurations/sku?sku=xyz-123",
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
{
"configurations": [
{
"id": "0dcbbee1-352e-4f3b-b87d-3c007b33b3f1",
"productId": "77a70069-212a-4c9a-be20-bc054bbd0127",
"productVersion": "exampleVersionNumber2",
"orgId": "b386f503-d2d3-425d-8b2b-5e4c39da510d",
"variant": {
"Pillows": "Hide"
},
"metadata": {
"SKU": "exampleSKU"
},
"shortId": "hwX6aOr7",
"thumbnail": "sha256-ea44cae9ff01f902269d1c5b419b22g6405q02b0e0d434e7814b676354fda01",
"createdAt": "2019-06-06 15:10:25.471+00"
},
{
"id": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productId": "b227b582-4e16-4a30-870d-a3dc8ecbe5fd",
"productVersion": "exampleVersionNumber",
"variant": {},
"metadata": {
"SKU": "exampleSKU"
},
"shortId": "46Juzcyx",
"thumbnail": "sha256-ea44cae9ff01f902269d1c5b419b22f6405a02b0e0d434e7814b6761444fda01",
"createdAt": "2019-06-06 15:10:25.471+00"
}
]
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "configuration_not_found",
"message": "sku param required"
}
}
GET https://admin.threekit.com/api/configurations/{id}
Retrieves a configuration from its ID or shortID.
REST Endpoint
GET https://admin.threekit.com/api/configurations/{id}?bearer_token=[bearer_token]&orgId=[orgId]
Query Parameters
Name |
In |
Type |
Required |
Description |
id |
path |
string |
true |
ID or shortID of the configuration to be retrieved. |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
orgId |
query |
string |
false |
Organization ID. |
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
Successful GET request, retrieving a configuration using its ID or short ID. |
None |
401 |
Unauthorized |
User is not authenticated. They must be authenticated to use this service. |
None |
404 |
Not Found |
No configuration was found with the given ID or short ID. |
None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/configurations/string \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/configurations/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/configurations/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": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productId": "b227b582-4e16-4a30-870d-a3dc8ecbe5fd",
"productVersion": "exampleVersionNumber",
"variant": {},
"metadata": {},
"shortId": "46Juzcyx",
"thumbnail": "sha256-ea44cae9ff01f902269d1c5b419b22f6405a02b0e0d434e7814b6761444fda01",
"createdAt": "2019-06-06 15:10:25.471+00"
}
]
[
{
"id": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productId": "b227b582-4e16-4a30-870d-a3dc8ecbe5fd",
"productVersion": "exampleVersionNumber",
"variant": "{ \"exampleAttr1\": \"exampleValue1\", \"examplePartRef1\": { \"type\": \"item\", \"assetId\": \"cd2170fb-c18d-4112-86a5-de6cb7fe3d1a\", \"configuration\": { \"nestedAttr1\": \"nestedAttrValue1\", } \"itemName\": \"ExampleItem\", \"itemMetadata\": {} } } }",
"metadata": {},
"shortId": "46Juzcyx",
"thumbnail": "sha256-ea44cae9ff01f902269d1c5b419b22f6405a02b0e0d434e7814b6761444fda01",
"createdAt": "2019-06-06 15:10:25.471+00"
}
]
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "configuration_not_found",
"message": "Configuration not found"
}
}
GET https://admin.threekit.com/api/configurations/{id}/thumbnail
Retrieves a thumbnail from its ID or shortID.
REST Endpoint
GET https://admin.threekit.com/api/configurations/{id}/thumbnail?bearer_token=[bearer_token]&orgId=[orgId]
Query Parameters
Name |
In |
Type |
Required |
Description |
id |
path |
string |
true |
ID or shortID of the configuration whose thumbnail needs to be retrieved. While the API endpoint does not require any authorization, it does require the orgId parameter to correctly fetch the thumbnail. So the request sohuld either explicitly contain the orgId or a token for the request to be successful |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
orgId |
query |
string |
false |
Organization ID. |
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
none |
None |
401 |
Unauthorized |
User is not authenticated. They must be authenticated to use this service. |
None |
404 |
Not Found |
Either the configuration or the thumbnail was not found |
None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/configurations/string/thumbnail \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/configurations/string/thumbnail",
"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/configurations/string/thumbnail",
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
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "configuration_not_found",
"message": "Configuration not found"
}
}
{
"error": {
"code": "thumbnail_no_found",
"message": "No thumbnail exists for this configuration"
}
}
GET https://admin.threekit.com/api/configurations/{id}/files/{key}
Retrieves a file attached to a configuration from its ID or shortID and mapped to the key provided in the request.
REST Endpoint
GET https://admin.threekit.com/api/configurations/{id}/files/{key}?bearer_token=[bearer_token]&orgId=[orgId]
Query Parameters
Name |
In |
Type |
Required |
Description |
id |
path |
string |
true |
ID or shortID of the configuration whose attachment needs to be retrieved. While the API endpoint does not require any authorization, it does require the orgId parameter to correctly fetch the file. So the request should either explicitly contain the orgId or a token to allow the request to be successful |
bearer_token |
query |
string |
false |
Public access token used to authorize the request. Requests may only come from the token's allowed domains. This parameter is mandatory when making requests from a browser. Outside of the browser instead supply a bearer header using a private access token. |
orgId |
query |
string |
false |
Organization ID. |
Response Codes
Status |
Meaning |
Description |
Schema |
200 |
OK |
none |
None |
401 |
Unauthorized |
User is not authenticated. They must be authenticated to use this service. |
None |
404 |
Not Found |
Either the configuration or attachment linked to the key provided in the request was not found |
None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/configurations/string/files/ \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/configurations/string/files/",
"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/configurations/string/files/",
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
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "configuration_not_found",
"message": "Configuration not found"
}
}
{
"error": {
"code": "attachment_not_found",
"message": "No attachment exists for the provided key in this configuration"
}
}
Schemas
configurationBody
{
"orgId": "7f6a52b7-a10b-4945-836a-5fecc24ee914",
"productId": "e5d536ec-e89c-46fc-8773-7e54ba70517a",
"productVersion": "exampleVersionNumber",
"variant": {
"ExampleVariantField1": "ExampleValue1"
},
"metadata": {
"SKU": "exampleSKU"
},
"files": "string",
"shortId": "46Juzcyx",
"customerId": "bba8a2d8-528e-4a20-beea-bc59f7863dcb",
"attachments": {
"key": "testfile.png"
}
}
Properties
Name |
Type |
Required |
Restrictions |
Description |
orgId |
string |
false |
none |
Organization ID |
productId |
string |
true |
none |
ID of the product |
productVersion |
string |
true |
none |
Version of the product |
variant |
object |
false |
none |
Configuration variant information (If present). This refers to the product attributes and their values for the configuration in question. |
metadata |
object |
false |
none |
Metadata information associated with the configuration (If present) |
files |
string(binary) |
false |
none |
An image or a thumbnail of the configured product. NOTE --- This parameter will only accept a file. It can also be used to attach multiple files to the request |
shortId |
string |
false |
none |
Automatically generated shortID. It can be used in place of the id field |
customerId |
string |
false |
none |
Customer ID |
attachments |
object |
false |
none |
This field can be used to define mappings to fetch files, if multiple files are attached to the the request. Please check the example request to see how mapping should be defined |
» key |
string |
false |
none |
Define the key-value pair that will define the mapping for a file. |