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
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
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
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives