Ga naar inhoud
English

Replace a model's annotations

PUT
/v1/models/{id}/annotations
curl --request PUT \
--url https://api.virtualdisplay.io/v1/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/annotations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "annotations": [ { "conditions": [ { "attribute": "Finish", "values": [ "Oak", "Walnut" ] } ], "description": { "en": "Measured from the floor to the top of the seat." }, "id": "seat-height", "node": "seat", "position": { "x": 0.12, "y": 0.45, "z": -0.08 }, "title": { "en": "Seat height", "nl": "Zithoogte" } } ] }'
id
required
string format: uuid

The model’s id, from the list.

Media typeapplication/json
object
annotations
required

The model’s annotations. They replace the whole list, so one left out is removed.

Array<object>
object
conditions

Selections the marker waits on, all of them. Absent when the marker always shows.

Array<object>
object
attribute
required

The attribute or material the condition is about.

string
values
required

The values of that attribute the marker shows with. The marker shows when one of them is chosen.

Array<string>
description

The text per locale, under the title. Optional.

object
key
additional properties
string
id

The annotation’s id. The save assigns one where it is missing. Viewer events count by it, so a title in another language stays one annotation.

string
node
required

The object the annotation was placed on. Its marker shows while that object shows.

string
position
required

Where the marker sits on the model’s surface.

object
x
required

The coordinate on the x axis in the model’s own space, in the file’s units: metres, as glTF requires.

number
y
required

The coordinate on the y axis in the model’s own space, in the file’s units: metres, as glTF requires.

number
z
required

The coordinate on the z axis in the model’s own space, in the file’s units: metres, as glTF requires.

number
title
required

The title per locale, nl, en or de. At least one locale is required.

object
key
additional properties
string

Example

{
"annotations": [
{
"conditions": [
{
"attribute": "Finish",
"values": [
"Oak",
"Walnut"
]
}
],
"description": {
"en": "Measured from the floor to the top of the seat."
},
"id": "seat-height",
"node": "seat",
"position": {
"x": 0.12,
"y": 0.45,
"z": -0.08
},
"title": {
"en": "Seat height",
"nl": "Zithoogte"
}
}
]
}

No Content

Bad Request

Media typeapplication/json
object
details

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

  • id: invalid_input (Not a model id.)
  • annotations: too_many (More than 50 annotations.)
object
annotations
  • too_many: More than 50 annotations.
string
Allowed values: too_many
id
  • invalid_input: Not a model id.
string
Allowed values: invalid_input
error
required
  • validation_error: The id is not a model id, or an annotation is wrong, and nothing is saved. details names the id, or the list as annotations, or an annotation as annotations[N].field, N its place in the list, with node or title missing, a text over its length, an id given twice, or conditions without an attribute and a value.
string
Allowed values: validation_error
trace_id
required

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

string

Examples

{
"details": {
"annotations": "too_many",
"id": "invalid_input"
},
"error": "validation_error",
"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"
}

The answer carries forbidden. See the errors page.

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.
string
Allowed values: forbidden
trace_id
required

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

string

Examples

Exampleforbidden
{
"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: No such model in your account. A model of another Customer answers the same.
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"
}

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"
}