<?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 Invalid JSON Primitive using applyEdits in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333070#M4562</link>
    <description>&lt;P&gt;Trying to use applyEdits to a hosted feature service in ArcGIS Online. I went to the query endpoint for the individual layer and queried out a feature which returned the features json for a single feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt; "features" : [
    {
      "attributes" : {
        "OBJECTID" : 62428, 
        "ADDID" : 63649, 
        "LONGITUDE" : "-20.39381937", 
        "LATITUDE" : "57.21860018", 
        "geoy" : 111.95, 
        "geox" : 170, 
        "ISSHELLADDRESS" : 0, 
        "SHELLID" : 0, 
        "DuplexID" : 63650, 
        "ADDRESSWITHUNIT" : "WhAt NOW MaN", 
        "ISSHFA" : 0
      }, 
      "geometry" : 
      {
        "x" : 170.00002741069, 
        "y" : 111.9500441551
      }
    }
  ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can take this, minus the "features" tag, and stick it in the updateFeatures for that individual feature layer and it works.&lt;/P&gt;&lt;P&gt;Then I put the same content in a format for the applyEdits like below, and it fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[
  {
    "id" : 0,
    "adds" : [],
    "updates": [
      {
        "geometry": {
          "x" : 170.0069, 
		  "y" : 11.9500
        },
        "attributes": {
			"OBJECTID": 62428,
			"ADDID": 63649,
			"LONGITUDE": -80.39381937,
			"LATITUDE": 27.21860018,
			"geoy": 111.95,
			"geox": 970,
			"ISSHELLADDRESS": 0,
			"SHELLID": 0,
			"DuplexID": 63650,
			"ADDRESSWITHUNIT": "It's Me I am the problem",
			"ISSHFA": 0
        } 
      } 
    ],
    "deletes": [] 
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried multiple permutations with the larger format by removing the adds and deletes leaving just the updates and it's the same thing. I get back "code" : 400... Unable to apply edits. Other times it will show the Invalid JSON Primitive in "edit"&lt;/P&gt;&lt;P&gt;I'm sure, like most times, I'm just missing something simple here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks as always!&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2023 19:17:36 GMT</pubDate>
    <dc:creator>MichaelKohler</dc:creator>
    <dc:date>2023-09-27T19:17:36Z</dc:date>
    <item>
      <title>Invalid JSON Primitive using applyEdits</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333070#M4562</link>
      <description>&lt;P&gt;Trying to use applyEdits to a hosted feature service in ArcGIS Online. I went to the query endpoint for the individual layer and queried out a feature which returned the features json for a single feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt; "features" : [
    {
      "attributes" : {
        "OBJECTID" : 62428, 
        "ADDID" : 63649, 
        "LONGITUDE" : "-20.39381937", 
        "LATITUDE" : "57.21860018", 
        "geoy" : 111.95, 
        "geox" : 170, 
        "ISSHELLADDRESS" : 0, 
        "SHELLID" : 0, 
        "DuplexID" : 63650, 
        "ADDRESSWITHUNIT" : "WhAt NOW MaN", 
        "ISSHFA" : 0
      }, 
      "geometry" : 
      {
        "x" : 170.00002741069, 
        "y" : 111.9500441551
      }
    }
  ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can take this, minus the "features" tag, and stick it in the updateFeatures for that individual feature layer and it works.&lt;/P&gt;&lt;P&gt;Then I put the same content in a format for the applyEdits like below, and it fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;[
  {
    "id" : 0,
    "adds" : [],
    "updates": [
      {
        "geometry": {
          "x" : 170.0069, 
		  "y" : 11.9500
        },
        "attributes": {
			"OBJECTID": 62428,
			"ADDID": 63649,
			"LONGITUDE": -80.39381937,
			"LATITUDE": 27.21860018,
			"geoy": 111.95,
			"geox": 970,
			"ISSHELLADDRESS": 0,
			"SHELLID": 0,
			"DuplexID": 63650,
			"ADDRESSWITHUNIT": "It's Me I am the problem",
			"ISSHFA": 0
        } 
      } 
    ],
    "deletes": [] 
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried multiple permutations with the larger format by removing the adds and deletes leaving just the updates and it's the same thing. I get back "code" : 400... Unable to apply edits. Other times it will show the Invalid JSON Primitive in "edit"&lt;/P&gt;&lt;P&gt;I'm sure, like most times, I'm just missing something simple here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks as always!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 19:17:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333070#M4562</guid>
      <dc:creator>MichaelKohler</dc:creator>
      <dc:date>2023-09-27T19:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON Primitive using applyEdits</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333316#M4563</link>
      <description>&lt;P&gt;Hard to know for sure, but it's probably just submitting the wrong type to one of the fields. Although, that's usually a 500 code. In your example, "LATITUDE" and "LONGITUDE" are strings in the query, but floats in the update. Is that right?&lt;/P&gt;&lt;P&gt;Are you including a token in your update request? If the layer isn't publicly editable, you'll need one.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 13:20:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333316#M4563</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-09-28T13:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON Primitive using applyEdits</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333319#M4564</link>
      <description>&lt;P&gt;Regarding tokens: that applies if you're hitting the REST endpoint using a POST request. If you're doing this from the services directory, it handles the token in the background once you log in.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 13:21:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333319#M4564</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-09-28T13:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid JSON Primitive using applyEdits</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333418#M4566</link>
      <description>&lt;P&gt;I knew it was something stupid! I had run into this well over 5 years ago with our address database when I created a GIS Services.DLL for the other app devs to use.&lt;/P&gt;&lt;P&gt;We are moving the address app from WPF to Angular, so apparently, I had to run through the same gauntlet! I've requested them to not make them string fields in the new table.&lt;/P&gt;&lt;P&gt;I seem to remember you helping me out on something before and I see you on here in a lot of posts. Thank you so much for your efforts.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 15:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/invalid-json-primitive-using-applyedits/m-p/1333418#M4566</guid>
      <dc:creator>pslgisAdmin</dc:creator>
      <dc:date>2023-09-28T15:46:26Z</dc:date>
    </item>
  </channel>
</rss>

