Ga naar inhoud
English

Upload a GLB as a model

POST
/v1/models
curl --request POST \
--url https://api.virtualdisplay.io/v1/models \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@file \
--form overwrite=example
Media typemultipart/form-data
object
file
required

The GLB. Its filename becomes the model’s, and must end in .glb.

string format: binary
overwrite

True to replace the model with the same filename. False or absent answers a conflict instead.

string

The file replaced the model with the same filename, under the id it had.

Media typeapplication/json
object
model
required

The model the upload created or replaced.

object
filename
required

The file’s name, with its .glb extension.

string
id
required

The model’s id. On a replace it is the id the model already had.

string

Example

{
"model": {
"filename": "eiken-stoel.glb",
"id": "0196a1f0-b8d4-7e21-8a6f-3c9d1e5b2f40"
}
}

Created

Media typeapplication/json
object
model
required

The model the upload created or replaced.

object
filename
required

The file’s name, with its .glb extension.

string
id
required

The model’s id. On a replace it is the id the model already had.

string

Example

{
"model": {
"filename": "eiken-stoel.glb",
"id": "0196a1f0-b8d4-7e21-8a6f-3c9d1e5b2f40"
}
}

Bad Request

Media typeapplication/json
object
details

Null when the answer names no field. Otherwise, each field that is wrong:

  • file: required (The request has no file part, or it is not multipart.)
  • overwrite: invalid_input (Not true or false.)
object
file
  • required: The request has no file part, or it is not multipart.
string
Allowed values: required
overwrite
  • invalid_input: Not true or false.
string
Allowed values: invalid_input
error
required
  • validation_error: A field is wrong, or the body is not the JSON the operation takes. details names each wrong field; repair it, do not retry as it is.
  • invalid_file_type: The filename does not end in .glb.
  • file_too_large: The file is larger than the upload limit.
  • glb_invalid_structure: The file is not a GLB this service can read. Re-export it as a GLB.
  • glb_external_references: The file loads something from outside itself. Embed every texture and buffer.
  • glb_unsupported_compression: The file uses a mesh or texture compression this service does not accept.
  • glb_unsupported_extension: The file requires a GLB extension this service does not accept. Contact support.
  • glb_security_violation: The file contains content this service refuses. The reason is not given.
string
Allowed values: validation_error invalid_file_type file_too_large glb_invalid_structure glb_external_references glb_unsupported_compression glb_unsupported_extension glb_security_violation
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

{
"error": "file_too_large",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

The answer carries unauthorized or token_invalid. See the errors page.

Media typeapplication/json
object
details

Null: an answer with this status names no field.

null
error
required
  • unauthorized: No Bearer token was sent, or the token was revoked, or its integration was disabled. Send a valid token, do not retry the same one.
  • token_invalid: The token is malformed, has a bad signature or has expired. Exchange the secret for a new token, then retry once.
string
Allowed values: unauthorized token_invalid
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

{
"error": "token_invalid",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

Forbidden

Media typeapplication/json
object
details

Null: an answer with this status names no field.

null
error
required
  • forbidden: The token is valid, but this integration may not make this call. Do not retry.
  • model_limit_reached: The subscription has no room for another model. Free a slot or raise the plan, then upload.
  • subscription_cancelled: The subscription is cancelled. Renew it before uploading.
string
Allowed values: forbidden model_limit_reached subscription_cancelled
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

{
"error": "forbidden",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

Not Found

Media typeapplication/json
object
details

Null: an answer with this status names no field.

null
error
required
  • not_found: The Customer no longer exists.
string
Allowed values: not_found
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

Examplenot_found
{
"error": "not_found",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

Conflict

Media typeapplication/json
object
details

Null when the answer names no field. Otherwise, each field that is wrong:

  • filename: free text. The filename that is taken.
  • suggested_filename: free text. The filename to retry with: this one with a short suffix.
object
filename

The filename that is taken.

string
suggested_filename

The filename to retry with: this one with a short suffix.

string
error
required
  • file_exists: A live model has this filename, and overwrite was not set to true. The details name a suggested_filename to use instead.
  • conflict: The model was deleted while the file was uploaded. Send the upload again.
string
Allowed values: file_exists conflict
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

{
"error": "conflict",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

Request Entity Too Large

Media typeapplication/json
object
details

Null: an answer with this status names no field.

null
error
required
  • body_too_large: The request body is larger than we accept, so nothing was done. Make it smaller, then retry once.
string
Allowed values: body_too_large
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

Examplebody_too_large
{
"error": "body_too_large",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

The answer carries rate_limited. See the errors page.

Media typeapplication/json
object
details

Null: an answer with this status names no field.

null
error
required
  • rate_limited: The integration or its Customer is over its budget. Wait for the Retry-After seconds, then retry.
string
Allowed values: rate_limited
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

Examplerate_limited
{
"error": "rate_limited",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}

The answer carries internal_error. See the errors page.

Media typeapplication/json
object
details

Null: an answer with this status names no field.

null
error
required
  • internal_error: Our fault. Retry with backoff, then stop; send the trace_id if it persists.
string
Allowed values: internal_error
trace_id
required

Identifies the request on our side. Send it with a support question about a failure.

string

Examples

Exampleinternal_error
{
"error": "internal_error",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}