Harnessing the strength of Calabrio Teleopti WFM, Part 2: Updating agent information – Calabrio (UK)
Workforce Management
Find More Great Content

Harnessing the strength of Calabrio Teleopti WFM, Part 2: Updating agent information

Once again the blog turns its focus to more technical matters as Robin Karlsson, Technical Lead at Teleopti, offers us the second part in his ‘How best to use Calabrio WFM’s API’ series, focusing on agent information.

agent informationIn the first blog of this series we showcased how to make the initial connection with the API and how to extract some basic agent information. In this second blog, we’ll introduce the concept of making updates to agent information in Calabrio WFM.

To issue an update you’ll mostly use the InternalService.ExecuteCommand() and send in the appropriate command object. The available commands are grouped in a separate namespace in the CHM reference file provided by Teleopti. Each command will require a different set of input parameters defined on the object itself.

Some of the older modification commands are still available as separate functions directly on each service.

You’ll need permissions to open the People tool for the selected agent if you wish to update that agent’s details. Otherwise you’ll receive a ‘permission denied’ exception. The permissions are changed and granted in the Permissions module in the regular Calabrio WFM client.

To update the email address of an agent we first need to input the details and then issue the update. It can be achieved using a simple query to input the agent into the system using the ID we previously got when inputting the whole team and then modify the email address and send the agent’s profile back to the API.

var organisationService = new OrganisationService();
var agent = organisationService.GetPersonsByQuery(new GetPersonByIdQuery { PersonId = “{892B0DB4-415B-45D8-A61A-3E4DB401AB20}” }).First();
agent.Email = “[email protected]”;
organisationService.UpdatePerson(agent);

As you can see, organisationService.GetPersonsByQuery() will return a list of people. However, when we use the query GetPersonByIdQuery it will return either 1 or 0 agents as the PersonId is unique. In the example code above, we anticipate that we’re getting one agent back, but you can of course add a check to reveal whether we got an agent in the response.

Another example is to set values in the customizable, optional columns in People. It requires setting more things in place and using the newer InternalService.ExecuteCommand() to change the values. Please note that the column must exist before you can apply the value. If the column or person doesn’t exist, you’ll get an exception back from the API.

var internalService = new InternalService();
var result = internalService.ExecuteCommand(new SetPersonOptionalValuesForPersonCommandDto {PersonId = “{892B0DB4-415B-45D8-A61A-3E4DB401AB20}”,OptionalValueCollection = new[] {new OptionalValueDto {Key = “ShoeSize”,Value = “42”} }});
if (result.AffectedItems == 1)
{
//The update of the optional column value was successful
}

Most of the details in People can be changed in a similar manner. There are also more advanced commands available, for example, ‘modify schedules’ and ‘reflect changes in employment conditions’.

Like for every part of this series you’ll find the sample code on Teleopti’s official GitHub repository available at https://github.com/Teleopti/sdk-sample.

Robin Karlsson is a technical lead at the Calabrio R&D department based in Stockholm. He has 20 years of experience in the development of business administration software, and has been with Teleopti, which was acquired by Calabrio in 2019, since 2007. Every day, he’s focused on how to improve the user experience for the Calabrio WFM software.

Start typing and press Enter to search

WFM
Send this to a friend