Create a new terrain
POST
v1alpha/terrains
This endpoint is used to create a new terrain and generate a link for uploading a gzipped terrain GLB file. Use HTTP PUT method for the upload.
Resource Information
| Method and URI | POST https://developer.api.autodesk.com/forma/terrain/v1alpha/terrains |
| Authentication Context | user context optional |
| Required OAuth Scopes | data:read data:write |
| Data Format | JSON |
Request
Headers
| Authorization* string | Must be Bearer <token>, where <token> is obtained via either a two-legged or three-legged OAuth flow. |
| X-Ads-Region string | Specifies the geographical location (region) of the service. US or EMEA. Defaults to US. |
| Content-Type* string | Must be application/json |
* Required
Request
Query String Parameters
| authcontext* string | Provides the authcontext of the request, such as the forma project |
* Required
Request
Body Structure
Expand all
| bbox3d* array | |
| licensing object | |
| attributions* array: object | |
| action* enum:string | Possible values: display, transfer |
| content* string | |
| url* string | |
| exportable* boolean | |
| licenseUrl* string | |
| providerDescriptionUrl* string |
* Required
Response
HTTP Status Code Summary
| 201 Created | Returns a terrain with a presigned s3 link for uploading a gzipped terrain glb. |
| 400 Bad Request | Error response |
| 403 Forbidden | Unauthorized |
| 404 Not Found | Error response |
| 500 Internal Server Error | Error response |
Response
Body Structure (201)
| elementId string | |
| presignedS3Url string | The URL to upload a gzipped terrain GLB file. Use HTTP PUT method for the upload. |
| revision string | |
| urn string |
Example
Returns a terrain with a presigned s3 link for uploading a gzipped terrain glb.
Request
curl -v 'https://developer.api.autodesk.com/forma/terrain/v1alpha/terrains?authcontext=pro_123' \
-X 'POST' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a' \
-H 'Content-Type: application/json' \
-d '{
"bbox3d": [
[
597982.5331297795,
6643115.58486251,
20.42
],
[
597982.5331297795,
6643115.58486251,
80.31
]
],
"licensing": {}
}'
Show More
Response
{
"elementId": "5d943f58-042f-453e-b605-df7217fc5a3f",
"presignedS3Url": "https://terrain-element-store-local-bucket/pro_udf4s7j4tg/5d943f58-042f-453e-b605-df7217fc5a3f/1682339192328.glb",
"revision": "1682339192328",
"urn": "urn:adsk-forma-elements:terrain:pro_test:24c99081-1cbd-449b-9d11-34a8a89c67c3:1707486855123"
}