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
- Smartsheet Customer Resources
- 64.1K Get Help
- 412 Global Discussions
- 221 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 461 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives