'Forge Model Derivative Trying to get object properties by externalId fails but works with objectID
Using this Model Derivative endpoint we want to retrieve the properties of an object by calling it with its externalId. We follow the procedure explainined here.
The endpoint works using the objectid, in this case 3:
"data": {
"type": "properties",
"collection": [
{
"objectid": 3,
"name": "Finished Ceiling Height",
"externalId": "5d365ed4-cccc-4589-b4e1-a8c5c744672a-0046dd63",
"properties": {
"General": {
"Override": ""
},
"Extents": {
"Scope Box": "None"
},
"Constraints": {
"Elevation": "8.667 ft-and-fractional-in",
"Story Above": "Default"
},
"Dimensions": {
"Computation Height": "3.000 ft-and-fractional-in"
},
"Identity Data": {
"Name": "Finished Ceiling Height",
"Structural": "No",
"Building Story": "Yes",
"Asset ID": "",
"Asset Location": "",
"Asset Category": "",
"Workset": "Shared Views, Levels, Grids",
"Edited by": ""
}
}
}
]
}
}
The documentation states that we could also use externalId to get the same result.
The objectid of an object can change if the design is translated to SVF or SVF2 again. If you require a persistent ID to reference an object, use externalId.
But changing objectid=3 to objectid=5d365ed4-cccc-4589-b4e1-a8c5c744672a-0046dd63 returns an error 400:
{
"diagnostic": "Invalid 'objectid' parameter"
}
We also tried to convert the GUID to base64, use externalid instead of objectid as the parameter name. Everything with the same results.
Any ideas? Are we missunderstanding the documentation?
Note: Accesing the viewer is not an option at the moment, neither downloading the sqlite/json files
[Edit 1] We tried setting the query parameter as externalId/externalid receiving the same results.
curl --location --request GET 'https://developer.api.autodesk.com/modelderivative/v2/designdata/urn/metadata/guid/properties?externalId=43f2c4e0-d09b-4151-a349-1b6f684411c6-004c8717' \
--header 'x-ads-force: true' \
--header 'x-ads-derivative-format: fallback' \
--header 'Authorization: Bearer XXXXXXX
Solution 1:[1]
The objectId parameter accepts numerical values only. As you can see from the API response, objectId is a numerical value. You cannot pass a string to this parameter, unfortunately.
However, our engineering team is working on the new property API which supports more filters. You might be interested in the new property metadata API mentioned in https://www.autodesk.com/autodesk-university/class/Forge-Road-Map-2021 at 20 mins.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Eason Kang |