Viewrium Docs
HTTP referenceProducts

Create a model ticket

POST/v1/products/{id}/tickets

Returns a single-use URL for the product's 3D file - the only way to its bytes, since no response carries a model file URL. The URL serves model/gltf-binary once, until expires_at (60 seconds for view, 30 for ar). Mint it right before the viewer loads; never store it.

  • Publishable key: published products only; the ticket is bound to the requesting page's origin, which must be one of your allowed domains.
  • Secret key: any of your products; the ticket is bound to origin (the page that will load the file).

400 for an origin outside your allowed domains; 404 for a product you cannot see; 409 without a ready model; 429 past the rate limits.

Path Parameters

id*Id

The product's id.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

view for the page that will show the model; ar for Android's Scene Viewer, minted when the shopper taps the AR button (it lives 30 seconds). With a secret key, origin names the page that will fetch the file; it must be one of your allowed domains. A publishable key does not send it: its ticket is bound to the request's own origin.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/products/497f6eca-6276-4993-bfeb-53cbbbba6f08/tickets" \  -H "Content-Type: application/json" \  -d '{    "kind": "view"  }'
{  "url": "string",  "kind": "view",  "expires_at": "2019-08-24T14:15:22Z"}
{  "error": {    "code": "string",    "message": "string",    "details": null  }}