Kaedim
Search
K

Web API

We created a simple React app implementation on GitHub for helping people with a quicker/easier implementation. Link here: https://github.com/Kaedim/API_Implementation

Credentials

In order to use the Kaedim API you will need a devID, an API-key and a refresh token. You can find all three of those by logging in to the web app at https://app.kaedim3d.com and navigating to Settings > API Settings. There you should be able to see all the necessary details. If your keys are not working for any reason don’t hesitate to contact us at [email protected]

Step 1: Registering a webhook

To register a webhook endpoint you will need your API key and developer ID, which can be both found under your user setting page inside the Kaedim platform.
  • Your API key should always be provided in the X-API-Key Header in your post requests.
Register a webhook
Example of registering a webhook using node.js

Parameters

Name
Requirement
Section
Type
Description
X-API-Key
Required
Head
String
User API key used to authenticate requests
devID
Required
Body
String
Your developer ID
Destination
Required
Body
String
Your webhook endpoint url
Please note that the following code is Node.js
import fetch from "node-fetch"
const url = "https://api.kaedim3d.com/api/v1/registerHook"
const headers = {
"Content-Type": "application/json",
"X-API-Key": "your_api_key"
}
const body = {
'devID': 'your_dev_id',
'destination': 'your_endpoint_url'
}
try {
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then((res) => {
res.json().then((data) => {
console.log(data);
});
});
} catch (e) {
}
Please note that the following responses are in JSON
201 Response
{
"status": "success",
"message": "Endpoint is already registered"
"sessionExpireAt": "2022-02-14T14:06:16Z"
"jwt" : "eyJhbGciOiJIUzI1…"
}
404 Response
{
"status": "error",
"message": "Invalid 'devID'"
}
Upon successful authentication you will receive a JWT, which needs to be added as a Bearer Token header on all processing requests. You will also receive a refreshToken to be used to generate a new JWT. Your JWT will expire after 12 hours. See below for how to refresh your token.

Step 2: Processing an image

All processing requests must include the JWT in the Bearer Authorization header, alongside your API-key, and your devID inside the request body. We also support high-detail requests using the high-detail parameter.
Post processing request
Example of sending a processing request in node.js

Parameters

Name
Requirement
Section
Type
Description
X-API-Key
Required
Head
String
User API key used to authenticate requests
Authorization
Required
Head
String
Your valid JWT
devID
Required
Body
String
Your developer ID
imageUrls
Required
Body
Array
An array with up to 6 image urls to be processed. Alternatively you can upload the files themselves
LoQ
Required
Body
String
Level of quality: “standard”/”high”/”ultra”
Test
optional
Body
Boolean
Used to process request as a test
polycount
optional
Body
Number
Upper polycount limit
height
optional
Body
Number
Desired height in cm (default 200)
projectID
optional
Body
String
The ID of the style you want this asset to have, if none it can be left null
Please note that the following code is Node.js
const url = "https://api.kaedim3d.com/api/v1/process"
const headers = {
"X-API-Key": "your_api_key",
"Authorization": "your_JWT"
}
const formData = new FormData();
formData.append('devID', 'your_devID');
formData.append('imageUrls', [url1,url2]);
formData.append('LoQ', 'standard');
formData.append('polycount', 20000);
formData.append('height', 200);
try {
fetch(url, {
method: "POST",
headers,
body:formData,
}).then((res) => {
res.json().then((data) => {
console.log(data);
});
});
} catch (e) {
}
Please note that the following responses are in JSON
201 Response
{
"status": "success",
"requestID": "1248947ds7an-ad98q3yhans92S-2Asda9212",
"message" : "request sent successfully, please check webhook endpoint in 10-15 minutes"
}
400 Response
{
"status": "error",
"requestID": "1248947ds7an-ad98q3yhans92S-2Asda9212",
"message" : "Request failed due to {reason}, please check your payload and headers and try again"
}
Once the asset has been successfully generated, a download URL will be sent to the registered webhook endpoint.
  • Please note that you will need to perform a GET request on the URL's to get the file containing the completed asset.
Each completed asset is available in 4 supported formats obj, fbx, glb, gltf, all of which have separate download links in the post request.
  • Download links expire after an hour.
  • We also provide the functionality to fetch all requests.
