<?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 Example in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365353#M1739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Randy.&lt;/P&gt;&lt;P&gt;It did make sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Nov 2016 03:54:12 GMT</pubDate>
    <dc:creator>PitersonPaulgek</dc:creator>
    <dc:date>2016-11-07T03:54:12Z</dc:date>
    <item>
      <title>REST API Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365350#M1736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The task - to get&amp;nbsp;features in format&amp;nbsp;json from ArcGIS Server (map service or geometry service)&lt;BR /&gt;I should use&amp;nbsp;ArcGIS REST API with&amp;nbsp;request and use large external file with parametres.&lt;BR /&gt;Its format &amp;nbsp;json and its content - all the&amp;nbsp;features&amp;nbsp;where uniq1 in (1,2,3,4,5, ..., 100001)&lt;BR /&gt;"Uniq1": "1",&lt;BR /&gt;"Uniq1": "2", ...&lt;BR /&gt;I found an unclear syntax/example&amp;nbsp;of version 9.3.&lt;BR /&gt;I have version 10.4 - I need some &lt;STRONG&gt;working example&lt;/STRONG&gt; on online ArcGIS Server&amp;nbsp;services like this one&lt;/P&gt;&lt;P&gt;&lt;A class="jivelink1" href="https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/MapServer/0" title="https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/MapServer/0"&gt;https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/MapServer/0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the help for 9.3 (question - if it is actual now, or API has changed for 10.4?)&lt;/P&gt;&lt;P&gt;6. Understand options for sending long JSON objects in a request (&lt;A class="link-titled" href="https://services.arcgis.com/help/gettingstarted.html" title="https://services.arcgis.com/help/gettingstarted.html"&gt;Getting Started with GeoServices REST API&lt;/A&gt;&amp;nbsp;)&lt;BR /&gt;When using the REST API, you will normally use an HTML GET method in a form. When you use GET, the entire request is encoded in the URL. This is the preferred method to use whenever possible. However, in this mode, a URL is limited to as few as 1024 characters depending on the browser. Thus, if you have a long JSON object to include in the request, you will need to use POST.&lt;/P&gt;&lt;P&gt;A second option, when using certain Geometry Service and Geoprocessing Service operations, is to continue to use GET and to specify a URL to the input JSON object contained in a file on a public server.&lt;/P&gt;&lt;P&gt;Syntax: geometries = { "url": "&amp;lt;URL to file&amp;gt;"}&lt;BR /&gt;Example: geometries = { "url": "http: //myserver/mygeometries/afile.txt"}&lt;/P&gt;&lt;P&gt;http: // myserver / arcgis / rest / services / Geometry / GeometryServer / project? inSR = 4326 &amp;amp; outSR = 54004 &amp;amp; geometries = { "url": "http: //myserver/mygeometries/afile.txt"}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 11:55:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365350#M1736</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-10-27T11:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365351#M1737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found that manual for 10.4 has not changed. So, please help with working example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2016 20:48:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365351#M1737</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-10-27T20:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365352#M1738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a code example that will obtain the field information from the server link you mentioned.&amp;nbsp; Since it does not require a password, I have omitted the password and token sections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; urllib
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; urllib2
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; json
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; sys
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; collections

URL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsampleserver3.arcgisonline.com%2FArcGIS%2Frest%2Fservices%2FPetroleum%2FKSFields%2FMapServer%2F0" target="_blank"&gt;https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;

query_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"f"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"json"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

jsonResponse &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlopen&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;URL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; urllib&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;urlencode&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;query_dict&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

jdata &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;loads&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;jsonResponse&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;read&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; object_pairs_hook&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;collections&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OrderedDict&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;u&lt;SPAN class="string token"&gt;'fields'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dumps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;jdata&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; indent&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sort_keys&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the type of information you were looking for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:59:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365352#M1738</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T16:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: REST API Example</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365353#M1739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Randy.&lt;/P&gt;&lt;P&gt;It did make sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 03:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/rest-api-example/m-p/365353#M1739</guid>
      <dc:creator>PitersonPaulgek</dc:creator>
      <dc:date>2016-11-07T03:54:12Z</dc:date>
    </item>
  </channel>
</rss>

