GET deletion job status with /config

Use /config to retrieve deletion job status.

The JSON returned by GET /config requests for companies, organizations, and folders includes a status field with one of the following values.

OK

No operations are in progress regarding the queried object

deleting

The queried object is in the process of being deleted

deleting (XX%)

In long-running deletion tasks for companies and organizations, the queried object is in the process of being deleted and shows the approximate percentage (as an integer value) of the delete operation that has completed

The sample below shows JSON that is returned by a call to the /config /COSHORT/ORGSHORT/FOLDER API when no delete operation is in progress.

Figure 1. Folder Status When No Delete Operation is In Progress
{
    "servers": [
        "asrsrvr1"
    ],
    "nspeakers": 2,
    "audiotype": "Stereo",
    "created": "2017-09-05",
    "purifyaudio": false,
    "purifytext": true,
    "modelchan0": "eng1:callcenter",
    "status": "OK",
    "modelchan1": "spa1:callcenter",
    "agentchan": 0,
    "mode": "active",
    "callback": {},
    "apps": [],
    "asroptions": {},
    "custom_meta": []
}

The next sample shows JSON that is returned by a call to the /config/ COSHORT/ORGSHORT/FOLDER API when a delete operation is in progress.

Figure 2. Folder Status When a Delete Operation is In Progress
{
    "servers": [
        "asrsrvr1"
    ],
    "nspeakers": 2,
    "audiotype": "Stereo",
    "created": "2017-09-05",
    "purifyaudio": false,
    "purifytext": true,
    "modelchan0": "eng1:callcenter",
    "status": "deleting",
    "modelchan1": "spa1:callcenter",
    "agentchan": 0,
    "mode": "active",
    "callback": {},
    "apps": [],
    "asroptions": {},
    "custom_meta": []
}

After using the /config API's DELETE method, it is a good idea to call the /config API's GET method for the object that you requested deletion of. If the GET call returns JSON like that shown in this section's second example, the folder is in the process of being deleted.

If the call returns " Folder not found: $folder", it means that the DELETE operation has completed. When calling the /config API to get DELETE status information, you will therefore need to test for both a successful return code (where JSON is returned, and the status field in that JSON is one of OK , deleting or deleting( NN ) and a return message which indicates that the queried object does not exist, and has therefore already been deleted.

The return message deleting( NN ) can be returned when deleting companies or organizations, where NN is an integer value that gives an estimate of the percentage of the delete operation that has completed.