Create Space from URL API

Changed on

Overview

The Substance 3D API provides a way to upload and temporary store files. You can upload one or more files from one or more URLs. For each URL, there is an optional filepath parameter that allows you to specify the file name and its path. By combining multiple URLs with different filepath paths, you can compose a complete file tree structure.

Example for this files tree:

├── textures
│   ├── diffuse.png
│   └── normal.png
└── lighthouse.fbx

Curl request:

curl --request POST \
  --url https://s3d.adobe.io/v2/spacesURL \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer 123' \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "filepath": "lighthouse.fbx",
    "url": "https://url/to/lighthouse.fbx"
  },
  {
    "filepath": "textures/diffuse.png",
    "url": "https://url/to/diffuse.png"
  },
  {
    "filepath": "textures/normal.png",
    "url": "https://url/to/normal.png"
  }
]'

The result of the post is a JSON which contained the id of the space created. Space id can be used into a space source to use space content as a source for API operations.

Example of a space source:

{
  "space": {
    "id": "<space_id>"
  }
}
post/v2/spacesURL

Request

  • Base URL: https://s3d.adobe.io
  • URL: https://s3d.adobe.io/v2/spacesURL
  • Auth: HTTP bearer and API key in header x-api-key

Request body

filepathstring

The filename in the filepath overrides filename. If filepath is unset, will try to detect filename from content disposition header, then url itself. If a path is specified before the filename in the filepath, the file will be mounted at that location in the space.

urlstring required

Example request

[
  {
    "url": "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/WaterBottle/glTF-Binary/WaterBottle.glb"
  }
]

Response

Created

$schemastring uri

A URL to the JSON schema for this object.

expirystring date-time required

time at which the space will be deleted

idstring required

Unique identifier of this Space.

urlstring required

URL to the full description of this Space.

archiveUrlunknown

Example response

{
  "$schema": "https://s3d.adobe.io/schemas/rest_base.Space.json"
}

Changes