Create Space API
Changed onOverview
The Substance 3D API provides a way to upload and temporarily store files. Uploading files requires a multipart/form-data request to send data.
The request requires a files field containing a list of files. Each file's filename field can contain a filepath to specify where the file will be stored in the space.
Example for this files tree:
├── textures
│ ├── diffuse.png
│ └── normal.png
└── lighthouse.fbx
HTTP data relative to the previous files tree:
POST /spaces HTTP/1.1
Host: localhost:8080
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="files"; filename="lighthouse.fbx"
Content-Type: model/vnd.autodesk.fbx
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="files"; filename="textures/diffuse.png"
Content-Type: image/png
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="files"; filename="textures/normal.png"
Content-Type: image/png
(data)
------WebKitFormBoundary7MA4YWxkTrZu0gW--
Curl command to create this file tree:
curl -X POST https://s3d.adobe.io/v2/spaces \
-F "files=@Local/Path/To/The/Local/File/lighthouse.fbx;filename=lighthouse.fbx" \
-F "files=@Local/Path/To/The/Local/File/diffuse.png;filename=textures/diffuse.png" \
-F "files=@Local/Path/To/The/Local/File/normal.png;filename=textures/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/spaces
Request
- Base URL: https://s3d.adobe.io
- URL: https://s3d.adobe.io/v2/spaces
- Auth: HTTP bearer and API key in header x-api-key
Response
Created
Example response
{
"$schema": "https://s3d.adobe.io/schemas/rest_base.Space.json"
}Changes
- info
endpoint added
- info