Introduction
Make your 3D content fit all platforms
Welcome to our API documentation!
This documentation describes the usage of the Rapidcompact API endpoints which enable the upload of base assets, the optimization of a base asset and the download of the optimized rapid model.
Base URL
https://api.rapidcompact.com
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can create your API token here.
API Tokens
Get Tokens
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/user/tokens" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/tokens"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/tokens'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
[
{
"id": 222,
"tokenable_type": "App\\Models\\User",
"tokenable_id": 303,
"name": "name of api token",
"abilities": [
"*"
],
"last_used_at": "2021-09-01T11:21:22.000000Z",
"created_at": "2021-09-01T10:26:57.000000Z",
"updated_at": "2021-09-01T11:21:22.000000Z",
"plain_text": ""
}
]
Received response:
Request failed with error:
Create Token
requires authentication
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/user/tokens" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"name of new api token\"
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/tokens"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "name of new api token"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/tokens'
payload = {
"name": "name of new api token"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
234|y5NGBTJk5OX5Zva5RfxTz0GkXEL9axN79vTfsJOH
Received response:
Request failed with error:
Delete Token
requires authentication
Example request:
curl --request DELETE \
"https://api.rapidcompact.com/api/v1/user/tokens/42" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/tokens/42"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/tokens/42'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Received response:
Request failed with error:
Get Token
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/user/tokens/42" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/tokens/42"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/tokens/42'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
{
"id": 1,
"tokenable_type": "App\\Models\\User",
"tokenable_id": 45,
"name": "name of api token",
"abilities": [
"*"
],
"last_used_at": null,
"created_at": "2021-10-26T10:38:07.000000Z",
"updated_at": "2021-10-26T10:38:07.000000Z",
"plain_text": ""
}
Received response:
Request failed with error:
Base Asset
Get Running Jobs
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/rawmodel/jobs" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/jobs"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/jobs'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
{
"data": [
{
"id": 5812,
"name": "TVBench",
"optimization_status": "failed",
"job_status": {
"id": 3601,
"job_id": "edab51b2-1c47-4a0f-b807-58e913dbabc9",
"type": "App\\Jobs\\ProcessRawModel",
"queue": "default",
"attempts": 1,
"progress_now": 100,
"progress_max": 100,
"status": "finished",
"input": null,
"output": "{\"exit_code\":1}",
"created_at": "2021-10-11 20:08:52",
"updated_at": "2021-10-11 20:08:53",
"started_at": "2021-10-11 20:08:52",
"finished_at": "2021-10-11 20:08:53",
"key": "rapid_model:5812"
},
"progress": 100,
"processing_step": "Done",
"external": false,
"rawmodel": {
"id": 2257,
"name": "TVBench"
}
}
]
}
Received response:
Request failed with error:
Process [Deprecated]
requires authentication
Please use the optimize endpoint instead
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/rawmodel/process/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"config\": {
\"workflowSettings\": {
\"targetMeshResolution\": {
\"faceCount\": 30000
},
\"targetTextureResolution\": {
\"baseColor\": 2048,
\"emissive\": 2048,
\"normal\": 2048,
\"orm\": 2048
}
},
\"assetSimplification\": {
\"meshDecimation\": {
\"method\": \"rebake\"
},
\"topologySettings\": {
\"vertexMergingDistance\": 0.005,
\"meshDensityEqualization\": 0,
\"boundaryPreservationFactor\": 0.5
},
\"uvAndAtlasSettings\": {
\"uvStretchTolerance\": 0
},
\"materialAndTextureBaking\": {
\"bakingQuality\": \"medium\",
\"bakeNormalMap\": true,
\"bakeAOMap\": false
}
},
\"compressionAndExport\": {
\"fileExports\": [
{
\"fileType\": \"glb\",
\"meshCompressionMethod\": \"none\",
\"customScaling\": 1,
\"textureFormat\": {
\"baseColor\": \"auto\",
\"emissive\": \"auto\",
\"normal\": \"png\",
\"orm\": \"auto\"
}
}
]
}
},
\"rapidCompactCoreVersion\": \"5.2.0\"
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/process/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
},
"rapidCompactCoreVersion": "5.2.0"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/process/281'
payload = {
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
},
"rapidCompactCoreVersion": "5.2.0"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Optimize
requires authentication
The "Try it out" feature for this endpoint doesn't work, because the config gets sent as a string, but it needs to be a json object. Please check the example request on the right side
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/rawmodel/optimize/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"config\": {
\"workflowSettings\": {
\"targetMeshResolution\": {
\"faceCount\": 30000
},
\"targetTextureResolution\": {
\"baseColor\": 2048,
\"emissive\": 2048,
\"normal\": 2048,
\"orm\": 2048
}
},
\"assetSimplification\": {
\"meshDecimation\": {
\"method\": \"rebake\"
},
\"topologySettings\": {
\"vertexMergingDistance\": 0.005,
\"meshDensityEqualization\": 0,
\"boundaryPreservationFactor\": 0.5
},
\"uvAndAtlasSettings\": {
\"uvStretchTolerance\": 0
},
\"materialAndTextureBaking\": {
\"bakingQuality\": \"medium\",
\"bakeNormalMap\": true,
\"bakeAOMap\": false
}
},
\"compressionAndExport\": {
\"fileExports\": [
{
\"fileType\": \"glb\",
\"meshCompressionMethod\": \"none\",
\"customScaling\": 1,
\"textureFormat\": {
\"baseColor\": \"auto\",
\"emissive\": \"auto\",
\"normal\": \"png\",
\"orm\": \"auto\"
}
}
]
}
},
\"tags\": [
\"Low-Poly\",
\"MyTag\"
],
\"rapidCompactCoreVersion\": \"5.2.0\"
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/optimize/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
},
"tags": [
"Low-Poly",
"MyTag"
],
"rapidCompactCoreVersion": "5.2.0"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/optimize/281'
payload = {
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
},
"tags": [
"Low-Poly",
"MyTag"
],
"rapidCompactCoreVersion": "5.2.0"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
{
"id": 281,
"name": "teapot.obj",
"optimization_status": "sent_to_queue",
"job_status": {
"id": 518,
"job_id": null,
"type": "App\\Jobs\\ProcessRawModel",
"queue": null,
"attempts": 0,
"progress_now": 0,
"progress_max": 0,
"status": "queued",
"input": null,
"output": null,
"created_at": "2021-02-15T13:34:52.000000Z",
"updated_at": "2021-02-15T13:34:52.000000Z",
"started_at": null,
"finished_at": null,
"key": "rapid_model:624"
},
"progress": 0,
"processing_step": "Scheduled for processing",
"external": null,
"rawmodel": {
"id": 282,
"name": "teapot.obj",
"processing": true
}
}
Received response:
Request failed with error:
Get Base Asset
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/rawmodel/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/281'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": {
"id": 281,
"name": "teapot",
"processing": false,
"external": false,
"upload_status": "complete",
"size": 438680,
"created_at": "2021-02-08T16:59:52+01:00",
"rapid_models": [
635,
617
],
"scale_factor": "10",
"tags": []
"downloads": {
"error.log": "signed url for the error.log",
"info.log": "signed url for info.log",
"metrics.json": "signed url for the metrics.json",
"rpd_info.json": "signed url for the rpd_info.json",
"teapot.obj": "signed url for the teapot.obj",
"thumb.jpg": "signed url for the thumb.jpg"
}
}
}
Received response:
Request failed with error:
Delete Base Asset
requires authentication
Example request:
curl --request DELETE \
"https://api.rapidcompact.com/api/v1/rawmodel/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/281'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Delete Tag of a Base Asset
requires authentication
Update Base Asset
requires authentication
Example request:
curl --request PUT \
"https://api.rapidcompact.com/api/v1/rawmodel/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"scale_factor\": 0.5,
\"tags\": [
\"low poly\",
\"mb target\"
]
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"scale_factor": 0.5,
"tags": [
"low poly",
"mb target"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/281'
payload = {
"scale_factor": 0.5,
"tags": [
"low poly",
"mb target"
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Delete Multiple Base Assets
requires authentication
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/rawmodel/delete" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": [
726,
324
]
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": [
726,
324
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/delete'
payload = {
"ids": [
726,
324
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Create Base Asset - Get Upload Link
requires authentication
Calling this endpoint will return an id for the new base asset and presigned URLs which need to be used to upload the files directly to our storage. The URLs are unique for every file. The "complete_upload" field will contain a link to the complete upload endpoint that needs to be called when the upload is done
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/rawmodel/api-upload/start" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"model_name\": \"teapot\",
\"filenames\": [
\"mymodel.glb\",
\"material.mat\"
]
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/api-upload/start"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"model_name": "teapot",
"filenames": [
"mymodel.glb",
"material.mat"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/api-upload/start'
payload = {
"model_name": "teapot",
"filenames": [
"mymodel.glb",
"material.mat"
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
{
"id": 1,
"links": {
"s3_upload_urls": {
"mymodel.glb": "signed url for mymodel.glb",
"material.mat": "signed url for material.mat"
},
"complete_upload": "https://api.rapidcompact.com/api/rawmodels/1/api-upload/complete"
}
}
Received response:
Request failed with error:
Create Base Asset - Complete Upload
requires authentication
Call this endpoint with the received base asset id from the get upload link endpoint after uploading the base asset files.
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/rawmodel/281/api-upload/complete" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/281/api-upload/complete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/281/api-upload/complete'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": {
"id": 281,
"name": "teapot",
"processing": false,
"upload_status": "complete",
"size": 438680,
"created_at": "2021-02-08T16:59:52+01:00",
"rapid_models": [
635,
617
],
"scale_factor": "10",
"downloads": {
"error.log": "signed url for the error.log",
"info.log": "signed url for the info.log",
"metrics.json": "signed url for the metrics.json",
"rpd_info.json": "signed url for the rpd_info.json",
"teapot.obj": "signed url for the uploaded file",
"thumb.jpg": "signed url for the thumb.jpg"
}
}
}
Received response:
Request failed with error:
Get Rapid Models
requires authentication
Get all rapid models which were optimized from this base asset
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/rawmodel/1/rapidmodels" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rawmodel/1/rapidmodels"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rawmodel/1/rapidmodels'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": [
{
"id": 1,
"name": "teapot",
"optimization_status": "done",
"rawmodel": {...},
"job_status": {...},
"created_at": "2021-02-16T16:50:41+01:00",
"updated_at": "2021-02-16T16:50:53+01:00",
"progress": 100,
"processing_step": "Done",
"external": false,
"rapid_compact_core_version": "5.2.0",
"tags": [],
"export_name": "export name",
"uuid": "d8316d1f-3c7d-4777-b72e-c760064f9d08",
"accepted": false,
"meta": {
"size": 573420,
"exportSize": 1029548
},
"thumbnail": {},
"rpd_info": "signed url for the rpd_info.json",
"rpd_warnings": "signed url for the warning.log",
"rpd_error": "signed url for the error.log",
"downloads": {
"glb": "signed url for the .glb"
}
}
]
}
Received response:
Request failed with error:
Embeds
Get Embeds
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/embeds" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/embeds"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/embeds'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
{
"data": [
{
"id": 371,
"name": "Foo",
"thumbnail": {
"first": "signed url for the thumbnail",
"turntable": "signed url for the turntable"
},
"embeds": [
{
"id": 163,
"name": "Foo Embed",
"url": "https://api.rapidcompact.com/viewer?id=123456",
"view_count": 0,
"created_at": "2021-10-25T19:38:00.000000Z"
}
]
}
]
}
Received response:
Request failed with error:
Create Embed
requires authentication
Create an embed from a rapid model
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/embeds" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"model_id\": 281,
\"name\": \"\\\"my embeds name\\\"\",
\"save_user_theme\": true,
\"config\": \"{\\n \\\"renderCanvasCSS\\\" : \\\"background:;\\\",\\n \\\"environmentURL\\\" : \\\"images\\/environment.dds\\\",\\n \\\"companyLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\\\",\\n \\\"companyLogoToggle\\\" : \\\"true\\\",\\n \\\"companyLink\\\" : \\\"https:\\/\\/dgg3d.com\\\",\\n \\\"companyLogoCSS\\\" : \\\"width:120px;height:71.3004px;background:;\\\",\\n \\\"productLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\\\",\\n \\\"productLogoToggle\\\" : \\\"true\\\",\\n \\\"productLink\\\" : \\\"https:\\/\\/rapidcompact.com\\\",\\n \\\"productLogoCSS\\\" : \\\"width:120px;height:21.4819px;background:;\\\",\\n \\\"threeDLogo\\\" : \\\"data:image\\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\\\",\\n \\\"threeDLogoToggle\\\" : \\\"true\\\",\\n \\\"threeDLogoCSS\\\" : \\\"width:24px;height:24px;background:;\\\",\\n \\\"interactiveToolsCSS\\\" : \\\"background:;\\\",\\n \\\"skyBoxEnabled\\\" : \\\"false\\\",\\n \\\"skyBoxBlur\\\" : \\\"0\\\",\\n \\\"shadowToggle\\\" : \\\"false\\\",\\n \\\"shadowOpacity\\\" : \\\"0.5\\\",\\n \\\"shadowBlur\\\" : \\\"0\\\",\\n \\\"shadowLightIntensity\\\" : \\\"0.3\\\",\\n \\\"cameraMinVerticalAngle\\\" : \\\"-90\\\",\\n \\\"cameraMaxVerticalAngle\\\" : \\\"90\\\",\\n \\\"cameraMinZoom\\\" : \\\"1\\\",\\n \\\"cameraMaxZoom\\\" : \\\"6\\\",\\n \\\"cameraPanning\\\" : \\\"0.5\\\",\\n \\\"cameraBloom\\\" : \\\"0\\\",\\n \\\"cameraContrast\\\" : \\\"1\\\",\\n \\\"cameraExposure\\\" : \\\"1\\\",\\n \\\"fxaaOn\\\" : \\\"true\\\",\\n \\\"enableSimpleMeasurement\\\" : \\\"false\\\",\\n \\\"enableCoordinateDisplay\\\" : \\\"false\\\",\\n \\\"baseUnit\\\" : \\\"m\\\",\\n \\\"displayUnit\\\" : \\\"m\\\",\\n \\\"enableARBtn\\\" : \\\"false\\\",\\n \\\"enableAnimationControl\\\" : \\\"false\\\",\\n \\\"animationSpeed\\\" : \\\"1\\\",\\n \\\"animationIdleTime\\\" : \\\"5\\\",\\n \\\"backgroundIsGradient\\\" : \\\"false\\\",\\n \\\"backgroundIsColor\\\" : \\\"false\\\",\\n \\\"gradientBackgroundColor1\\\" : \\\"#ffffff\\\",\\n \\\"gradientBackgroundColor2\\\" : \\\"#aaaaaa\\\",\\n \\\"plainBackgroundColor\\\" : \\\"#ffffff\\\",\\n \\\"environmentName\\\" : \\\"studio_small\\\",\\n \\\"baseUnits\\\" : \\\"m,cm,mm,yd,ft,in\\\",\\n \\\"displayUnits\\\" : \\\"m,cm,mm,yd,ft,in\\\"\\n}\"
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/embeds"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"model_id": 281,
"name": "\"my embeds name\"",
"save_user_theme": true,
"config": "{\n \"renderCanvasCSS\" : \"background:;\",\n \"environmentURL\" : \"images\/environment.dds\",\n \"companyLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\",\n \"companyLogoToggle\" : \"true\",\n \"companyLink\" : \"https:\/\/dgg3d.com\",\n \"companyLogoCSS\" : \"width:120px;height:71.3004px;background:;\",\n \"productLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\",\n \"productLogoToggle\" : \"true\",\n \"productLink\" : \"https:\/\/rapidcompact.com\",\n \"productLogoCSS\" : \"width:120px;height:21.4819px;background:;\",\n \"threeDLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\",\n \"threeDLogoToggle\" : \"true\",\n \"threeDLogoCSS\" : \"width:24px;height:24px;background:;\",\n \"interactiveToolsCSS\" : \"background:;\",\n \"skyBoxEnabled\" : \"false\",\n \"skyBoxBlur\" : \"0\",\n \"shadowToggle\" : \"false\",\n \"shadowOpacity\" : \"0.5\",\n \"shadowBlur\" : \"0\",\n \"shadowLightIntensity\" : \"0.3\",\n \"cameraMinVerticalAngle\" : \"-90\",\n \"cameraMaxVerticalAngle\" : \"90\",\n \"cameraMinZoom\" : \"1\",\n \"cameraMaxZoom\" : \"6\",\n \"cameraPanning\" : \"0.5\",\n \"cameraBloom\" : \"0\",\n \"cameraContrast\" : \"1\",\n \"cameraExposure\" : \"1\",\n \"fxaaOn\" : \"true\",\n \"enableSimpleMeasurement\" : \"false\",\n \"enableCoordinateDisplay\" : \"false\",\n \"baseUnit\" : \"m\",\n \"displayUnit\" : \"m\",\n \"enableARBtn\" : \"false\",\n \"enableAnimationControl\" : \"false\",\n \"animationSpeed\" : \"1\",\n \"animationIdleTime\" : \"5\",\n \"backgroundIsGradient\" : \"false\",\n \"backgroundIsColor\" : \"false\",\n \"gradientBackgroundColor1\" : \"#ffffff\",\n \"gradientBackgroundColor2\" : \"#aaaaaa\",\n \"plainBackgroundColor\" : \"#ffffff\",\n \"environmentName\" : \"studio_small\",\n \"baseUnits\" : \"m,cm,mm,yd,ft,in\",\n \"displayUnits\" : \"m,cm,mm,yd,ft,in\"\n}"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/embeds'
payload = {
"model_id": 281,
"name": "\"my embeds name\"",
"save_user_theme": true,
"config": "{\n \"renderCanvasCSS\" : \"background:;\",\n \"environmentURL\" : \"images\/environment.dds\",\n \"companyLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...kSuQmCC\",\n \"companyLogoToggle\" : \"true\",\n \"companyLink\" : \"https:\/\/dgg3d.com\",\n \"companyLogoCSS\" : \"width:120px;height:71.3004px;background:;\",\n \"productLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUh...ASUVORK5CYII=\",\n \"productLogoToggle\" : \"true\",\n \"productLink\" : \"https:\/\/rapidcompact.com\",\n \"productLogoCSS\" : \"width:120px;height:21.4819px;background:;\",\n \"threeDLogo\" : \"data:image\/png;base64,iVBORw0KGgoAAAANSUhEU...OAAAAAElFTkSuQmCC\",\n \"threeDLogoToggle\" : \"true\",\n \"threeDLogoCSS\" : \"width:24px;height:24px;background:;\",\n \"interactiveToolsCSS\" : \"background:;\",\n \"skyBoxEnabled\" : \"false\",\n \"skyBoxBlur\" : \"0\",\n \"shadowToggle\" : \"false\",\n \"shadowOpacity\" : \"0.5\",\n \"shadowBlur\" : \"0\",\n \"shadowLightIntensity\" : \"0.3\",\n \"cameraMinVerticalAngle\" : \"-90\",\n \"cameraMaxVerticalAngle\" : \"90\",\n \"cameraMinZoom\" : \"1\",\n \"cameraMaxZoom\" : \"6\",\n \"cameraPanning\" : \"0.5\",\n \"cameraBloom\" : \"0\",\n \"cameraContrast\" : \"1\",\n \"cameraExposure\" : \"1\",\n \"fxaaOn\" : \"true\",\n \"enableSimpleMeasurement\" : \"false\",\n \"enableCoordinateDisplay\" : \"false\",\n \"baseUnit\" : \"m\",\n \"displayUnit\" : \"m\",\n \"enableARBtn\" : \"false\",\n \"enableAnimationControl\" : \"false\",\n \"animationSpeed\" : \"1\",\n \"animationIdleTime\" : \"5\",\n \"backgroundIsGradient\" : \"false\",\n \"backgroundIsColor\" : \"false\",\n \"gradientBackgroundColor1\" : \"#ffffff\",\n \"gradientBackgroundColor2\" : \"#aaaaaa\",\n \"plainBackgroundColor\" : \"#ffffff\",\n \"environmentName\" : \"studio_small\",\n \"baseUnits\" : \"m,cm,mm,yd,ft,in\",\n \"displayUnits\" : \"m,cm,mm,yd,ft,in\"\n}"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (201, success):
Received response:
Request failed with error:
Delete Embed
requires authentication
Example request:
curl --request DELETE \
"https://api.rapidcompact.com/api/v1/embeds/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/embeds/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/embeds/281'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (204, success):
[Empty response]
Received response:
Request failed with error:
Presets
Create Preset
requires authentication
The "Try it out" feature for this endpoint doesn't work, because the config gets sent as a string, but it needs to be a json object. Please check the example request on the right side
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/preset/create" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"name of the new preset\",
\"rapidCompactCoreVersion\": \"5.2.0\",
\"config\": {
\"workflowSettings\": {
\"targetMeshResolution\": {
\"faceCount\": 30000
},
\"targetTextureResolution\": {
\"baseColor\": 2048,
\"emissive\": 2048,
\"normal\": 2048,
\"orm\": 2048
}
},
\"assetSimplification\": {
\"meshDecimation\": {
\"method\": \"rebake\"
},
\"topologySettings\": {
\"vertexMergingDistance\": 0.005,
\"meshDensityEqualization\": 0,
\"boundaryPreservationFactor\": 0.5
},
\"uvAndAtlasSettings\": {
\"uvStretchTolerance\": 0
},
\"materialAndTextureBaking\": {
\"bakingQuality\": \"medium\",
\"bakeNormalMap\": true,
\"bakeAOMap\": false
}
},
\"compressionAndExport\": {
\"fileExports\": [
{
\"fileType\": \"glb\",
\"meshCompressionMethod\": \"none\",
\"customScaling\": 1,
\"textureFormat\": {
\"baseColor\": \"auto\",
\"emissive\": \"auto\",
\"normal\": \"png\",
\"orm\": \"auto\"
}
}
]
}
}
}"
const url = new URL(
"https://api.rapidcompact.com/api/preset/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "name of the new preset",
"rapidCompactCoreVersion": "5.2.0",
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/preset/create'
payload = {
"name": "name of the new preset",
"rapidCompactCoreVersion": "5.2.0",
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
}
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Update Preset
requires authentication
The "Try it out" feature for this endpoint doesn't work, because the config gets sent as a string, but it needs to be a json object. Please check the example request on the right side
Example request:
curl --request PATCH \
"https://api.rapidcompact.com/api/preset/update" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 42,
\"name\": \"name of the new preset\",
\"config\": {
\"workflowSettings\": {
\"targetMeshResolution\": {
\"faceCount\": 30000
},
\"targetTextureResolution\": {
\"baseColor\": 2048,
\"emissive\": 2048,
\"normal\": 2048,
\"orm\": 2048
}
},
\"assetSimplification\": {
\"meshDecimation\": {
\"method\": \"rebake\"
},
\"topologySettings\": {
\"vertexMergingDistance\": 0.005,
\"meshDensityEqualization\": 0,
\"boundaryPreservationFactor\": 0.5
},
\"uvAndAtlasSettings\": {
\"uvStretchTolerance\": 0
},
\"materialAndTextureBaking\": {
\"bakingQuality\": \"medium\",
\"bakeNormalMap\": true,
\"bakeAOMap\": false
}
},
\"compressionAndExport\": {
\"fileExports\": [
{
\"fileType\": \"glb\",
\"meshCompressionMethod\": \"none\",
\"customScaling\": 1,
\"textureFormat\": {
\"baseColor\": \"auto\",
\"emissive\": \"auto\",
\"normal\": \"png\",
\"orm\": \"auto\"
}
}
]
}
}
}"
const url = new URL(
"https://api.rapidcompact.com/api/preset/update"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 42,
"name": "name of the new preset",
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
}
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/preset/update'
payload = {
"id": 42,
"name": "name of the new preset",
"config": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
}
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PATCH', url, headers=headers, json=payload)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Convert Preset
requires authentication
Convert a preset in API format to CLI format. The endpoint will return a zip file containing the requested files. The "Try it out" feature for this endpoint doesn't work, because the config gets sent as a string, but it needs to be a json object. Please check the example request on the right side
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/preset/rpdx" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"preset\": {
\"workflowSettings\": {
\"targetMeshResolution\": {
\"faceCount\": 30000
},
\"targetTextureResolution\": {
\"baseColor\": 2048,
\"emissive\": 2048,
\"normal\": 2048,
\"orm\": 2048
}
},
\"assetSimplification\": {
\"meshDecimation\": {
\"method\": \"rebake\"
},
\"topologySettings\": {
\"vertexMergingDistance\": 0.005,
\"meshDensityEqualization\": 0,
\"boundaryPreservationFactor\": 0.5
},
\"uvAndAtlasSettings\": {
\"uvStretchTolerance\": 0
},
\"materialAndTextureBaking\": {
\"bakingQuality\": \"medium\",
\"bakeNormalMap\": true,
\"bakeAOMap\": false
}
},
\"compressionAndExport\": {
\"fileExports\": [
{
\"fileType\": \"glb\",
\"meshCompressionMethod\": \"none\",
\"customScaling\": 1,
\"textureFormat\": {
\"baseColor\": \"auto\",
\"emissive\": \"auto\",
\"normal\": \"png\",
\"orm\": \"auto\"
}
}
]
}
}
}"
const url = new URL(
"https://api.rapidcompact.com/api/preset/rpdx"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"preset": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/preset/rpdx'
payload = {
"preset": {
"workflowSettings": {
"targetMeshResolution": {
"faceCount": 30000
},
"targetTextureResolution": {
"baseColor": 2048,
"emissive": 2048,
"normal": 2048,
"orm": 2048
}
},
"assetSimplification": {
"meshDecimation": {
"method": "rebake"
},
"topologySettings": {
"vertexMergingDistance": 0.005,
"meshDensityEqualization": 0,
"boundaryPreservationFactor": 0.5
},
"uvAndAtlasSettings": {
"uvStretchTolerance": 0
},
"materialAndTextureBaking": {
"bakingQuality": "medium",
"bakeNormalMap": true,
"bakeAOMap": false
}
},
"compressionAndExport": {
"fileExports": [
{
"fileType": "glb",
"meshCompressionMethod": "none",
"customScaling": 1,
"textureFormat": {
"baseColor": "auto",
"emissive": "auto",
"normal": "png",
"orm": "auto"
}
}
]
}
}
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
<Zip File> Streamed Response
Received response:
Request failed with error:
Get Preset in CLI Format
requires authentication
The endpoint will return a zip file containing the requested files
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/preset/rpdx/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/preset/rpdx/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/preset/rpdx/281'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
<Zip File> Streamed Response
Received response:
Request failed with error:
Get Preset
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/preset/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/preset/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/preset/281'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
{
"id": 11,
"name": "preset 2",
"config": "{\"workflowSettings\":{\"targetMeshResolution\":{\"facePercentage\":50},\"targetTextureResolution\":{\"baseColor\":2048,\"emissive\":2048,\"normal\":2048,\"orm\":2048}},\"assetSimplification\":{\"meshDecimation\":{\"method\":\"rebake\"},\"topologySettings\":{\"vertexMergingDistance\":0.005,\"meshDensityEqualization\":0,\"boundaryPreservationFactor\":0.5},\"uvAndAtlasSettings\":{\"uvStretchTolerance\":0},\"materialAndTextureBaking\":{\"bakingQuality\":\"medium\",\"bakeNormalMap\":true,\"bakeAOMap\":false}},\"compressionAndExport\":{\"fileExports\":[{\"fileType\":\"glb\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}},{\"fileType\":\"usdz\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}}]}}",
"rpdx_version": "4.4.0",
"user_id": 328,
"created_at": "2021-04-22T09:11:30.000000Z",
"updated_at": "2021-04-22T09:11:30.000000Z"
}
Received response:
Request failed with error:
Delete Preset
requires authentication
Example request:
curl --request DELETE \
"https://api.rapidcompact.com/api/preset/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/preset/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/preset/281'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Get all Presets
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/preset" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/preset"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/preset'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
[
{
"id": 11,
"name": "preset 2",
"config": "{\"workflowSettings\":{\"targetMeshResolution\":{\"facePercentage\":50},\"targetTextureResolution\":{\"baseColor\":2048,\"emissive\":2048,\"normal\":2048,\"orm\":2048}},\"assetSimplification\":{\"meshDecimation\":{\"method\":\"rebake\"},\"topologySettings\":{\"vertexMergingDistance\":0.005,\"meshDensityEqualization\":0,\"boundaryPreservationFactor\":0.5},\"uvAndAtlasSettings\":{\"uvStretchTolerance\":0},\"materialAndTextureBaking\":{\"bakingQuality\":\"medium\",\"bakeNormalMap\":true,\"bakeAOMap\":false}},\"compressionAndExport\":{\"fileExports\":[{\"fileType\":\"glb\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}},{\"fileType\":\"usdz\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}}]}}",
"rpdx_version": "4.4.0",
"user_id": 328,
"created_at": "2021-04-22T09:11:30.000000Z",
"updated_at": "2021-04-22T09:11:30.000000Z"
},
{
"id": 12,
"name": "test",
"config": "{\"workflowSettings\":{\"targetMeshResolution\":{\"facePercentage\":50},\"targetTextureResolution\":{\"baseColor\":2048,\"emissive\":2048,\"normal\":2048,\"orm\":2048}},\"assetSimplification\":{\"meshDecimation\":{\"method\":\"rebake\"},\"topologySettings\":{\"vertexMergingDistance\":0.005,\"meshDensityEqualization\":0,\"boundaryPreservationFactor\":0.5},\"uvAndAtlasSettings\":{\"uvStretchTolerance\":0},\"materialAndTextureBaking\":{\"bakingQuality\":\"medium\",\"bakeNormalMap\":true,\"bakeAOMap\":false}},\"compressionAndExport\":{\"fileExports\":[{\"fileType\":\"glb\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"ktx2\",\"emissive\":\"ktx2\",\"normal\":\"ktx2\",\"orm\":\"ktx2\"}},{\"fileType\":\"usdz\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}}]}}",
"rpdx_version": "4.4.0",
"user_id": 328,
"created_at": "2021-04-22T11:56:29.000000Z",
"updated_at": "2021-04-22T11:56:29.000000Z"
},
{
"id": 13,
"name": "Preset Name",
"config": "{\"workflowSettings\":{\"targetMeshResolution\":{\"facePercentage\":50},\"targetTextureResolution\":{\"baseColor\":2048,\"emissive\":2048,\"normal\":2048,\"orm\":2048}},\"assetSimplification\":{\"meshDecimation\":{\"method\":\"rebake\"},\"topologySettings\":{\"vertexMergingDistance\":0.005,\"meshDensityEqualization\":0,\"boundaryPreservationFactor\":0.5},\"uvAndAtlasSettings\":{\"uvStretchTolerance\":0},\"materialAndTextureBaking\":{\"bakingQuality\":\"medium\",\"bakeNormalMap\":true,\"bakeAOMap\":false}},\"compressionAndExport\":{\"fileExports\":[{\"fileType\":\"glb\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}},{\"fileType\":\"usdz\",\"meshCompressionMethod\":\"none\",\"customScaling\":1,\"textureFormat\":{\"baseColor\":\"auto\",\"emissive\":\"auto\",\"normal\":\"auto\",\"orm\":\"auto\"}}]}}",
"rpdx_version": "4.4.0",
"user_id": 328,
"created_at": "2021-04-26T07:11:17.000000Z",
"updated_at": "2021-04-26T07:11:17.000000Z"
}
]
Received response:
Request failed with error:
Rapid Model
Get Rapid Model
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/rapidmodel/635" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rapidmodel/635"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rapidmodel/635'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": {
"id": 635,
"name": "teapot ",
"optimization_status": "done",
"created_at": "2021-02-16T16:50:41+01:00",
"updated_at": "2021-02-16T16:50:53+01:00",
"progress": 100,
"processing_step": "Done",
"external": false,
"rapid_compact_core_version": "4.3.0",
"tags": [],
"uuid": "d8316d1f-3c7d-4777-b72e-c760064f9d08",
"accepted": false,
"meta": {
"size": 573420,
"exportSize": 1029548
},
"rpd_info": "signed url for rpd_info.json",
"rpd_warnings": "signed url for the warning.log",
"downloads": {
"glb": "signed url for the .glb"
}
}
}
Received response:
Request failed with error:
Delete Rapid Model
requires authentication
Example request:
curl --request DELETE \
"https://api.rapidcompact.com/api/v1/rapidmodel/635" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rapidmodel/635"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rapidmodel/635'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Get Export Infos
requires authentication
Calling this endpoint return a list of links to download the exports and their respective infos
Please note that the export infos are generated only for glb and lgtf formats
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/rapidmodel/695/exports" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rapidmodel/695/exports"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rapidmodel/695/exports'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"data": {
"rapid.glb": {
"download": "link to rapid.glb",
"info": {
"images": [
{
"channels": 3,
"height": 2048,
"mimetype": "image/jpeg",
"slot": "normal",
"width": 2048
}
]
}
},
"rapid.usdz": {
"download": "link to rapid.usdz",
"info": null
}
}
}
Received response:
Request failed with error:
Delete Tag of a Rapid Model
requires authentication
Add Tags to a Rapid Model
requires authentication
Example request:
curl --request PUT \
"https://api.rapidcompact.com/api/v1/rapidmodel/281" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"chair\",
\"brown\"
]
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rapidmodel/281"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"chair",
"brown"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rapidmodel/281'
payload = {
"tags": [
"chair",
"brown"
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Delete Multiple Rapid Models
requires authentication
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/rapidmodel/delete" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ids\": [
726,
324
]
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/rapidmodel/delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ids": [
726,
324
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/rapidmodel/delete'
payload = {
"ids": [
726,
324
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Tags
Get all Base Asset Tags
requires authentication
Get all Rapid Model Tags
requires authentication
User
Login
Returns a token that can be used for calling other endpoints
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"yourname@example.com\",
\"password\": \"your password\"
}"
const url = new URL(
"https://api.rapidcompact.com/api/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "yourname@example.com",
"password": "your password"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/login'
payload = {
"email": "yourname@example.com",
"password": "your password"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Delete Account
requires authentication
Delete the user account and all the data associated with it
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/user/delete" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"password\": \"your password\"
}"
const url = new URL(
"https://api.rapidcompact.com/api/user/delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"password": "your password"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/user/delete'
payload = {
"password": "your password"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Webhooks
RapidCompact uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for optimization events. Instead of polling the API to know the status of your optimization, RapidCompact sends an optimization_finished event to your webhook
Begin using webhooks with your RapidCompact integration in just three steps:
- Create a webhook endpoint on your server
- Register the endpoint with RapidCompact to go live
- Test your endpoint by clicking the test button in the webhooks page
What are webhooks
The webhook endpoint is just more code on your server, which could be written in Ruby, PHP, Node.js, or whatever. The webhook endpoint has an associated URL (e.g., https://example.com/webhooks). The Rapid Compact notifications are Event objects. This Event object contains all the relevant information about what just happened, including the type of event and the data associated with that event. The webhook endpoint uses the event details to take any required actions, such as indicating that an optimization should be done.
Validation
In order to validate an incoming webhook event you need to first set up a secret when creating it on RapidCompact. This secret will be used to sign the body and send the signature as part of the requests header. You can use this secret on your receiving endpoint to validate the content of the body by signing it with the same secret. For an example check out this repository: https://github.com/DGG3D/webhook-api-example
Optimization Events
Currently RapidCompact sends one type of events: optimization_finished. You can see an example on the right side
{
"event_type": "optimization_finished",
"timestamp": "2021-02-19T15:03:08.076920Z",
"data": {
"status": "Successful",
"message": "Optimization has ended and your rapid model is available to download.",
"rawmodel_id": 1961,
"rapidmodel_id": 4213,
"rapidmodel": {
"rapid.glb": "link to rapid model"
}
}
}
Get Webhooks
requires authentication
Example request:
curl --request GET \
--get "https://api.rapidcompact.com/api/v1/user/webhooks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/webhooks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/webhooks'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, success):
[
{
"id": 6,
"user_id": 303,
"url": "https://mywebhookurl.com",
"last_called_at": "2021-10-26T09:45:47.000000Z",
"created_at": "2021-10-26T09:45:47.000000Z",
"updated_at": "2021-10-26T09:45:47.000000Z",
"secret": "secret",
"last_status": null,
"verify_ssl": true,
"failed_calls": 0,
"notified_at": null
}
]
Received response:
Request failed with error:
Create Webhook
requires authentication
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/user/webhooks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"url\": \"https:\\/\\/example.com\\/webhook\",
\"secret\": \"my secret\",
\"verify_ssl\": false
}"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/webhooks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"url": "https:\/\/example.com\/webhook",
"secret": "my secret",
"verify_ssl": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/webhooks'
payload = {
"url": "https:\/\/example.com\/webhook",
"secret": "my secret",
"verify_ssl": false
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, success):
{
"id": 6,
"user_id": 303,
"url": "https://example.com/webhook",
"last_called_at": "2021-10-26T09:45:47.000000Z",
"created_at": "2021-10-26T09:45:47.000000Z",
"updated_at": "2021-10-26T09:45:47.000000Z",
"secret": "aut",
"last_status": null,
"verify_ssl": true,
"failed_calls": 0,
"notified_at": null
}
Example response (500, Maximum number of tags reached):
[
"code": 1,
"message": "Maximum number of webhooks allowed already created"
]
Received response:
Request failed with error:
Delete Webhook
requires authentication
Example request:
curl --request DELETE \
"https://api.rapidcompact.com/api/v1/user/webhooks/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/webhooks/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/webhooks/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (200, success):
Received response:
Request failed with error:
Test Webhook
requires authentication
A test event will be sent to the webhook to make sure it is accessible and can receive events
Call the get webhooks endpoint again to see if the webhook was successfully invoked
Example request:
curl --request POST \
"https://api.rapidcompact.com/api/v1/user/webhooks/test/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.rapidcompact.com/api/v1/user/webhooks/test/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
import requests
import json
url = 'https://api.rapidcompact.com/api/v1/user/webhooks/test/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()
Example response (200, success):
Received response:
Request failed with error: