<?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: REST API - No JSON Object could be decoded in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164899#M12649</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am pretty sure it is JSON being returned since&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I have ran this script 20+ times just fine when there were less records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; I can take some of the layers out and it works fine.&amp;nbsp; It crashes between 33,517 and 34,178 records.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; I can also download any layer by itself with no issues so not a data issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does have definition queries in it which I noticed split the data into different layers when publishing to AGO then combines then back together when bringing down a replica.&amp;nbsp; Not sure if that matters but wanted to mention it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also am not sure it is a timeout issue as it does not take very long to do all but one of the layers (which is just 661 records).&amp;nbsp; I can do any combination of layers 0-4 just not all of them at once.&amp;nbsp; If I go into AGO and ask for a JSON file the file I get is 66 MB.&amp;nbsp; Seems high since there are only 5 fields in each layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Nov 2015 16:37:30 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2015-11-11T16:37:30Z</dc:date>
    <item>
      <title>REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164889#M12639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a script that I'm using to download services as a geodatabase using the REST api.&amp;nbsp; It works about half the time -- the other half the time I get a 500 error stemming from a 'No JSON object could be decoded' error.&amp;nbsp; Anyone have any idea why this might be happening?&amp;nbsp; I don't think it's a bug in my script, since it works sometimes, but I've attached it in case anyone has any ideas and wants to see how it's put together.&amp;nbsp; Any feedback is greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 10:05:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164889#M12639</guid>
      <dc:creator>TrilliumLevine1</dc:creator>
      <dc:date>2015-05-22T10:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164890#M12640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any chance it is hitting secure services that you don't have proper credentials?&amp;nbsp; Just a guess, I haven't fully deciphered your script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 16:42:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164890#M12640</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2015-05-22T16:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164891#M12641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope, it's definitely not a credential problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2015 07:12:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164891#M12641</guid>
      <dc:creator>TrilliumLevine1</dc:creator>
      <dc:date>2015-05-26T07:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164892#M12642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same issue.&amp;nbsp; At 10,000 features it worked great.&amp;nbsp; Not at 32,000 and it dies with the same error as you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 22:27:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164892#M12642</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2015-11-10T22:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164893#M12643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'expiration': 60,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your credentials.&amp;nbsp; i.e. an integer, not a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like the token is timing out.&amp;nbsp; You have to manage token lifecycle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a whole lot easier in ArcGIS Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 23:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164893#M12643</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2015-11-10T23:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164894#M12644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks but where do I put this?&amp;nbsp; No idea where to add that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Opps thought this was from REST.&amp;nbsp; Here is the code where do I add that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Get a local replica of the HFS&lt;/P&gt;&lt;P&gt;proxy_port = None&lt;/P&gt;&lt;P&gt;proxy_url = None&lt;/P&gt;&lt;P&gt;agolSH = AGOLTokenSecurityHandler(username=username,password=password)&lt;/P&gt;&lt;P&gt;fs = FeatureService(url=url,securityHandler=agolSH,proxy_port=proxy_port,proxy_url=proxy_url,initialize=True)&lt;/P&gt;&lt;P&gt;result = fs.createReplica(replicaName='Demo', layers='0,1,2,3', keep_replica=False, layerQueries=None, geometryFilter=None, returnAttachments=True,returnAttachmentDatabyURL=False,returnAsFeatureClass=True, out_path=outDir)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 23:09:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164894#M12644</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2015-11-10T23:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164895#M12645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Line 139, in the file downloaded.&lt;/P&gt;&lt;P&gt;As written it was '60', not 60.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 23:22:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164895#M12645</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2015-11-10T23:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164896#M12646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must be looking at the other guys code.&amp;nbsp; Mine is this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from arcrest.security import AGOLTokenSecurityHandler&lt;/P&gt;&lt;P&gt;from arcrest.agol import FeatureService&lt;/P&gt;&lt;P&gt;from arcrest.common.filters import LayerDefinitionFilter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;#Get a local replica of the HFS&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;proxy_port = None&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;proxy_url = None&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;agolSH = AGOLTokenSecurityHandler(username=username,password=password)&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;fs = FeatureService(url=url,securityHandler=agolSH,proxy_port=proxy_port,proxy_url=proxy_url,initialize=True)&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;result = fs.createReplica(replicaName='Demo', layers='0,1,2,3', keep_replica=False, layerQueries=None, geometryFilter=None, returnAttachments=True,returnAttachmentDatabyURL=False,returnAsFeatureClass=True, out_path=outDir)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 23:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164896#M12646</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2015-11-10T23:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164897#M12647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops, sorry, yes I was.&lt;/P&gt;&lt;P&gt;I know the arcrest author, I'll bring him in - stand by.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 23:31:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164897#M12647</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2015-11-10T23:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164898#M12648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the meantime, if you run Fiddler while running the script, you may be able to get the request that doesn't return JSON and see what the actual response is.&amp;nbsp; I'd imagine it's html and not JSON, so the WebView response will help in Fiddler, but that's just a guess.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2015 01:49:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164898#M12648</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2015-11-11T01:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: REST API - No JSON Object could be decoded</title>
      <link>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164899#M12649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am pretty sure it is JSON being returned since&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I have ran this script 20+ times just fine when there were less records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; I can take some of the layers out and it works fine.&amp;nbsp; It crashes between 33,517 and 34,178 records.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; I can also download any layer by itself with no issues so not a data issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does have definition queries in it which I noticed split the data into different layers when publishing to AGO then combines then back together when bringing down a replica.&amp;nbsp; Not sure if that matters but wanted to mention it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also am not sure it is a timeout issue as it does not take very long to do all but one of the layers (which is just 661 records).&amp;nbsp; I can do any combination of layers 0-4 just not all of them at once.&amp;nbsp; If I go into AGO and ask for a JSON file the file I get is 66 MB.&amp;nbsp; Seems high since there are only 5 fields in each layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2015 16:37:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rest-api-no-json-object-could-be-decoded/m-p/164899#M12649</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2015-11-11T16:37:30Z</dc:date>
    </item>
  </channel>
</rss>

