Getting DELETE Status Information
The JSON returned by GET calls to the /config
API for companies, organizations, and folders include a status
field that provides high-level status information about the object that you are inquiring about. This is useful for long-running operations such as a DELETE operation. The value of the status
field will be one of the following:
- 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
API when no delete operation is in progress./COSHORT/ORGSHORT/FOLDER
{
"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/
API when a delete operation is in progress.COSHORT/ORGSHORT/FOLDER
{
"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:
FOLDERNAME
", 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.