Implementing Bulk Delete Rest Api in Android Application

Hi, I need to make a bulk delete in one of my tables called TuckShop through my Android Application. I am sure I am just overlooking something. This is my AsyncTask class that runs in the background and tries to execute the REST Delete request:

private class DeleteEverythingFromTuckShop extends AsyncTask<Void,Void,Exception>{

 String API_URL = "<1000";

 protected void onPreExecute() {
 //start showing progress dialog

 protected void onPostExecute(Exception e) {
 //dismiss progress dialog

 if (e != null)
 //show toast with exception message


 protected Exception doInBackground(Void... params) {
 HttpURLConnection urlConnection = null;

 Exception exception = null;

 try {
 URL url = new URL(API_URL);
 urlConnection = (HttpURLConnection)url.openConnection();

 urlConnection.setRequestProperty( "application-id","CFD05C1B-AB80-7F6D-FFF6-49BEE0A96400" );
 urlConnection.setRequestProperty( "secret-key","6B9AFBA6-503F-B34F-FF21-BB0AD91B0910" );
 urlConnection.setRequestProperty( "application-type", "REST" );

 } catch (MalformedURLException e) {

 exception = e;
 } catch (IOException e) {

 exception = e;
 }finally {

 return exception;


I hope you can help me sort this out. Using Backendless 4. Api keys in above example code is not the real application api keys.



Also tried …where=learnerBalanceAfter%3C1000

Hi Johan,

Have you tested your where clause in console to make sure it returns any objects?


Thanks for your prompt reply. I am totally new to REST so how do I do that?

I have 14 entries in the table. It returns 10

My Application runs without errors, but nothing happens. Also, why return only 10 if there is 14 that should be returned. All values for that field is 6 or less.

Changing the page size in Console returns all 14

Thus, my URL is fine. Somewhere in the Java/Android coding

Your java code doesn’t send anything to the server. Calling “connect()” is not enough. Read this or the java doc for more info:

Thank you very much!! I added one line : urlConnection.getInputStream(), before I called connect(). Everything works 100% now. Deleted all 14 records in that table directly from my code in Android.

One question…In the console I set the page size to 100 and offset to 0. Will that make a difference in BULK delete? Will it then only delete the first 100 objects?</img></img>

TuckShop is my table name and learnerBalanceAfter is my field. As Mark suggested, use the URL provided in the Console.

My code that now works for someone else having the same question. Thanks Mark!

I created 300 objects with a for loop. That call deleted all of them.

Thanks for your help Mark!