API - "Get Workspace folders" Method Results Not Matching Documentation

adp_cl
adp_cl ✭✭✭✭
edited 07/31/24 in API & Developers

I'm making the call with the parameters matching the documentation and not getting the same results. I'm only getting "id", "name" and "permalink" for each folder. The "Responses" in the documentation includes an array with reports, sheets, sights and templates, as well as details for each of those objects.

Am I doing something incorrectly in my call, or is the documentation inaccurate?

If the documentation is inaccurate, is there a method available to accomplish the output in the documentation without looping through each folder?

Periods added below to format indenting, in the hope that it's easier to read. Didn't have success with the code format option.

Input

{
…"uri": "https://api.smartsheet.com/2.0/workspaces/7229146649651076/folders",
…"method": "GET",
…"queries": {
……"accessApiLevel": "0",
……"includeAll": "true"
…},
…"headers": {
……"Authorization": "sanitized",
……"Content-Type": "application/json"
…}
}

Sample Output with Sensitive Data Redacted

{
…"statusCode": 200,

…"headers": {
……"Date": "Wed, 31 Jul 2024 17:24:23 GMT",
……[REDACTED]
……"Content-Length": "3713"
…},
…"body": {
……"pageNumber": 1,
……"totalPages": 1,
……"totalCount": 26,
……"data": [
………{
…………"id": REDACTED,
…………"name": "REDACTED",
…………"permalink": "REDACTED"
………},
………[REDACTED]
………{
…………"id": REDACTED,
…………"name": "REDACTED",
…………"permalink": "REDACTED"
………}
……]
…}
}

Answers

  • adp_cl
    adp_cl ✭✭✭✭

    I'm experiencing something similar now with the "Get Reports" method. Only returning five fields, versus the large array of data in the documentation.

  • Ryan Sides
    Ryan Sides ✭✭✭✭✭✭

    I'm getting the same. That's odd.

    Ryan Sides

    Smartsheet Tips and Tricks for Beginners and Advanced on LinkedIn and YouTube

    Come Say Hello!

  • jmyzk_cloudsmart_jp
    jmyzk_cloudsmart_jp ✭✭✭✭✭✭

    Hi @adp_cl

    To retrieve the contents of Sheets, Reports, and Sights within a folder using the Smartsheet API, you need to utilize the Folder ID obtained from the "Get Workspace Folder" method. Once you have the Folder ID, you should call the "Get Folder" method. This process is necessary because the "Get Workspace Folder" method typically provides basic details like "id", "name", and "permalink" for each folder, but does not include detailed information about the contents within those folders. Using the Folder ID with the "Get Folder" method allows you to access more specific details about the sheets, reports, and sights contained within that folder. So, the API document's response example is somewhat misleading.

  • adp_cl
    adp_cl ✭✭✭✭
    edited 08/05/24

    Thank you, @jmyzk_cloudsmart_jp . I'm familiar with the "Get folder" method and looping through folders.

    The documentation is very misleading, unless I'm missing some sort of criteria in my call. I was hopeful that I would be able to use this method instead of looping "Get folder" calls.