Assisted Manual Outbound

The following webservices are used to integrate Assisted Manual Outbound (AMO) with external systems.

  • We show all calls as with the utility curl, but you are free to use any other programming or scripting language. The appear here written on multiple lines for readability but are meant as a single line.

  • All calls can be done with GET or POST as you best see fit and generally have a maximum allowed payload of ~1Mb

  • All calls require an API user holding the security key USR_AMO.

Editing lists: amoUpdateLists

When running AMO campaigns, you may want to view the status of all lists belonging to a campaign, and change the settings of the "mixer", that is, the probability of each list to be selected, right from an API call.

To see all lists related to a campaign, you may call the following service:

curl -v --user robot:bot http://localhost:8080/qm/amoUpdateLists.do -G
   --data-urlencode 'data={"amoCampaignName": "Sales"}''

This returns all lists related to campaign Sales; for each list you get an object like the following:

{
  "listName" : "Recalls Apr 24",
  "listNotes" : "To be completed by end of April",
  "weight" : 10,
  "listState" : "open",
  "dialerState" : "open",
  "dialerCanReserve" : "open",
  "nNumbersAdded" : 546,
  "nNumbersCompleted" : 93,
  "nNumbersPulled" : 118,
  "lastPull" : "2024-04-10 12:30:10"
}

Fields are as follows:

  • weight is the relative weight of picking a call from this list, if the list is available.

  • listState: whether the list is available or paused.

  • dialerState: whether all numbers are completed (that is, have been dialed, and we have a final status for each and every one of them)

  • dialerCanReserve: whether new numbers can be read form this list. Before being complete, when the last number is pulled from it, a list will not be available for reserving, but it wont’t be complete either, until we have a final status for such number and we know whether we need a reschedule or we have a final code.

If you want to modify the settings of one or more lists, you can pass one or more objects like the following;

{
  "listName": "Recalls Apr 24",
  "listNotes": "Change me",
  "weight": 20,
  "paused": true
}

For example a complete API call may look like:

curl -v --user robot:bot http://localhost:8080/qm/amoUpdateLists.do -G
   --data-urlencode 'data={
     "amoCampaignName": "Sales",
     "listUpdates": [
         {"listName": "New list",  "weight": 20, "paused": false}
     ]
   }'

The listNotes field is optional; if unset, is left as it is.

If you try and modify a list which name does not exist, it will be created. As a side effect, you cannot rename an existing list using this API call.

Adding and editing numbers: amoUpdateNumbers

You can add or edit numbers on an existing list by issuing the following call:

curl -v --user robot:bot http://localhost:8080/qm/amoUpdateNumbers.do -G
     --data-urlencode 'data={
          "amoCampaignName": "My Campaign",
          "listName": "Sale Recalls",
          "numbers": [
           { "number": "123a", "attrs": {"ax": "1"} },
           { "numberId": "9915", "number": "4567"}
          ]
      }'

Numbers are expressed with a JSON object like:

{
  "numberId" : "9915",
  "number" : "123a",
  "validFrom" : "",
  "attrs" : {
      "name" : "John",
      "surname": "Doe"
  }
}

Where:

  • numberId is the ID of an existing number that was written using the API. You can leave it blank to signify that a new number is to be added.

  • number is the actual number to be called

  • validFrom is the beginning of a number’s validity. If blank, number is immediately available for being called. Expressed in the format 2024-03-20 10:20:30, as valid in the QM server’s current time-zone

  • attrs is a set of string attributes that are to be diplayed and/or logged on the AMO recall

When calling the webservice amoUpdateNumbers, the reply is similar to the one below:

{
  "amoCampaignName" : "My Campaign",
  "amoListName" : "Sale Recalls",
  "numbers" : [ {
    "numberId" : "9915",
    "number" : "4567",
    "validFrom" : "",
    "attrs" : { },
    "error" : ""
  }, {
    "numberId" : "19",
    "number" : "456",
    "validFrom" : "",
    "attrs" : {"ax": "1"},
    "error" : ""
  } ],
  "errors" : [ ],
  "durationMs" : 3
}%

The list numbers contains all the records that were successfully written or updated, while errors contains all failed attempts, each with their error message.

Please note that by adding numbers to a list, you may change its update its dialer status - for example, a list that is marked "completed" will re-open if new numbers are added to it, and an AMO campaign marked "completed" because all of its list were "completed" will re-open as well.

If you need to further edit numbers, remember to keep track of the numberId returned.