We also provide the option for test requests using a boolean test body parameter. If set to true, a plain empty cube will be returned in the response. We recommend using this to get an idea of the structure of the response once an asset is completed.
Upon successful generation you will receive a response similar to the following:
201 Response
{
"status": "success",
"userID" : KaedimUser,
"requestID": "1248947ds7an-ad98q3yhans92S-2Asda9212",
"results" : {
"obj": "https://....."
"fbx": "https://....."
"glb": "https://....."
"gltf": "https://....."
}
}
400 Response
{
"status": "error",
"requestID": "1248947ds7an-ad98q3yhans92S-2Asda9212",
"message" : "Asset creation failed"
"cause" : "The request was too complex, we aim to deal with…"
}
Asset creation may fail due to various reasons some of which include: complexity, visibility of the object, multiple objects in the scene, inappropriate content etc. Please see our guidelines for more information.
Other useful routes
Check the progress and results of your generation
We provide functionality to check the progress of your generation based on the requestID

Parameters

Name
Requirement
Section
Type
Description
X-API-Key
Required
Head
String
User API key used to authenticate requests
Authorization
Required
Head
String
Your valid JWT
devID
Required
Body
String
Your developer ID
requestID
Required
Body
String
Your requestID
Please note that the following code is Node.js
const devID = 'your-devID';
// mm-dd-yy
const start = '02-01-2022';
const end = '02-14-2022';
const url = `https://api.kaedim3d.com/api/v1/fetchRequest`
const headers = {
"X-API-Key": "your_api_key",
"Authorization": "your_JWT"
}
const body = {
"devID": "your_devID",
"requestID": "your_requestID"
}
try {
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then((res) => {
res.json().then((data) => {
console.log(data);
});
});
} catch (e) {
}
Please note that the following responses are in JSON
200 Response
{
"requestID": "81...236",
"createdAt": "202...",
"image": [
"https://s...",
],
"image_tags": [],
"polycount": "20000",
"iterations": [
{
"createdAt": "2023-0...",
"iterationID": "0",
"results": {
"obj": "https://s...",
"fbx": "https://s...",
"glb": "https://s...",
"gltf": "https://s...",
"mtl": "https://s...",
},
"status": "completed",
"userID": "b6e...",
"email": "mar...",
"loq": "standard",
"dismissedReason": null,
"editDescription": null,
"texturingMethod": null
}
, ...]
}

Get All Assets

We provide functionality to retrieve all asset requests (even if they’re pending) based on date ranges (if provided).

Parameters

Name
Requirements
Section
Type
Description
X-API-Key
Required
Head
String
User API key used to authenticate requests
Authorization
Required
Head
String
Your valid JWT
devID
Required
Body
String
Your developer ID
Start,end
Optional
Body
String
Date range provided in MM-DD-YYYY. If left blank all assets associated to the devID will be returned
Please note that the following code is Node.js
const devID = 'your-devID';
// mm-dd-yy
const start = '02-01-2022';
const end = '02-14-2022';
const url = `https://api.kaedim3d.com/api/v1/fetchAll`
const headers = {
"X-API-Key": "your_api_key",
"Authorization": "your_JWT"
}
const body = {
"devID": "your_devID",
"dates": {start, end}
}
try {
fetch(url, {
method: "GET",
headers,
}).then((res) => {
res.json().then((data) => {
console.log(data);
});
});
} catch (e) {
}
Please note that the following responses are in JSON
200 Response
{
"assets": [
{
"requestID": "81...236",
"createdAt": "202...",
"image": [
"https://s...",
],
"image_tags": [],
"polycount": "20000",
"iterations": [
{
"createdAt": "2023-0...",
"iterationID": "0",
"results": {
"obj": "https://s...",
"fbx": "https://s...",
"glb": "https://s...",
"gltf": "https://s...",
"mtl": "https://s...",
},
"status": "completed",
"userID": "b6e...",
"email": "mar...",
"loq": "standard",
"dismissedReason": null,
"editDescription": null,
"texturingMethod": null
}
]
},...
]
}
400 Response
{
"status": "error",
"requestID": "1248947ds7an-ad98q3yhans92S-2Asda9212",
"message" : "Request failed, please check your payload, headers and query paramaters and try again"
"cause": "...."
}

Get All Projects

We provide functionality to retrieve all asset projects names and IDs
Please note that the following code is Node.js
const devID = 'your-devID';
// mm-dd-yy
const url = `https://api.kaedim3d.com/api/v1/fetchAll`
const headers = {
"X-API-Key": "your_api_key",
"Authorization": "your_JWT"
}
const body = {
"devID": "your_devID"
}
try {
fetch(url, {
method: "GET",
headers,
}).then((res) => {
res.json().then((data) => {
console.log(data);
});
});
} catch (e) {
}
Please note that the following responses are in JSON
200 Response
{
"status":"success",
"data": [
{
"projectID": "81...236",
"name": "Sandbox",
},...
]
}

Refreshing a JWT

Your web token will expire after 12 hours from its creation. You can only have one JWT valid at a time, therefore creating a new JWT will automatically invalidate the old token. To get a new JWT you must use the refresh token generated at webhook registration. You can find the refresh token in user settings in the Kaedim platform next to the API-key.

Post a refresh request in node.js

If successful you will receive a new JWT that can also be accessed in your user-settings page inside the Kaedim Platform. Please use this to authenticate any future requests.

Parameters

Name
Requirments
Section
Type
Description
X-API-Key
Required
Head
String
User API key used to authenticate requests
refresh-token
Required
Head
String
Token used to generate more JWT’s
devID
Required
Body
String
Your developer ID
Please note that the following code is Node.js
const url = "https://api.kaedim3d.com/api/v1/refreshJWT"
const headers = {
"Content-Type": "application/json",
"X-API-Key": "your_api_key",
"refresh-token": "your-refresh-token"
}
const body = {
'devID': 'your_dev_id',
}
try {
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then((res) => {
res.json().then((data) => {
console.log(data);
});
});
} catch (e) {
}
Please note that the following responses are in JSON
200 Response
{
"status": "success",
"message": "JWT refreshed successfully. Please use the new JWT and devID to authenticate your future requests",
"jwt": "eyJhaU.....",
"devID": "609d43109ff0b252cce4bc6e"
}
400 Response
{
"status": "error",
"requestID": "1248947ds7an-ad98q3yhans92S-2Asda9212",
"message" : "Request failed, please check your api-key and refresh-token and try again"
"cause": "...."
}

Error Codes

We use normal HTTP codes to indicate the success or failure of your API requests. If your request fails, Kaedim will return an appropriate error message.
Field Name
Type
Description
Status
String
Short string describing the status of the request. Generally "success" or "error".
Message
String
Short human-readable string giving more context on the reason the error occurred.
Cause
Optional <object>
Optional cause of the error, for example if the request image has been denied for a specfic reason.

Async Texturing

In order to texture a model, you can use the following route:
https://api.kaedim3d.com/api/v1/asyncTexturing
Field Name
Requirements
Section
Type
Description
X-API-Key
Required
Header
String
User API key used to authenticate requests
Authorization
Required
Header
String
Your valid JWT
devID
Required
Body
String
Your devID
requestID
Required
Body
String
The requestID of the asset you want to texture
iteration
Required
Body
String
The iterationID of the asset you want to texture
resolution
Required
Body
String
The resolution you want to texture for. Valid values:
  • '512'
  • '1024'
  • '2048'
  • '4096'
method
Required
Body
String
The texturing method you want to use. Valid values:
  • 'colors'
  • 'granularVC'
  • 'projection'
  • 'materials'
  • 'pbr'
front
Required
Body
.png/.jpeg file
An image file for the front view of the model
back
Optional
Body
.png/.jpeg file
An image file for the back view of the model
left
Optional
Body
.png/.jpeg file
An image file for the left view of the model
right
Optional
Body
.png/.jpeg file
An image file for the right view of the model
top
Optional
Body
.png/.jpeg file
An image file for the top view of the model
Please note that the following code is Node.js
const url = "https://api.kaedim3d.com/api/v1/asyncTexturing"
const headers = {
"X-API-Key": "your_api_key",
"Authorization": "your_JWT"
}
const formData = new FormData();
const frontImage = // Get your image file;
formData.append('devID', 'your_devID');
formData.append('requestID', 'asset_history_id');]
formData.append('iteration', 'asset_iteration_id');
formData.append('resolution', 'desired_resolution');
formData.append('method', 'texturing_method');
formData.append('front', frontImage);
formData.append('back', 'back_image'); // Same as frontImage but different file
formData.append('left', 'left_image');
formData.append('right', 'right_image');
formData.append('top', 'top_image');
try {
fetch(url, {
method: "POST",
headers,
body:formData,
}).then((res) => {
res.json().then((data) => {
console.log(data);
});
});
} catch (e) {
}
201 Response
If your request is successful you will receive an empty 201 Response
400 Response
If your request fails, you will receive an error in the following format:
{
"status": "error",
"message": "👀 Oops! Please wait until your iteration of this 3D model is finished to request texturing."
}