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
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 462 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 59 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives