Hi @Rodolphe !
To add a user to a user group through the API, you can use this endpoint:
POST https://api.getguru.com/api/v1/groups/{group_id}/members
You’ll have to include the user email(s) in the body of the request, formatted like this:
-"user@email.com"]
Let me know if this works for you!
Also, the documentation that you linked to brings me back to this post - do you mind resharing that link so we can update our documentation?
Thanks!
Joe
Great - thanks @Rodolphe!
Were you able to successfully get this to work with the endpoint/payload I posted above?
Thanks!
Joe
Yes, the trick was to pass the "user@email.com"] as a json dump
My python code snippet:
import json
def api_add_to_group(group_id, user_email):
headers = {'authorization': API_TOKEN, "Content-Type": "application/json"}
data=auser_email]
response = requests.request("POST", 'https://api.getguru.com/api/v1/groups/'+group_id+'/members', headers=headers, data=json.dumps(data))
return response
Awesome - glad to hear you got this working! Let me know if you need anything else.
Joe