I am developping a web application that uses a feature service, what i want to do is save the data in the feature server, and then delete all the features at the start of the application. I am able to save data in the feature service, my problem is how to delete the features in the start of the application. I found a solution to that suggesting that I use the operation: "Delete Features" of the REST API, but I think I am making a mistake in the syntax, here is my code sample:

var theurl= "***/arcgis/rest/services/edt/FeatureServer/0/deleteFeatures"
var request = esri.request({

url: theurl,
// Service parameters if required, sent with URL as key/value pairs
content: {
f: "json",
where: "1=1"}


I don't know what I am missing can you please help

1 Answer 1


the best way to get an idea of what you need to do in your javascript app to interact with ArcGIS Server or ArcGIS Online services successfully is to play around with the REST endpoint for a particular operation interactively and snoop the web traffic to see what requests you are sending.

in this case, the syntax you need would look something like this

      "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/FeatureServer/0/deleteFeatures",
      "content": {
        "objectIds": 123,
        "f": "json"
      }, {"usePost": true

heres a fiddle.

the featureLayer.applyEdits() method is an alternative you might explore as well.

  • its my pleasure :) May 27, 2014 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.