<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSON input for deleteFeatures in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/json-input-for-deletefeatures/m-p/695709#M3374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot to add, this is the response I get back:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;code message                       details 
---- -------                       ------- 
 500 Unable to complete operation. {Unable to perform deleteFeatures operation.}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:48:51 GMT</pubDate>
    <dc:creator>ITAdmin6</dc:creator>
    <dc:date>2021-12-12T16:48:51Z</dc:date>
    <item>
      <title>JSON input for deleteFeatures</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/json-input-for-deletefeatures/m-p/695708#M3373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script that accesses the REST API to add, update and delete features. Because I'm making a number of changes at a time I'd like to send through multiple changes per request. Currently I have add and update working but can't get delete to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if I've got the JSON format wrong or whether deleteFeatures doesn't take JSON as the body of a request. I've got it to delete with the parameters in the URL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://vm39gis:6443/arcgis/rest/services/LINZ/Prod_LINZ_NZ_Datasets/FeatureServer/5/deleteFeatures?f=json&amp;amp;where=id=" title="https://vm39gis:6443/arcgis/rest/services/LINZ/Prod_LINZ_NZ_Datasets/FeatureServer/5/deleteFeatures?f=json&amp;amp;where=id=" rel="nofollow noopener noreferrer" target="_blank"&gt;https://&amp;lt;server&amp;gt;:6443/arcgis/rest/services/&amp;lt;folder&amp;gt;/&amp;lt;featurelayer&amp;gt;/FeatureServer/5/deleteFeatures?f=json&amp;amp;where=id=12345&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if I omit the &amp;amp;where and post some JSON it doesn't work (this way matches the add and update format that works for me):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;features=[{"attributes":{"OBJECTID":4715756}},{"attributes":{"OBJECTID":4715757}},{"attributes":{"OBJECTID":4715758}},{"attributes":{"OBJECTID":4715759}},{"attributes":{"OBJECTID":4715760}},{"attributes":{"OBJECTID":4715761}},{"attributes":{
"OBJECTID":4715762}},{"attributes":{"OBJECTID":4715763}},{"attributes":{"OBJECTID":4715764}},{"attributes":{"OBJECTID":4715765}}]&lt;/PRE&gt;&lt;P&gt;Also tried this format:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;features=[{"attributes":{"OBJECTID":"4715756,4715757,4715758,4715759,4715760,4715761,4715762,4715763,4715764,4715765"}}]&lt;/PRE&gt;&lt;P&gt;Potentially this way is not available? In the documentation, add and update have example JSON input but delete does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/json-input-for-deletefeatures/m-p/695708#M3373</guid>
      <dc:creator>ITAdmin6</dc:creator>
      <dc:date>2021-12-12T16:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: JSON input for deleteFeatures</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/json-input-for-deletefeatures/m-p/695709#M3374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot to add, this is the response I get back:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;code message                       details 
---- -------                       ------- 
 500 Unable to complete operation. {Unable to perform deleteFeatures operation.}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/json-input-for-deletefeatures/m-p/695709#M3374</guid>
      <dc:creator>ITAdmin6</dc:creator>
      <dc:date>2021-12-12T16:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: JSON input for deleteFeatures</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/json-input-for-deletefeatures/m-p/695710#M3375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reading the documentation a little closer I see I got the format a little wrong. However no matter what I tried and what format I had the data in I couldn't get the JSON format right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I managed to reverse a c# library to can post objectids using 'application/x-www-form-urlencoded' as the format of the body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the body ends up looking like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"objectIds=&amp;lt;objectid&amp;gt;%2C&lt;SPAN&gt;&amp;lt;objectid&amp;gt;%2C&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;objectid&amp;gt;%2C&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;objectid&amp;gt;"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The %2C represents commas.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A little messy but gets the job done.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2019 01:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/json-input-for-deletefeatures/m-p/695710#M3375</guid>
      <dc:creator>ITAdmin6</dc:creator>
      <dc:date>2019-11-13T01:01:21Z</dc:date>
    </item>
  </channel>
</rss>

