Goal: Manage callbacks over API
Complexity: Medium

Preconditions: 

  • LUCS is installed
  • API Setup and Preconditions are met
  • Service must be defined as Outbound to allow for Callback. To do this, head to LUCS Configurator → Services → Select Service → Set Direction Type to "InboundOutbound"
  • Users (Agents) must be configured and selectable so task Assignment is possible

Related DTOs:

Usage example steps


Used FunctionsActionResults
1

POST Callback

Create an example Callback. In this case, Target is the customer and ServiceSip is the service being called.

Callback creation example

{
  "Target": "sip:smoky.qq@dev.local",
  "SecondsBetweenRetries": 0,
  "Priority": "StrictPriority",
  "ServiceSip": "sip:smoky.car@dev.local"
}
CODE

Repeat this multiple times to get callback tasks appear in the system: 

Callback is visible in LUCS FrontEnd as Callback Task



2

POST Callback


→ Response Body Example: Callback created will have missing DTO items filled out with defaults. An unique ID is being assigned: 

Example Response body of "CreateCallbackDto"

{
  "Id": "0f3cf4cd-71f9-4224-a415-3aa5b37bfd59",
  "Creator": "API",
  "LeftInQueueTimeInSeconds": 3600,
  "AppPoolId": "9925c9b8-8924-49df-ac77-f48dc35f40da",
  "InitiatingSessionId": null,
  "Initiator": null,
  "State": "Pending",
  "RetryType": "SingleSession",
  "RetryCount": 0,
  "Target": "sip:smoky.qq@dev.local",
  "AlternativeTarget": null,
  "MaxRetries": 3,
  "SecondsBetweenRetries": 0,
  "ServiceId": "58c41e40-a491-4119-852a-31fdc62748c6",
  "ServiceSip": null,
  "IncomingServiceSipUri": null,
  "Priority": "StrictPriority",
  "ContextUrl": null,
  "DueDate": "24.06.2019 13:00:56.2732376Z",
  "Supervisor": null,
  "Description": null,
  "ExternalTaskId": null,
  "CallerId": null
}
CODE

Details of Callback are known. 

ID is used for next examples.

3GET CallbackThe same results as shown above can be requested via API by using the unique ID (in this example "0f3cf4cd-71f9-4224-a415-3aa5b37bfd59") as parameter. 

Callback Details are requested

(just as a check)

4POST Search Callbacks

Alternatively you can use the extended Search for multiple callbacks. To get more than 1 search result, repeat step 1 with different "Targets" to create multiple callback requests.

  • If you send an empty body as parameter { } you will get all callback tasks
  • Of course you can use the SearchCallbackRequest DTO to narrow down search results. Here is an example: 

Example Response body of "SearchCallbackRequest"

{
  "Creator": "API",
  "State": "InQueue",
  "ServiceSip": "sip:smoky.car@dev.local",
  "StartDate": "2019-06-25T07:30",
  "EndDate": "2019-06-25T07:35",
}
CODE
Returns Queued Callback Tasks between timespan
5POST Cancel Callback

To remove any callback, the GUID (identifier) is used again. If the task has been removed already or wasn't found, an 404 Error (not found) is thrown. 


Callback is removed from the list of pending callback tasks.

UCIDUC  LUCS API 003