<?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: feature service rest request syntax in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440623#M40652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jerome, thanks for the info. I know about that documentation, but feel that it lacks a useful example for what I'm trying to do. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ended up switching tacks a bit and got this to work using the applyEdits operation on the feature service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The syntax is like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;var url = esri.urlToObject("http://webservices.nwmaps.net/ArcGIS/rest/services/ArcGISOnline/FOGIncidents/FeatureServer/1/applyEdits?deletes=" + String(incidentID) + "&amp;amp;f=json");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;incidentID in above code is an alias for objectid. ApplyEdits does either an add, edit or delete operation depending on the parameters so it gets what I'm after.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still would like to see this spelled out better in ESRI REST docs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Feb 2013 22:08:33 GMT</pubDate>
    <dc:creator>ZorbaConlen</dc:creator>
    <dc:date>2013-02-25T22:08:33Z</dc:date>
    <item>
      <title>feature service rest request syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440621#M40650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using ajax to make requests to feature services to add, edit or delete. I have this working for adding features like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;urlParams = "[{'attributes' : {'AssetNumber' : '" + asset + "', 'Description' : '" + description + "'}}]";
var url = esri.urlToObject("http://xxxxx/ArcGIS/rest/services/ArcGISOnline/FOGIncidents/FeatureServer/1/addFeatures?features=" + urlParams + "&amp;amp;f=json");
 var requestHandle = esri.request({ 
&amp;nbsp;&amp;nbsp;&amp;nbsp; url: url.path,
 content: url.query,&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; load: addFogRequestSucceeded, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; error: addFogRequestFailed 
&amp;nbsp; }, {useProxy:true, usePost:true});&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This works great. But when it comes to the delete operation, I'm having trouble figuring out the syntax. This is not really documented in enough detail to be useful. I know that I can either provide a where clause or a list of obectids, but I need the exact syntax.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it would be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;urlParams = "'where' : 'incidentID = 1'";
&amp;nbsp; var url = esri.urlToObject("http://xxx/ArcGIS/rest/services/ArcGISOnline/FOGIncidents/FeatureServer/1/deleteFeatures?" + urlParams + "&amp;amp;f=json");
&amp;nbsp; var requestHandle = esri.request({ 
&amp;nbsp;&amp;nbsp;&amp;nbsp; url: url.path,
 content: url.query,&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //load: delFogRequestSucceeded, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //error: delFogRequestFailed 
&amp;nbsp; }, {useProxy:true, usePost:true});&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are examples documented anywhere? ESRI? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could also use help with edit, add attachment and delete attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 18:46:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440621#M40650</guid>
      <dc:creator>ZorbaConlen</dc:creator>
      <dc:date>2013-02-25T18:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: feature service rest request syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440622#M40651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Zorba,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A reference can be found &lt;/SPAN&gt;&lt;A href="http://services.arcgis.com/help/index.html"&gt;here&lt;/A&gt;&lt;SPAN&gt;. You can find the syntax in the &lt;/SPAN&gt;&lt;A href="http://services.arcgis.com/help/fsDelete.html"&gt;deleteFeature&lt;/A&gt;&lt;SPAN&gt; operation. Editing operations for attachment are also documented in the same site.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jerome&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 20:09:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440622#M40651</guid>
      <dc:creator>JanelYang</dc:creator>
      <dc:date>2013-02-25T20:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: feature service rest request syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440623#M40652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jerome, thanks for the info. I know about that documentation, but feel that it lacks a useful example for what I'm trying to do. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ended up switching tacks a bit and got this to work using the applyEdits operation on the feature service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The syntax is like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;var url = esri.urlToObject("http://webservices.nwmaps.net/ArcGIS/rest/services/ArcGISOnline/FOGIncidents/FeatureServer/1/applyEdits?deletes=" + String(incidentID) + "&amp;amp;f=json");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;incidentID in above code is an alias for objectid. ApplyEdits does either an add, edit or delete operation depending on the parameters so it gets what I'm after.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Still would like to see this spelled out better in ESRI REST docs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 22:08:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440623#M40652</guid>
      <dc:creator>ZorbaConlen</dc:creator>
      <dc:date>2013-02-25T22:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: feature service rest request syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440624#M40653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Zorba, I'm having the same issue.&amp;nbsp; There's no examples of the "deleteFeatures" request syntax anywhere. So frustrating.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2015 15:44:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440624#M40653</guid>
      <dc:creator>EricMahaffey</dc:creator>
      <dc:date>2015-02-25T15:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: feature service rest request syntax</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440625#M40654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Zorba and Eric -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure you two have moved on from whatever you were working. But in the hopes clearing up the above requests for future people - See &lt;A href="http://gis.stackexchange.com/questions/97920/using-rest-delete-features-in-arcgis-api-for-javascript" title="http://gis.stackexchange.com/questions/97920/using-rest-delete-features-in-arcgis-api-for-javascript"&gt;using REST "delete features" in arcgis api for javascript - Geographic Information Systems Stack Exchange&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should be you answer:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;esriRequest({&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "url": "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FServiceRequest%2FFeatureServer%2F0%2FdeleteFeatures" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/FeatureServer/0/deleteFeatures&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; "content": {&lt;BR /&gt;&amp;nbsp; "objectIds": 123,&lt;BR /&gt;&amp;nbsp; "f": "json"&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }, {"usePost": true&lt;BR /&gt;&amp;nbsp; });&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 01:29:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-service-rest-request-syntax/m-p/440625#M40654</guid>
      <dc:creator>RobertMueller_Jr1</dc:creator>
      <dc:date>2016-03-11T01:29:29Z</dc:date>
    </item>
  </channel>
</rss>

