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.
{"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 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.
consturl="https://api.kaedim3d.com/api/v1/process"constheaders= {"X-API-Key":"your_api_key","Authorization":"your_JWT"}constformData=newFormData();formData.append('devID','your_devID');formData.append('imageUrls', [url1,url2]);formData.append('LoQ','standard');formData.append('polycount',20000);formData.append('height',200);formData.append('test',true) // Turn this to false to pass a normal requesttry {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"}
406 Response
{"status":"error","message":"Invalid level of quality inputed"}
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:
{"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: 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
{"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
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.)
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.