Goal: Block and Unblock, Set presence Status of specific users
Complexity: Low

Preconditions: 

Related DTOs:

Usage example steps


Used FunctionsActionResults
1

GET ServiceID Users

To find our target users, you may request the list of "isSelectable" users first if not already known. In this example we signed on with one test-user only, so we get details of only that user returned.

Important parts to note are:

  • The User ID (for further API processing steps)
  • "isSelectable = true" (as the user is currently online)
  • "IsBlockedByLuwareApi": false, = shows that the user is currently not blocked by the API


Return list of selectable users

[
  {
    "Id": "854822ed-4a2a-4eb1-b07f-637ed3eab729",
    "SipUri": "sip:smoky.cc@dev.local",
    "FirstName": "Curt",
    "LastName": "Connors",
    "IsBlockedByLuwareApi": false,
    "CurrentProfile": "Day Shift",
    "DefaultProfile": "Day Shift",
    "NotReadyReason": null,
    "NotSelectableReason": null,
    "AAConfiguration": "AA All On",
    "NumberOfSimultaneousIm": 3,
    "ConversationAsService": "ExternalConversations",
    "IsBusySelectable": true,
    "IsBusyInAMeetingSelectable": true,
    "ShowAwayAsOffline": true,
    "BusyOnBusyInACallEnabled": false,
    "CanLoginToRecordingManager": false,
    "RetargetType": "NoRetarget",
    "RetargetSource": null,
    "RetargetTo": null,
    "RetargetPrivateNumber": false,
    "RetargetOnlyIfInDutyProfile": false,
    "RecordingType": "Full",
    "Traits": [
      {
        "TraitNode": "Expertise/Customer Care Services",
        "Attribute": "Expert"
      },
      {
        "TraitNode": "Expertise/Insurance Services",
        "Attribute": "Expert"
      },
      {
        "TraitNode": "Language/English",
        "Attribute": "Native"
      }
    ],
    "Profiles": [
      {
        "Name": "Day Shift",
        "Responsibilities": [
          {
            "TraitNode": "Expertise/Customer Care Services",
            "Responsibility": "High"
          },
          {
            "TraitNode": "Expertise/Insurance Services",
            "Responsibility": "Medium"
          }
        ]
      },
      {
        "Name": "Night Shift",
        "Responsibilities": [
          {
            "TraitNode": "Expertise/Customer Care Services",
            "Responsibility": "High"
          },
          {
            "TraitNode": "Expertise/Insurance Services",
            "Responsibility": "Medium"
          }
        ]
      },
      {
        "Name": "OffDuty",
        "Responsibilities": []
      }
    ],
    "Roles": [],
    "OrganizationUnitNodeId": "719ffbf8-714b-488a-ae90-0b4100e2f139",
    "Sid": "S-1-5-21-870184815-4058679007-2540742146-76263",
    "Sam": "smoky.cc",
    "Upn": "smoky.cc@dev.local",
    "Email": "smoky.cc@dev.local",
    "IsSelectable": true,
    "PresenceToken": "None",
    "PresenceState": "Online",
    "Capabilities": {
      "Im": true,
      "Audio": true,
      "Video": true,
      "DesktopSharing": true,
      "ConversationContext": true
    }
  }
]
CODE

→ Code 200

User ID of a selectable user is now known

User is not yet blocked

2

POST block user

and

POST Tasks to test

We now block the user, which changes the following parameters in it's returned DTO:

  • IsBlockedByLuwareApi": true,
  • "NotSelectableReason": "InAServiceTask",
  • "IsSelectable": false,

Return list of selectable users

{
  "Id": "854822ed-4a2a-4eb1-b07f-637ed3eab729",
  "SipUri": "sip:smoky.cc@dev.local",
  "FirstName": "Curt",
  "LastName": "Connors",
  "IsBlockedByLuwareApi": true,

... (shortened) ...

  "NotSelectableReason": "InAServiceTask",

... (shortened) ...

  "IsSelectable": false,
  "PresenceToken": "None",
  "PresenceState": "Online",

... (shortened) ...

}
CODE

Note that the presence state is not affected by this, so the user will not see the block in his messenger.

You can use POST Tasks to get a testing task running. If no other user is selectable the task will remain pending. 

Test Task for Block-Checking

{
  "ExternalTaskId": "testblockingtask",
  "Service": "7830678b-03b1-4e71-af33-a3987142519f",
  "Caller": "Get me Curt Connors now!",
  "PreferredAgents": [
    "sip:smoky.aa@dev.local", 
	"sip:smoky.bb@dev.local", 
	"sip:smoky.cc@dev.local"
  ],
  "ConsiderPreferredAgentsOnly": true,
  "Required": {
    "Im": true,
    "Audio": true,
    "Video": true,
    "DesktopSharing": true,
    "ConversationContext": true
  },
  "DistributeToAgent": true,
  "DistributeToAgentRONATimeoutInSeconds": 50
}
CODE

Block → Code 200 (Returns changed user DTO parameters)

Tasks → Code 200 (Returns TaskID)






















3POST unblock user

We now unblock the user to see if the task is immediately distributed as the system has no other alternatives (being online and selectable)

Return list of selectable users

{
  "Id": "854822ed-4a2a-4eb1-b07f-637ed3eab729",
  "SipUri": "sip:smoky.cc@dev.local",
  "FirstName": "Curt",
  "LastName": "Connors",
  "IsBlockedByLuwareApi": false,
 
... (shortened) ...

  "NotSelectableReason": "InAnExternalTask",

... (shortened) ...

  "IsSelectable": false,
  "PresenceToken": "None",
  "PresenceState": "Online",

... (shortened) ...

}
CODE

Note: The the block is removed"IsBlockedByLuwareApi": false

However the user's presence is still unaffected = "online" , but now ""IsSelectable": false" is set. This is because the user immediately has received the pending task and chose to accept, making him unavailable for further task distribution selects.

Unblock → Code 200 (Returns changed user DTO parameters)
4POST setpresence

Since the presence of the user remains unaffected by external task distribution (online), it could be preferable to set a user's presence to DND automatically upon accepting to handle a task. 

Via the API POST setpresence command you easily set the user to "DoNotDisturb" remotely.

In the example below, the Client configuration combined with Agent Assistant makes your Agents automatically aware that they need to provide a not-ready reason (NRR) during the task handling. It also informs the Agent their task triggered automation in Skype for Business, which you might control individually based on a external tasks severity.


→ 200 (No body)

UCIDUC  LUCS API 002