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 information? 👀 | 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
- Customer Resources
- 66.7K Get Help
- 436 Global Discussions
- 152 Industry Talk
- 497 Announcements
- 5.3K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 77 Community Job Board
- 508 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 37 Webinars
- 7.3K Forum Archives