Smartsheet-Python SDK: Workspace
Hi everyone,
I am having trouble retrieving workspace from Smartsheet using Python. I installed smartsheet-python SDK already and have the token and headers for authorization so no problem there (can access sheets etc).
Here is the error: TypeError: get_workspace() missing 1 required positional argument: 'workspace_id'
Attached is my code. As I was typing get_workspace, it asks for an argument called self. I am unsure what to pass on that.
Also, Smartsheet API have a sample code on Python for getting workspaces which involves the code:
workspace = smartsheet_client.Workspaces.get_workspace(6621332407379844) # workspace_id
But I get an error that smartsheet_client is not defined. How can I fix these?
Thank you for your help!
Answers
-
Hi @geluzi
In the sample code, there is a set of numbers after "get_workspace" (6621332407379844) that is the Workspace ID:
workspace = smartsheet_client.Workspaces.get_workspace(xxxxx)
In your image, it looks like you have the words "workspace_id" in the code instead of replacing that with the actual ID numbers. You can use the List Workspace method to retrieve the numerical ID (see the Documentation, here) or you can identify this information in the UI by right-clicking on the Workspace and finding this number under "Properties".
Let me know if that helped!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives