Fixes issue #134 - Delete a list with the API

This commit is contained in:
stom79 2017-12-13 16:01:50 +01:00
parent b8cd4f671b
commit 239ee8e3bf
1 changed files with 18 additions and 0 deletions

View File

@ -1183,6 +1183,24 @@ public class API {
}
/**
* Delete a list by its id
* @param id String, the id of the list
* @return APIResponse
*/
public int deleteList(String id){
try {
HttpsConnection httpsConnection = new HttpsConnection();
httpsConnection.delete(getAbsoluteUrl(String.format("/lists/%s", id)), 60, null, prefKeyOauthTokenT);
actionCode = httpsConnection.getActionCode();
} catch (HttpsConnection.HttpsConnectionException e) {
setError(e.getStatusCode(), e);
}catch (Exception e) {
setDefaultError();
}
return actionCode;
}
/**
* Parse json response an unique account
* @param resobj JSONObject