Hi Razi,
Thanks, I am using the Rest API with c# code but have used in the same way as it is there in the JavaScript code. I am using the same API - /API/Group/AddMembers and also getting the Status as Ok but the changes are not reflected in dundas interface. Following is the code which I have used -
try
{
using (HttpClient httpClient = new HttpClient())
{
string groupID = “4ea30ca2-c0d8-487c-ac9f-9b3ec43659cc”;
Guid guidAccountId = Guid.Empty;
guidAccountId = new Guid(AccountId);
Guid[] accountIds = new Guid[1];
accountIds[0] = guidAccountId;
string url = System.Configuration.ConfigurationManager.AppSettings["DundasAPIURL"].ToString() + "api/group/AddMembers/" + groupID + "?sessionId=" + SessionId + "";
ModifyGroupOptions modifyGroupOptions = new ModifyGroupOptions();
modifyGroupOptions = new ModifyGroupOptions()
{
AccountIds= accountIds
//GroupIds = null
};
JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
string logOnTokenOptionsAsString =
javaScriptSerializer.Serialize(modifyGroupOptions);
HttpContent requestBody = null;
requestBody =
new StringContent(logOnTokenOptionsAsString, Encoding.UTF8, "application/json");
using (var response = httpClient.PostAsync(url, requestBody).Result)
{
if (response.StatusCode == HttpStatusCode.OK)
{
string jsonObject = response.Content.ReadAsStringAsync().Result;
}
}
}
return string.Empty;
}
Could you please look into that.
Thanks & Regards
Aseem