Make it easier for a user of the API to add members to groups
See original GitHub issueAt this time the Vinyl API expects a user to pass in ids to the member and admin fields.
{
"name": "some-group",
"email": "test@example.com",
"description": "an example group",
"members": [
{
"id": "2764183c-5e75-4ae6-8833-503cd5f4dcb0"
}
],
"admins": [
{
"id": "2764183c-5e75-4ae6-8833-503cd5f4dcb0"
}
]
}
When using the API there doesn’t seem to be a way to look up users like you can with the portal. Its not possible for me to get the ID for Alice so I can send her ID in the payload. I can grab IDs from the browser traffic but that’s not API friendly.
2 solutions I have in mind are:
- expose an api endpoint to look up users by name. I can then get their id and use it to create groups.
/api/users/lookupuser/alice100
- change the group create payload to accept name instead of id . When you receive the name you could do a look up behind the scenes like the portal
{
"name": "some-group",
"email": "test@example.com",
"description": "an example group",
"members": [
{
"id": "alice100"
}
],
"admins": [
{
"id": "alice100"
}
]
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Manage developer accounts using groups in Azure API ...
Associate groups with developers · Select the Groups tab to the left of the screen. · Select Members. Add a member · Press...
Read more >Group and project members API - GitLab Docs
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
Read more >REST API design: how to represent users joining and ...
Doing this through /groups resource seems a management task (e.g admins removing users from groups) rather than someone leaving or joining a ...
Read more >New users' group problem when created via API v3
Hi all! I'm tying to create a new user with api v3 (/rest/api/3/user) without any group. When a make a POST request, a...
Read more >Adding Users to Group via the API
To do this with by group/user names require a scripted rest api (preferably). Other wise you will need to have your business logic...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@pauljamescleary this is adding the reverse lookup
username->id. This can, and probably should, be done together with #930.I was hesitant with this one because it allows for discovering which users exist in the system. However, since this is behind auth, that discovery is possible already through the portal. We need to be sure, though, that we only expose the
id. I don’t want to leak any info about the user other than the fact that their username has anidin VinylDNS.This goes hand-in-hand with #930. I think we should provide an endpoint that simply returns the ID of a user given the username. We already support adding any user to a group by username in the portal.
Similar to #930, we should have an endpoint
GET /users/<username>which returnsidandusername.