You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
The folders API uses a JsonApicollection to represent the response type of the getFolderContents() function. This causes the response to only display the top level folders, but you cannot retrieve the sub folders. Here's an example response:
I worked around this by changing FoldersAPI.php line #284 from: $this->apiClient->getSerializer()->deserialize($response, '\Autodesk\Forge\Client\Model\JsonApiCollection', $httpHeader),
to: $this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader),
Then I manually parsed the retrieved object to extract the subfolders information. Deserializing the response as an object, for the same request, produces the following output:
array (size=3)
'jsonapi' =>
object(stdClass)[183]
public 'version' => string '1.0' (length=3)
'links' =>
object(stdClass)[191]
public 'self' =>
object(stdClass)[192]
public 'href' => string 'https://developer.api.autodesk.com/data/v1/projects/b.3300e3a3-8e63-437d-b5e0-2c7366e7c625/folders/urn:adsk.wipprod:fs.folder:co.fzu-FNn9TtS91jpUvBl_OQ/contents' (length=160)
'data' =>
array (size=1)
0 =>
object(stdClass)[194]
public 'type' => string 'folders' (length=7)
public 'id' => string 'urn:adsk.wipprod:fs.folder:co.jgh51Mz5RF6lU1Zxg0Q3ag' (length=52)
public 'attributes' =>
object(stdClass)[193]
public 'name' => string 'Notices and Waivers' (length=19)
public 'displayName' => string 'Notices and Waivers' (length=19)
public 'createTime' => string '2017-07-19T02:56:23.0000000Z' (length=28)
public 'createUserId' => string 'LAPVJM28ZSQT' (length=12)
public 'createUserName' => string 'UNKNOWN%20UNKNOWN' (length=17)
public 'lastModifiedTime' => string '2017-07-19T17:49:59.0000000Z' (length=28)
public 'lastModifiedUserId' => string '' (length=0)
public 'lastModifiedUserName' => string '' (length=0)
public 'objectCount' => int 13
public 'hidden' => boolean false
public 'extension' =>
object(stdClass)[188]
public 'type' => string 'folders:autodesk.bim360:Folder' (length=30)
public 'version' => string '1.0' (length=3)
public 'schema' =>
object(stdClass)[189]
public 'href' => string 'https://developer.api.autodesk.com/schema/v1/versions/folders:autodesk.bim360:Folder-1.0' (length=88)
public 'data' =>
object(stdClass)[190]
public 'visibleTypes' =>
array (size=1)
0 => string 'items:autodesk.bim360:File' (length=26)
public 'actions' =>
array (size=1)
0 => string 'CONVERT' (length=7)
public 'allowedTypes' =>
array (size=2)
0 => string 'items:autodesk.bim360:File' (length=26)
1 => string 'folders:autodesk.bim360:Folder' (length=30)
public 'links' =>
object(stdClass)[184]
public 'self' =>
object(stdClass)[187]
public 'href' => string 'https://developer.api.autodesk.com/data/v1/projects/b.3300e3a3-8e63-437d-b5e0-2c7366e7c625/folders/urn:adsk.wipprod:fs.folder:co.jgh51Mz5RF6lU1Zxg0Q3ag' (length=151)
public 'relationships' =>
object(stdClass)[185]
public 'contents' =>
object(stdClass)[186]
public 'links' =>
object(stdClass)[179]
public 'related' =>
object(stdClass)[161]
public 'href' => string 'https://developer.api.autodesk.com/data/v1/projects/b.3300e3a3-8e63-437d-b5e0-2c7366e7c625/folders/urn:adsk.wipprod:fs.folder:co.jgh51Mz5RF6lU1Zxg0Q3ag/contents' (length=160)
public 'parent' =>
object(stdClass)[166]
public 'data' =>
object(stdClass)[174]
public 'type' => string 'folders' (length=7)
public 'id' => string 'urn:adsk.wipprod:fs.folder:co.fzu-FNn9TtS91jpUvBl_OQ' (length=52)
public 'links' =>
object(stdClass)[175]
public 'related' =>
object(stdClass)[177]
public 'href' => string 'https://developer.api.autodesk.com/data/v1/projects/b.3300e3a3-8e63-437d-b5e0-2c7366e7c625/folders/urn:adsk.wipprod:fs.folder:co.jgh51Mz5RF6lU1Zxg0Q3ag/parent' (length=158)
public 'refs' =>
object(stdClass)[176]
public 'links' =>
object(stdClass)[171]
public 'self' =>
object(stdClass)[172]
public 'href' => string 'https://developer.api.autodesk.com/data/v1/projects/b.3300e3a3-8e63-437d-b5e0-2c7366e7c625/folders/urn:adsk.wipprod:fs.folder:co.jgh51Mz5RF6lU1Zxg0Q3ag/relationships/refs' (length=170)
public 'related' =>
object(stdClass)[173]
public 'href' => string 'https://developer.api.autodesk.com/data/v1/projects/b.3300e3a3-8e63-437d-b5e0-2c7366e7c625/folders/urn:adsk.wipprod:fs.folder:co.jgh51Mz5RF6lU1Zxg0Q3ag/refs' (length=156)
public 'links' =>
object(stdClass)[167]
public 'links' =>
object(stdClass)[170]
public 'self' =>
object(stdClass)[168]
public 'href' => string 'https://developer.api.autodesk.com/data/v1/projects/b.3300e3a3-8e63-437d-b5e0-2c7366e7c625/folders/urn:adsk.wipprod:fs.folder:co.jgh51Mz5RF6lU1Zxg0Q3ag/relationships/links' (length=171)
The text was updated successfully, but these errors were encountered:
The folders API uses a
JsonApicollection
to represent the response type of thegetFolderContents()
function. This causes the response to only display the top level folders, but you cannot retrieve the sub folders. Here's an example response:I worked around this by changing FoldersAPI.php line #284 from:
$this->apiClient->getSerializer()->deserialize($response, '\Autodesk\Forge\Client\Model\JsonApiCollection', $httpHeader),
to:
$this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader),
Then I manually parsed the retrieved object to extract the subfolders information. Deserializing the response as an
object
, for the same request, produces the following output:The text was updated successfully, but these errors were encountered: