link icon
Ask The Community

Why do I get "Bad Request" for Sharing Group with User?

agdev Posts: 3 ✭✭
edited July 15 in API and scripting

I'm trying to use the TeamViewer API to share a group with a user.

To obfuscate the user ID and group ID, I will use $user and $group to represent their respective IDs.

If I run GET$user, I can verify that a user does exist and is active for that user ID.

Similarly, I ran GET$group to verify that the group does exist, and is not currently shared with $user.

Now, I try running POST$group/share_group with my token in the Authorization header and a JSON body as follows:

{'users': [ { 'userid': '$user', 'email': '[email protected]', 'permissions': 'read' } ] }

But in response I get a 400 status BAD REQUEST error. Is there something syntactically wrong here? I've confirmed both the user ID and group ID exist via the API, so I'm running out of ideas for what is happening.