How to Generate List of All Smartsheet Objects I can Access?
Hello, I have records management policies and often need to get a list of all of the Workspaces, Sheets, Reports, and Dashboards I can at least view as an account member. I typically use the "Access.csv" report to do this, but it does not include a few useful things. I'm wondering if maybe there are workarounds I can employ to get these.
Access CSV includes:
- Workspace Name
- Name of object (name of sheet, etc)
- Type (report, sheet, dashboard)
- Owner
- Shared To
- Shared To Permission
- Key (is this static? relative to the user?)
- Last Modified Date
I also need:
- Address (hyperlink)
- ID (the one shown in "properties")
- Workspace Address
- Last Modified By
- Created Date
- Created By
Does anyone know if I can get an address from the Key? They value for Key here cannot be used to create the standard address, as far as I can tell.
Or, are there any tutorials or relevant discussions on how to get this detail into a recurring export or Smartsheet via Bridge?
Answers
-
Do you have someplace you can run the API. A simple call:
curl --silent "https://api.smartsheet.com/2.0/sheets?includeAll=TRUE" -H "Authorization: Bearer $token"
returns data for all the sheets you have access to:
You can use the ID to get more details like the shares:
curl --silent "https://api.smartsheet.com/2.0/sheets/$Sheet_ID/shares?includeAll=TRUE&sharingInclude=WORKSPACE&accessApiLevel=1&include=workspaceShares" -H "Authorization: Bearer $token"
/marc
-
Can never get these to work … Either get Invalid Auth or not authorized message
Tried many variations of replacing "Authorization: Bearer $token"
No luck…
-
#python (via Smartsheet SDK)
#Get list of sheets from Smartsheetsimport smartsheet, csv
import pandas as pd
import jsonMyToken = "XXXXXXXXXXXX"
xSheet = smartsheet.Smartsheet(MyToken)
path = "C:/Users/XXXXXXXXXXX/"
xResult = xSheet.Sheets.list_sheets(include_all=True)
jsonFile = path + "jSheetList.txt"
with open(jsonFile, 'w') as f:
for item in xResult.data:
f.write("%s\n" % item)jdata = [json.loads(line)
for line in open(jsonFile, 'r', encoding='utf-8')]df = pd.DataFrame.from_dict(jdata)
df.to_csv(path + "SheetList.txt")
-
The comment removed my indents above. You will have to fix that.
-
Depending on the number of objects the previous examples will work on a short list, but if there is a long list of objects, you will get an error or a short list (limited by the page size, you will get only the first one), you can expand the page size but if you still cannot pull the whole list, then you need pagination.
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives