Getting the Group ID for adding a user to a group in Group Management through API
I am wanting to add an email to a group using the API 2.0 but do not know how to get the group number. I thought it would be the number in the URL when viewing the groups, as in:
https://admin.smartsheet.com/manage/groups/1234567 (yes, there are only 7 numbers)
I am using the following example from API documentation:
new_members = smartsheet_client.Groups.add_members( 7917992160847748, # group_id [smartsheet.models.GroupMember({'email': 'jane.doe@smartsheet.com'})] )
Here the group ID is a long number. When I use my 7 digit number (plus the rest of the needed code) I get the following error.
{"response": {"statusCode": 404, "reason": "Not Found", "content": {"errorCode": 1106, "message": "Group not found", "refId": "xnt296"}}}
So the code seems to be working, its just saying I have the wrong group ID number. I have written other python code to access Smartsheet so I know I have the basics working.
How do I get the correct group ID number?
Answers
-
Hi @Sasun
You can use List Org Groups to bring back Group information, such as the Group ID. Here's the documentation on this: https://smartsheet.redoc.ly/tag/groups#operation/list-groups
Cheers,
Genevieve
Join us at Smartsheet ENGAGE 2024 🎉
October 8 - 10, Seattle, WA | Register now -
Hi @Sasun and @Genevieve P.
I didn't realize you could update group members through APIs. The documentation only mentions names and descriptions. Can email addresses be added?
Thank you
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.3K Get Help
- 364 Global Discussions
- 200 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 445 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives