Web API
We wrote an example Python script here that illustrates how to interface with our API.
We've also created a simple React app implementation on GitHub to help people with a quicker/easier implementation.
Link here: https://github.com/Kaedim/API_Implementation
Credentials
To use the Kaedim API, you will need a devID, an API-key, and a refresh token.
You can find all three of these by logging in to the web app at https://app.kaedim3d.com and navigating to Settings > API Keys. There you should be able to see all the necessary info.
If your keys are not working for any reason, don’t hesitate to contact us at support@kaedim3d.com.
API Access is reserved for Enterprise customers.
Please note that clicking Copy on API Key, Kaedim Secret and Refresh Token, generates new values for these fields, making their previous values invalid!
Step 1: Registering a webhook
To register a webhook endpoint you will need your API key and developer ID. Both of these can be found under your user settings page in the Kaedim app.
Your API key should always be provided in the X-API-Key Header in your post requests.
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
201 Response
404 Response
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 on 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.
Post processing request
Parameters
Name | Requirement | Section | Type | Description |
---|---|---|---|---|
X-API-Key | Required | Head | String | User API key used to authenticate requests |
Authorization | Required | Head | String | |
devID | Required | Body | String | |
imageUrls/images | Required | Body | Array | |
LoQ | Required | Body | String | |
test | optional | Body | Boolean | |
polycount | optional | Body | Number | |
height | optional | Body | Number | |
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
Please note that the following responses are in JSON
201 Response
400 Response
406 Response
Please note that there is a 5MB limit per image file.
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 URLs to get the file containing the completed asset
Each completed asset is available in 4 supported formats: obj, fbx, glb, and gltf all of which have separate download links in the post request.
Download links expire after an hour
We 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
400 Response
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: Input Guidelines
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
Please note that the following responses are in JSON
200 Response
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 | |
Authorization | Required | Head | String | |
devID | Required | Body | String | |
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
Please note that the following responses are in JSON
200 Response
400 Response
Get All Projects
We provide functionality to retrieve all asset projects names and IDs
Please note that the following code is Node.js
Please note that the following responses are in JSON
200 Response
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 below the API-key.
Post a refresh request in node.js
If successful, you will receive a new JWT that will allow you to make API requests that require authentication (such as /process etc.)
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
Please note that the following responses are in JSON
200 Response
400 Response
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:
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:
|
method | Required | Body | String | The texturing method you want to use. Valid values:
|
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
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:
Last updated