Migration Guide REST API from v1 to v2
The following guide will help you migrate our REST API from v1 to v2.
First up, v1 of our API is still up and running. You can find the documentation here.
The new v2 documentation is reachable here.
To use the new v2 api, you need to adjust the URL to contain api/v2
The paths api
and api/v1
still route to v1
The guide is separated into four areas that changed: Base Asset, Embeds, Presets and Rapid Model.
In each area we introduce new endpoints to give you some new ideas on how to use the RapidCompact REST API.
We mention removed ones and describe changes to help you migrate.
Base Asset
back to top
New Endpoints
Multi Optimize
With the new Multi
Optimize endpoint you can optimize multiple models with one request by using the same format as the
optimize endpoint in array form.
Get Download URLs
The new Get Download URLs endpoint return a list of URLs to download the individual base asset files.
Download zip
Instead of downloading each file individually with the Download zip endpoint you can download all model files as a zip. We return a streamed response.
Removed Endpoints
Process
We removed the deprecated Process endpoint
in v2.
You can use the Optimize endpoint
instead.
Changed Endpoints
Optimize
We adjusted the Optimize endpoint so you can optimize a base asset in two ways.
You can either send the config as a JSON object that complies with our API Optimize Schema, as in v1 of the API.
Or you can send the id of one of your presets or of a factoryPreset, which is new in v2.
So when migrating from v1 to v2 the Optimize endpoint continues to work when sending the config as JSON.
Get Base Assets
The response of the Get Base Assets endpoint changed.
We removed the processing
and rapid_models
attributes, added the format
attribute.
Embeds
back to top
New Endpoints
Create Embed from Base Asset
With the new Create Embed from Base Asset endpoint you can create an embed from a base asset. The base asset needs to be in the .glb file format. We also send a 'embed_from_raw_creation' event via webhooks to notify you as soon as the embed has been created.
Changed Endpoints
Get Embeds
The Get Embeds endpoint got a overhaul.
Instead of returning each Base Asset with its embeds (v1), we now return a paginated list of all embeds.
You can also search for embeds by name with the q
query parameter. We also allow you to filter embeds by a rapid model id (query parameter rapidId
).
The attributes in the response got some name changes, so beware of that.
Get Embed
The Get Embed endpoint got some additional parameters (identifier, user_id, model_id, updated_at) in the response.
Create Embed
The new Create Embed endpoint has a new route api/v2/embeds/create
instead of api/v1/embeds
. With v2 we also send a 'embed_creation' event to your webhook to notify you as soon as the embed is created. The endpoint also returns a new response message with the state, message, the rapidmodel id, the embed id and the URL to the embed.
Presets
back to top
New Endpoints
Get all Factory Presets
The endpoint Get all Factory Presets return all factory presets that are provided by RapidCompact. A factory presets describes a optimization setting for different applications e.g. Lens Studio, Game Engines (Unreal, Unity) and devices e.g. Hololens. You can use the returned id when using the Optimize endpoint.
Download Preset
You can also download a preset (your custom, factory) as a zip.
The zip contains both the API and the CLI format. We return a streamed response.
Changed Endpoints
Create Preset
The Create Preset endpoint has a new optional body parameter: description to add a short description to your preset.
Rapid Model
back to top
Changed Endpoints
Get Rapid Models
We adjusted the response for the Get Rapid Models endpoint by removing the the following attributes: rawmodel
, job_status
and progress
.
Additionally we added a new attribute optimization_formats
, which describes the used output formats in JSON.
Get Rapid Model
The changes from "Get Rapid Models" also apply to the Get Rapid Model endpoint.