I'm starting to write some python scripts to interface with the API to use for User Management. I've been able to successfully extract existing users and update user permissions using a similar version of the script provided as an example from Team Viewer API (i.e. ExportUserCSV.py and ImportUserCSV.py).
I'm now trying to add/remove single users through the API as well. It looks like I've been able to add the user (i.e. user received the welcome email). However, in my attempt to deactivate the user, it looks like it has entered an unknown state. For example, if I try to retrieve that user from the API, it can't find it (email purposely obscured):
Get single user by mail (user@company.com)
Request [GET] https://webapi.teamviewer.com/api/v1/users?email=user@company.com&full_list=true
200
Request ok!
Result: {'users': []}
No user with email=user@company.com found.
However, when I try to create that user (again), I'm getting an error that the email is already used:
Creating user [user@company.com]
Request [POST] https://webapi.teamviewer.com/api/v1/users
Payload :{"name": "User Name", "email": "user@company.com", "password": "somePassWord", "permissions": "ShareOwnGroups,Edit
Connections,EditFullProfile,ViewOwnConnections", "language": "en"}
Headers :{'Authorization': 'Bearer 123456-BLABLABLABLABLA', 'Content-Type': 'application/json; charset=utf-8', 'Co
ntent-Length': '42'}
400
Unexpected response code. Received content was:
{"error":"invalid_request","error_description":"This e-mail address is already in use","error_code":1}
I also tried updating the user, setting the 'action' to True, however, it first needs to find the email first, and, as mentioned in the previous block, it can't find that email.
Any suggestions on how to either completely remove that User/email or activate the existing user?