Layers API
GET https://admin.threekit.com/api/layers
Retrieves the list of layers by query parameters if passed. For each entry the following information will be available.
- id - Layer ID
- assetId - Asset ID
- assetLayer - Asset layer
- assetLayerConfiguration - Configuration of the asset layer. If the asset has no composition(related to layered rendering), the assetLayerConfiguration is the configuration of the asset in question.
- assetVersion - Version of the asset
- orgId - Organization ID
- stageId - Stage ID
- stageVersion - Version of the stage
- jobId - Job ID
- taskId - Task ID
- fileId - Associated file ID (if present)
- branch - The branch of the layer
- metadata - Metadata related to the layer
- createdAt - The time when the layer was created
REST Endpoint
GET https://admin.threekit.com/api/layers?bearer_token=[bearer_token]&orgId=[orgId]&id=[id]&assetId=[assetId]&assetLayer=[assetLayer]&assetLayerConfiguration=[assetLayerConfiguration]&stageId=[stageId]&stageConfiguration=[stageConfiguration]&metadata=[metadata]&jobId=[jobId]&branch=[branch]&perPage=[perPage]&page=[page]&sort=[sort]
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. |
id | query | string | false | ID of a layer |
assetId | query | string | false | ID of a asset |
assetLayer | query | string | false | Asset layer |
assetLayerConfiguration | query | string | false | Configuration of an asset layer. If the asset has no composition(related to layered rendering), the assetLayerConfiguration is the configuration of the asset in question. Must be passed in as by encoding the stringified JSON. |
stageId | query | string | false | Stage ID |
stageConfiguration | query | string | false | Configuration of the stage. Must be passed in as a stringified ad encoded JSON. |
metadata | query | string | false | Metadata of the stage. Must be passed in as a stringified and encoded JSON. |
jobId | query | string | false | Job ID |
branch | query | string | false | Branch of the layer |
perPage | query | number | false | Total number of entries per page, defaults to 30 and can only go up to 100 |
page | query | number | false | Page to return, defaults to 1 |
sort | query | string | false | The direction and value to sort by, defaults to createdAt ascending (denoted +createdAt) |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful get request, response body will include the list of layers | None |
401 | Unauthorized | User is not authenticated. They must be authenticated to use this service. | None |
403 | Forbidden | No token was provided in the query string of the request | None |
422 | Unprocessable Entity | User pass the invalid query fields | None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/layers \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers",
"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/layers",
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
{
"layers": [
{
"id": "f730da7b-f3e0-45a5-9d95-ec13824d701a",
"assetId": "57fbf272-0806-4f6c-8ccb-e6bf682242b7",
"assetLayer": "7914e322-2e18-40a8-8e42-c31ca1f3739a",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "f0a1b442-8f82-4d5b-94b0-928fbe9740b4",
"taskId": "ae975540-a879-47a7-a86d-ba7760ddddb9",
"fileId": "9690e7a5-6637-43bb-8645-5101eec98c8d",
"branch": "unpublished",
"createdAt": "2020-03-20T14:45:08.437Z"
},
{
"id": "a569fb23-231d-4d52-b420-70c3802a02b2",
"assetId": "1e862fba-93c1-48d2-bbdb-4f7d93edac0c",
"assetLayer": "8bbd5e86-35e9-4f47-8ae2-e78f4d0c9efc",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "9a63d99f-6589-46ec-9e67-9ea9737b7a43",
"taskId": "cf8808fc-f8db-481f-a4c1-5daec1beac1b",
"fileId": "5a18b8d1-2374-499c-886c-9f6f992950c1",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
]
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "invalid_query_fields",
"message": "One or more invalid query fields"
}
}
POST https://admin.threekit.com/api/layers
curl --request GET \
--url https://admin.threekit.com/api/layers \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers",
"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/layers",
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;
}
{
"layers": [
{
"id": "f730da7b-f3e0-45a5-9d95-ec13824d701a",
"assetId": "57fbf272-0806-4f6c-8ccb-e6bf682242b7",
"assetLayer": "7914e322-2e18-40a8-8e42-c31ca1f3739a",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "f0a1b442-8f82-4d5b-94b0-928fbe9740b4",
"taskId": "ae975540-a879-47a7-a86d-ba7760ddddb9",
"fileId": "9690e7a5-6637-43bb-8645-5101eec98c8d",
"branch": "unpublished",
"createdAt": "2020-03-20T14:45:08.437Z"
},
{
"id": "a569fb23-231d-4d52-b420-70c3802a02b2",
"assetId": "1e862fba-93c1-48d2-bbdb-4f7d93edac0c",
"assetLayer": "8bbd5e86-35e9-4f47-8ae2-e78f4d0c9efc",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "9a63d99f-6589-46ec-9e67-9ea9737b7a43",
"taskId": "cf8808fc-f8db-481f-a4c1-5daec1beac1b",
"fileId": "5a18b8d1-2374-499c-886c-9f6f992950c1",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
]
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "invalid_query_fields",
"message": "One or more invalid query fields"
}
}
Creates a layer and generates an id which can be used to retrieve the layer, also supports saving an uploaded GLTF or USDZ file(with the fileId being the id of the uploaded file) as a layer.
REST Endpoint
POST https://admin.threekit.com/api/layers?bearer_token=[bearer_token]
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. |
body | body | createBody | true | Layer creation information. |
Body Parameters
{
"assetId": "string",
"assetLayerConfiguration": {},
"orgId": "string",
"stageId": "string",
"stageConfiguration": {},
"assetVersion": "string",
"metadata": {},
"jobId": "string",
"taskId": "string",
"fileId": "string"
}
Response Codes
{
"assetId": "string",
"assetLayerConfiguration": {},
"orgId": "string",
"stageId": "string",
"stageConfiguration": {},
"assetVersion": "string",
"metadata": {},
"jobId": "string",
"taskId": "string",
"fileId": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful post request, response body will include the created layer details. | None |
401 | Unauthorized | User is not authenticated. They must be authenticated to use this service. | None |
403 | Forbidden | No token was provided in the query string of the request | None |
422 | Unprocessable Entity | The request body was missing required fields or contained invalid fields. | None |
Example Implementations
Code
CURL
curl --request POST \
--url https://admin.threekit.com/api/layers \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"assetId":"string","assetLayerConfiguration":{},"orgId":"string","stageId":"string","stageConfiguration":{},"assetVersion":"string","metadata":{},"jobId":"string","taskId":"string","fileId":"string"}'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers",
"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({
assetId: 'string',
assetLayerConfiguration: {},
orgId: 'string',
stageId: 'string',
stageConfiguration: {},
assetVersion: 'string',
metadata: {},
jobId: 'string',
taskId: 'string',
fileId: 'string'
}));
req.end();
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/layers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"assetId\":\"string\",\"assetLayerConfiguration\":{},\"orgId\":\"string\",\"stageId\":\"string\",\"stageConfiguration\":{},\"assetVersion\":\"string\",\"metadata\":{},\"jobId\":\"string\",\"taskId\":\"string\",\"fileId\":\"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
{
"id": "f730da7b-f3e0-45a5-9d95-ec13824d701a",
"assetId": "57fbf272-0806-4f6c-8ccb-e6bf682242b7",
"assetLayer": "7914e322-2e18-40a8-8e42-c31ca1f3739a",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "f0a1b442-8f82-4d5b-94b0-928fbe9740b4",
"taskId": "ae975540-a879-47a7-a86d-ba7760ddddb9",
"fileId": "9690e7a5-6637-43bb-8645-5101eec98c8d",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "create_layer_error",
"message": "Create Layer error"
}
}
GET https://admin.threekit.com/api/layers/{id}
curl --request POST \
--url https://admin.threekit.com/api/layers \
--header 'authorization: Bearer {access-token}' \
--header 'content-type: application/json' \
--data '{"assetId":"string","assetLayerConfiguration":{},"orgId":"string","stageId":"string","stageConfiguration":{},"assetVersion":"string","metadata":{},"jobId":"string","taskId":"string","fileId":"string"}'
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers",
"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({
assetId: 'string',
assetLayerConfiguration: {},
orgId: 'string',
stageId: 'string',
stageConfiguration: {},
assetVersion: 'string',
metadata: {},
jobId: 'string',
taskId: 'string',
fileId: 'string'
}));
req.end();
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://admin.threekit.com/api/layers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"assetId\":\"string\",\"assetLayerConfiguration\":{},\"orgId\":\"string\",\"stageId\":\"string\",\"stageConfiguration\":{},\"assetVersion\":\"string\",\"metadata\":{},\"jobId\":\"string\",\"taskId\":\"string\",\"fileId\":\"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;
}
{
"id": "f730da7b-f3e0-45a5-9d95-ec13824d701a",
"assetId": "57fbf272-0806-4f6c-8ccb-e6bf682242b7",
"assetLayer": "7914e322-2e18-40a8-8e42-c31ca1f3739a",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "f0a1b442-8f82-4d5b-94b0-928fbe9740b4",
"taskId": "ae975540-a879-47a7-a86d-ba7760ddddb9",
"fileId": "9690e7a5-6637-43bb-8645-5101eec98c8d",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "create_layer_error",
"message": "Create Layer error"
}
}
Retrieves a layer by id. The layer will have the following information available.
- id - Layer ID
- assetId - Asset ID
- assetLayer - Asset layer
- assetLayerConfiguration - Configuration of the asset layer. If the asset has no composition(related to layered rendering), the assetLayerConfiguration is the configuration of the asset in question.
- assetVersion - Version of the asset
- orgId - Organization ID
- stageId - Stage ID
- stageVersion - Version of the stage
- jobId - Job ID
- taskId - Task ID
- fileId - Associated file ID (if present)
- branch - The branch of the layer
- metadata - Metadata related to the layer
- createdAt - The time when the layer was created
REST Endpoint
GET https://admin.threekit.com/api/layers/{id}?bearer_token=[bearer_token]&resultType=[resultType]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | ID of the layer 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. |
resultType | query | string | false | When set to "file" the response will be the associated file's contents if present. When set to "url" the response will contain the API URL to fetch the file. When set to "url" the response will contain the uto download the file, along with any metadata associated with it |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns a layer's information | None |
401 | Unauthorized | User is not authenticated. They must be authenticated to use this service. | None |
403 | Forbidden | No token was provided in the query string of the request | None |
422 | Unprocessable Entity | User passed a parameter with invalid format | None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/layers/string \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers/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/layers/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": "a569fb23-231d-4d52-b420-70c3802a02b2",
"assetId": "1e862fba-93c1-48d2-bbdb-4f7d93edac0c",
"assetLayer": "8bbd5e86-35e9-4f47-8ae2-e78f4d0c9efc",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "9a63d99f-6589-46ec-9e67-9ea9737b7a43",
"taskId": "cf8808fc-f8db-481f-a4c1-5daec1beac1b",
"fileId": "5a18b8d1-2374-499c-886c-9f6f992950c1",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "find_layer_error",
"message": "Error finding layer"
}
}
GET https://admin.threekit.com/api/layers/layer
curl --request GET \
--url https://admin.threekit.com/api/layers/string \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers/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/layers/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": "a569fb23-231d-4d52-b420-70c3802a02b2",
"assetId": "1e862fba-93c1-48d2-bbdb-4f7d93edac0c",
"assetLayer": "8bbd5e86-35e9-4f47-8ae2-e78f4d0c9efc",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "9a63d99f-6589-46ec-9e67-9ea9737b7a43",
"taskId": "cf8808fc-f8db-481f-a4c1-5daec1beac1b",
"fileId": "5a18b8d1-2374-499c-886c-9f6f992950c1",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "find_layer_error",
"message": "Error finding layer"
}
}
Retrieves a layer by query parameters. This API route also allows making use of Thumbor to optimize images. ** NOTE - Thumbor does not work for AR exports results stored in layers-service.** If multiple layers match the latest one is returned. The layer will have the following information available.
- id - Layer ID
- assetId - Asset ID
- assetLayer - Asset Layer
- assetLayerConfiguration - Configuration of the asset layer. If the asset has no composition(related to layered rendering), the assetLayerConfiguration is the configuration of the asset in question.
- assetVersion - Version of the asset
- orgId - Organization ID
- stageId - Stage ID
- stageVersion - Version of the stage
- jobId - Job ID
- taskId - Task ID
- fileId - Associated file ID (if present)
- branch - The branch of the layer
- metadata - Metadata related to the layer
- createdAt - The time when the layer was created
REST Endpoint
GET https://admin.threekit.com/api/layers/layer?bearer_token=[bearer_token]&assetLayerConfiguration=[assetLayerConfiguration]&stageConfiguration=[stageConfiguration]&metadata=[metadata]&resultType=[resultType]&optimization=[optimization]
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. |
assetLayerConfiguration | query | string | false | Configuration of an asset layer. If the asset has no composition(related to layered rendering), the assetLayerConfiguration is the configuration of the asset in question. Must be passed in as by encoding the stringified JSON. |
stageConfiguration | query | string | false | Configuration of the stage. Must be passed in as a stringified ad encoded JSON. |
metadata | query | string | false | Metadata of the stage. Must be passed in as a stringified and encoded JSON. |
resultType | query | string | false | When set to "file" the response will be the associated file's contents if present. When set to "url" the response will contain the API URL to fetch the file. When set to "url" the response will contain the uto download the file, along with any metadata associated with it |
optimization | query | string | false | This will include parameters related to thumbor optimization. The parameter must be a stringified and encoded JSON. The available options are - |
Detailed descriptions
optimization: This will include parameters related to thumbor optimization. The parameter must be a stringified and encoded JSON. The available options are -
- format - Specify the format to which the image should be converted. Currently only supports converting an image to "webp". Should be a string
- quality - Specify the compression level to be used in thumbor. The value can be anything between 0 and 100. Should be a number
- width - Specify the width to crop the image to. Should be a number
- height - Specify the height to crop the image to. Should be a number
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns a layer's information | None |
401 | Unauthorized | User is not authenticated. They must be authenticated to use this service. | None |
403 | Forbidden | No token was provided in the query string of the request | None |
422 | Unprocessable Entity | User passed a parameter with invalid format | None |
Example Implementations
Code
CURL
curl --request GET \
--url https://admin.threekit.com/api/layers/layer \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers/layer",
"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/layers/layer",
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": "a569fb23-231d-4d52-b420-70c3802a02b2",
"assetId": "1e862fba-93c1-48d2-bbdb-4f7d93edac0c",
"assetLayer": "8bbd5e86-35e9-4f47-8ae2-e78f4d0c9efc",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "9a63d99f-6589-46ec-9e67-9ea9737b7a43",
"taskId": "cf8808fc-f8db-481f-a4c1-5daec1beac1b",
"fileId": "5a18b8d1-2374-499c-886c-9f6f992950c1",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "find_layer_error",
"message": "Error finding layer"
}
}
POST https://admin.threekit.com/api/layers/groups/{groupBy}
curl --request GET \
--url https://admin.threekit.com/api/layers/layer \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "GET",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers/layer",
"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/layers/layer",
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": "a569fb23-231d-4d52-b420-70c3802a02b2",
"assetId": "1e862fba-93c1-48d2-bbdb-4f7d93edac0c",
"assetLayer": "8bbd5e86-35e9-4f47-8ae2-e78f4d0c9efc",
"assetVersion": "",
"assetLayerConfiguration": {
"example": "example"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "1f461a49-70c0-45ac-94d9-069d2de8c330",
"jobId": "9a63d99f-6589-46ec-9e67-9ea9737b7a43",
"taskId": "cf8808fc-f8db-481f-a4c1-5daec1beac1b",
"fileId": "5a18b8d1-2374-499c-886c-9f6f992950c1",
"branch": "published",
"createdAt": "2020-03-20T14:45:08.437Z"
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "find_layer_error",
"message": "Error finding layer"
}
}
Retrieves layers by query parameters, returned in groups. The response body will have the following have the following fields
- count - Total number of layers in the group
- page - Page number
- perPage - Total groups per page
- groups - The groups of layers The groups parameter is an array with entries corresponding to each distinct grouping. Each grouping will contain the groupBy key with its distinct value, and the following
- assetId - Asset ID. NOTE - This parameter will be deprecated in the future
- assetIds - List of Asset IDs associated with the job.
- stageIds - List of Stage IDs associated with the job.
- count - Total number of layers in the group
- fileId - Associated file ID (if present)
- groupBy - The field used to group the layers
REST Endpoint
POST https://admin.threekit.com/api/layers/groups/{groupBy}?bearer_token=[bearer_token]&orgId=[orgId]&id=[id]&assetId=[assetId]&assetLayer=[assetLayer]&assetLayerConfiguration=[assetLayerConfiguration]&stageId=[stageId]&stageConfiguration=[stageConfiguration]&metadata=[metadata]&jobId=[jobId]&branch=[branch]&perPage=[perPage]&page=[page]&sort=[sort]
Query Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
groupBy | path | string | true | Value used to group the retrieved layers by. Possible values are jobId, stageId, assetId, orgId, branch. |
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. |
id | query | string | false | ID of a layer |
assetId | query | string | false | ID of a asset |
assetLayer | query | string | false | Asset layer |
assetLayerConfiguration | query | string | false | Configuration of an asset layer. If the asset has no composition(related to layered rendering), the assetLayerConfiguration is the configuration of the asset in question. Must be passed in as by encoding the stringified JSON. |
stageId | query | string | false | Stage ID |
stageConfiguration | query | string | false | Configuration of the stage. Must be passed in as a stringified ad encoded JSON. |
metadata | query | string | false | Metadata of the stage. Must be passed in as a stringified and encoded JSON. |
jobId | query | string | false | Job ID |
branch | query | string | false | Branch of the layer |
perPage | query | number | false | Total number of entries per page, defaults to 30 and can only go up to 100 |
page | query | number | false | Page to return, defaults to 1 |
sort | query | string | false | The direction and value to sort by, defaults to createdAt ascending (denoted +createdAt) |
Response Codes
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns groups information | None |
401 | Unauthorized | User is not authenticated. They must be authenticated to use this service. | None |
403 | Forbidden | No token was provided in the query string of the request | None |
422 | Unprocessable Entity | User passed a parameter with invalid format | None |
Example Implementations
Code
CURL
curl --request POST \
--url https://admin.threekit.com/api/layers/groups/string \
--header 'authorization: Bearer {access-token}'
Node.JS
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers/groups/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/layers/groups/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
{
"groupBy": "Example Field",
"count": 38,
"page": 1,
"perPage": 30,
"groups": [
{
"count": 2,
"jobId": "fcab3957-bfa0-4af8-aad3-ffb2a035a107",
"createdAt": "2020-11-27T18:12:43.580Z",
"fileId": "610f9df6-a2e2-4729-b87f-51421bb2fb0e",
"assetId": "db732570-3462-446e-be4c-193bc0e1fe05",
"assetIds": [
"db732570-3462-446e-be4c-193bc0e1fe05"
],
"stageIds": []
}
]
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "find_layer_error",
"message": "Error finding layer"
}
}
Schemas
curl --request POST \
--url https://admin.threekit.com/api/layers/groups/string \
--header 'authorization: Bearer {access-token}'
var http = require("https");
var options = {
"method": "POST",
"hostname": "admin.threekit.com",
"port": null,
"path": "/api/layers/groups/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/layers/groups/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;
}
{
"groupBy": "Example Field",
"count": 38,
"page": 1,
"perPage": 30,
"groups": [
{
"count": 2,
"jobId": "fcab3957-bfa0-4af8-aad3-ffb2a035a107",
"createdAt": "2020-11-27T18:12:43.580Z",
"fileId": "610f9df6-a2e2-4729-b87f-51421bb2fb0e",
"assetId": "db732570-3462-446e-be4c-193bc0e1fe05",
"assetIds": [
"db732570-3462-446e-be4c-193bc0e1fe05"
],
"stageIds": []
}
]
}
{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}
{
"error": {
"code": "forbidden",
"message": "forbidden"
}
}
{
"error": {
"code": "find_layer_error",
"message": "Error finding layer"
}
}
createBody
{
"assetId": "string",
"assetLayerConfiguration": {},
"orgId": "string",
"stageId": "string",
"stageConfiguration": {},
"assetVersion": "string",
"metadata": {},
"jobId": "string",
"taskId": "string",
"fileId": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
assetId | string | false | none | Asset ID. |
assetLayerConfiguration | object | false | none | Configuration of the asset layer. If the asset has no composition(related to layered rendering), the assetLayerConfiguration is the configuration of the asset in question. |
orgId | string | false | none | Organization which owns the layer. |
stageId | string | false | none | Stage ID. |
stageConfiguration | object | false | none | Configuration of the stage. |
assetVersion | string | false | none | Asset version |
metadata | object | false | none | Metadata of the layer |
jobId | string | false | none | Job ID |
taskId | string | false | none | Task ID |
fileId | string | false | none | File ID |