Team Members API

The DE Apex API includes methods to manage the members of a team.

Add Team Members to Team

global static void addTeamMembersToTeam(String teamName, List teamMembers)

Adds the list of team members (users or queues) to the team using the TeamMemberDTO parameter. An optional named shift or individual weighting value can be specified for each team member.

Example

Adds two new users to the "North Coast" team, for one of the new members we specify an individual weighting of 2 and the shift "Night Shift".

// Active User Ids
String andyId = // Andy's User.Id;
String barclayId = // Barclay's User.Id;
// Create team member objects
n2de.TeamMemberDTO andyTeamMember = new n2de.TeamMemberDTO(andyId);
n2de.TeamMemberDTO barclayTeamMember = new n2de.TeamMemberDTO(barclayId, 2, 'Night Shift');
// Add the members to the team
n2de.GlobalAPITeamMembers.addTeamMembersToTeam('North Coast', new List<n2de.TeamMemberDTO>{
  andyTeamMember, barclayTeamMember
});

  • The team name is required and must be valid
  • The users/queues must be valid and cannot already be members of the team
  • The users/queues cannot be a source for any of the distributors within the team
  • If specified, the named shift must exist
  • If specified, the weighting must be a number between 0.25 and 4, in increments of 0.25

 Remove Team Members From Teams

global static void removeTeamMembersFromTeam(String teamName, List<n2de.TeamMemberDTO> teamMembers)

Removes the list of team members (users or queues) from the team using the TeamMemberDTO parameter.

Example

Removes two users from the "North Coast" team.

// Active User Ids of existing members in the team
String andyId = // Andy's User.Id;
String barclayId = // Barclay's User.Id;
// Create team member objects
n2de.TeamMemberDTO andyTeamMember = new n2de.TeamMemberDTO(andyId);
n2de.TeamMemberDTO barclayTeamMember = new n2de.TeamMemberDTO(barclayId);
// Remove the members from the team
n2de.GlobalAPITeamMembers.removeTeamMembersFromTeam('North Coast', new List<n2de.TeamMemberDTO>{
    andyTeamMember, barclayTeamMember
});

  • The team name is required and must be valid
  • The users/queues must be valid and existing members of the team

Assign Shift To Team Members

global static void assignShiftToTeamMembers(String teamName, String shiftName, Set<String> userOrQueueIds)

Assigns the provided shift, or Team Hours if the shiftName is null, to the team members that are specified via their user or queue id.

Example

Assigns the "Day Shift" shift to two users in the "North Coast" team.

// Active User Ids of existing members in the team
String andyId = // Andy's User.Id;
String barclayId = // Barclay's User.Id;

// Assign the shift
n2de.GlobalAPITeamMembers.assignShiftToTeamMembers('North Team', 'Day Shift', new Set<String>{
andyId, barclayId
});

  • The team name is required and must be valid
  • The team must not be using the shift planner
  • The shift name can be left blank to assign to the Team Hours, but if provided needs to be the name of a valid shift
  • The users/queues must be valid and existing members of the team

How did we do?

Team Members API Parameters

Contact