-
Re: Adding users to security group using REST API giving a 401 error
Raj Vachhani Apr 27, 2017 11:50 AM (in response to mayuriumranikar)I had hard time to get it work. I was synchronizing the Active directory groups members to Jive. Try below function to generate the JSON. It works for me.
private string ConstructPeopleURLs(List<string> jiveIds)
{
// string[] arrJiveIds = jiveIds.Split(',');
StringBuilder sb = new StringBuilder();for (int i = 0; i < jiveIds.Count(); i++)
{
if (jiveIds.Count() == i + 1)
sb.AppendFormat("\"{0}{1}{2}\"", JiveAPIUrl, "people/", jiveIds[i]);
else
sb.AppendFormat("\"{0}{1}{2}\",", JiveAPIUrl, "people/", jiveIds[i]);
}string val = "[" + sb.ToString() + "]";
return val;}
-
Re: Adding users to security group using REST API giving a 401 error
Ryan Rutan Jun 1, 2017 10:45 AM (in response to mayuriumranikar)1 person found this helpfulOne thing, the payload is an array of strings, so do:
["xxxxxx","xxxxxx"]
as the full payload...do not try to wrap it in a JSON structure.
Status code 401 means unauthorized. Make sure you are using a rightly scoped admin token and/or that the user you are using ... as marked as an admin of that security group and/or has the appropriate Admin permissions to perform that request.
Hope that helps.