Documentation
JT から glTF への REST API | CADCON
CADCON REST API で Siemens JT ファイルを変換。認証、アップロード、変換状況の確認、glTF・GLB のダウンロードをコード例で解説します。
Authentication
All API requests require an API key sent as a request header. Your API key is available in your Workspace.
Header
X-Api-Key: YOUR_API_KEYSign in to see your personal API key in the examples below.
POST /api/convert
Convert a JT file to glTF, GLB, or both formats. Uses 1 credit per conversion.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The .jt file to convert |
format | string | No | gltf (default), glb, or both |
curl
bash
# Convert a JT file to glTF
curl -X POST https://cadcon.io/api/convert \
-H "X-Api-Key: YOUR_API_KEY" \
-F "[email protected]" \
-F "outputFormat=gltf"JavaScript (fetch)
javascript
const form = new FormData()
form.append('file', fileInput.files[0])
form.append('outputFormat', 'glb')
const res = await fetch('/api/convert', {
method: 'POST',
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
body: form
})
const { gltfUrl, binUrl, glbUrl } = await res.json()Python
python
import requests
with open('model.jt', 'rb') as f:
r = requests.post(
'https://cadcon.io/api/convert',
headers={'X-Api-Key': 'YOUR_API_KEY'},
files={'file': f},
data={'outputFormat': 'glb'}
)
data = r.json()
print(data['glbUrl'])Response
json
{
"jobId": 42,
"status": "Completed",
"fileName": "model",
"gltfUrl": "/api/files/<token>",
"binUrl": "/api/files/<token>",
"glbUrl": null
}GET /api/jobs
Returns your 20 most recent completed conversions with download URLs.
curl
bash
# List previous conversions
curl https://cadcon.io/api/jobs \
-H "X-Api-Key: YOUR_API_KEY"Response
json
[
{
"id": 42,
"originalFileName": "part.jt",
"outputFormat": "gltf",
"completedAt": "2025-06-01T10:30:00Z",
"creditsUsed": 1,
"gltfUrl": "/api/files/<token>",
"binUrl": "/api/files/<token>",
"glbUrl": null
}
]GET /api/files/{token}
Download a converted file using the token returned by /api/convert or /api/jobs. Tokens expire after 24 hours.
bash
curl https://cadcon.io/api/files/<token> \
-H "X-Api-Key: YOUR_API_KEY" \
-o model.gltf.NET NuGet Package
Use the Cadcon.Conversion NuGet package to convert JT files locally in your .NET application — no HTTP calls, no file uploads. One credit is deducted per conversion via the Cadcon API.
Install
bash
dotnet add package Cadcon.ConversionConvert locally (offline)
csharp
using Cadcon.Conversion;
var converter = new JtConverter();
var result = converter.Convert("part.jt", "part.glb", new JtConversionOptions { WriteGlb = true });
if (result.Success)
Console.WriteLine($"Done: {result.VertexCount} verts, {result.TriangleCount} tris");
else
Console.WriteLine($"Error: {result.ErrorMessage}");Convert with API key (metered)
Validate your key and fetch credits on startup, then deduct 1 credit per conversion.
csharp
using Cadcon.Conversion;
// Validate key + fetch credits on startup
var client = await CadconApiClient.CreateAsync("YOUR_API_KEY");
Console.WriteLine($"Credits: {client.Credits}");
// 1 credit deducted per Convert() call
var converter = new JtConverter(client);
var result = converter.Convert("part.jt", "part.glb", new JtConversionOptions { WriteGlb = true });
Console.WriteLine($"Credits remaining: {client.Credits}");Error Codes
| Status | Meaning |
|---|---|
400 | Bad request — invalid file or parameters |
401 | Unauthorized — missing or invalid API key |
402 | Payment required — insufficient credits |
500 | Conversion failed — see error message |