Update when agents are added or removed in the Agent Group with the Genesys SDK

http://Hello,

I want to save changes that are made to an agent group with the SDK but somehow it doesn’t work and I can’t find the error.

Here is my Code:[img]

ConfServerProtocol confServerProtocol = new ConfServerProtocol(new Endpoint(new Uri(configServerUri)));
confServerProtocol.ClientApplicationType = (int)CfgAppType.CFGSCE;
confServerProtocol.ClientName = ClientName;
confServerProtocol.UserName = UserName;
confServerProtocol.UserPassword = UserPassword;

            confServerProtocol.Open();

            //string sessionId = CTI_Manager_AgentGroup";
            string sessionId = Guid.NewGuid().ToString();

            var confServerConfig = new ConfServerConfiguration(sessionId);
            confServerConfig.Uri = new Uri(configServerUri);
            confServerConfig.ClientName = ClientName;
            confServerConfig.ClientApplicationType = CfgAppType.CFGSCE;
            confServerConfig.UserName = UserName;
            confServerConfig.UserPassword = UserPassword;

            ProtocolManagementService pmService = new ProtocolManagementService();
            pmService.Register(confServerConfig);

            EventBrokerService eventBroker = BrokerServiceFactory.CreateEventBroker(pmService.Receiver);
            eventBroker.Activate();

            IConfService confService = ConfServiceFactory.CreateConfService(pmService[sessionId], eventBroker);

            pmService[sessionId].Timeout = new TimeSpan(0, 0, 5);
            pmService[sessionId].Open();

            CfgAgentGroupQuery qAgentGroups = new CfgAgentGroupQuery();
            qAgentGroups.Name = agentGroup;
            CfgAgentGroup group = confService.RetrieveObject<CfgAgentGroup>(qAgentGroups);
            group.Agents.Clear();
            foreach (string employeeID in ListaEmployeeId.EmployeeIDs)
            {
                try
                {
                    List<CfgPerson> agents = (List<CfgPerson>)group.Agents;
                    //if (!BuscaAgenteEnGrupo(agents, employeeID))
                    //    continue;
                    CfgPersonQuery qAgent = new CfgPersonQuery();
                    qAgent.EmployeeId = employeeID;
                    CfgPerson agent = confService.RetrieveObject<CfgPerson>(qAgent);
                    agents.Add(agent);
                    group.Save();
                } catch (ConfigException e) {
                    continue;
                }
            }
            confServerProtocol.Close();
        }
        catch (Exception ex)
        {
            
        }

Can somone explain what I#m doing wrong?

Regards

can you explain what do you want to do? what error do you get?
Crystal ball are broken

Thank you Cavagnaro for answering, I’ll explain, there is a web page where the end user selects the agent group when selecting, it opens 2 containers, the container on the left displays the agents that you can add to the agent group and on the left The container on the right displays the agents that are currently in the agent group.

The logic that I have made is to be able to update the changes that the end user is going to make, that is, to add agents or remove agents, so the logic that the end user has to make is to update the changes.

The logic that I have built when testing in postman I get this error:

url
http://localhost:8084/api/AgentGroup?agentGroup=VAG_Testing

PART OF THE RESPONSE

IIS 8.5 Detailed Error - 404.0 - Not Found

That’s nothing to do with Genesys - the problem is how you have deployed your custom web page in IIS!