<?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: Help calling /content/addItem from java in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-calling-content-additem-from-java/m-p/233478#M21778</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;please note that&amp;nbsp;this question was posted to the ArcGIS API for Javascript group. &amp;nbsp; Regardless, I think you have an incorrect URL as the first part should point to the &lt;STRONG&gt;user&lt;/STRONG&gt; content url (&amp;lt;usercontent-url&amp;gt;). &amp;nbsp;Follow the SDK links to track down the full url:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//&amp;lt;usercontent-url&amp;gt;/addItem&lt;BR /&gt;//&amp;lt;content-url&amp;gt;/users/&amp;lt;username&amp;gt;/addItem&lt;/P&gt;&lt;P&gt;//&amp;lt;root-url&amp;gt;/content&lt;SPAN&gt;/users/&amp;lt;username&amp;gt;/addItem&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;//www.arcgis.com/sharing/rest/&lt;SPAN&gt;/content&lt;/SPAN&gt;&lt;SPAN&gt;/users/&amp;lt;username&amp;gt;/addItem&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, since we're dealing with an operation specific to a user I normally use the organization url instead of "www.arcgis".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jul 2017 16:02:59 GMT</pubDate>
    <dc:creator>JohnGrayson</dc:creator>
    <dc:date>2017-07-18T16:02:59Z</dc:date>
    <item>
      <title>Help calling /content/addItem from java</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-calling-content-additem-from-java/m-p/233476#M21776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to post content to ArcGIS Online from a java application using the REST API.&amp;nbsp; Following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Add_Item/02r30000008q000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Add_Item/02r30000008q000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried many variations of:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; Map&amp;lt;String, String&amp;gt; args = new HashMap&amp;lt;&amp;gt;();
&amp;nbsp; args.put("url","http://www.mymappingapplication.com");
&amp;nbsp; args.put("title","My Mapping Application");
&amp;nbsp; args.put("type","Web Mapping Application");
&amp;nbsp; args.put("tags","web, mapping, application");
&amp;nbsp; args.put("token",token.token); // generated from /rest/generateToken
&amp;nbsp; 
&amp;nbsp; MultipartContent content = new MultipartContent();
&amp;nbsp; content.addPart(new MultipartContent.Part(new UrlEncodedContent(args)));
&amp;nbsp; 
&amp;nbsp; System.out.println( "URL&amp;gt;&amp;gt;"+item.toURI() );
&amp;nbsp; request = requestFactory.buildPostRequest(item, content);
&amp;nbsp; 
&amp;nbsp; HttpResponse out = request.execute();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The URL is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/sharing/rest/content/addItem?f=json" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.arcgis.com/sharing/rest/content/addItem?f=json&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and the response is always:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
{"error":{"code":400,"messageCode":"GWM_0001","message":"Specified output format 'json' not supported.","details":[]}}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any pointers on what I should look into?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:48:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-calling-content-additem-from-java/m-p/233476#M21776</guid>
      <dc:creator>ryanMcKinley</dc:creator>
      <dc:date>2021-12-11T11:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help calling /content/addItem from java</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-calling-content-additem-from-java/m-p/233477#M21777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever find a solution?&amp;nbsp;&amp;nbsp; I ask because I have a similar problem.&amp;nbsp; Documentation is sparse and, so far, not useful.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 12:20:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-calling-content-additem-from-java/m-p/233477#M21777</guid>
      <dc:creator>DavidWendelken</dc:creator>
      <dc:date>2017-07-18T12:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help calling /content/addItem from java</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-calling-content-additem-from-java/m-p/233478#M21778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;please note that&amp;nbsp;this question was posted to the ArcGIS API for Javascript group. &amp;nbsp; Regardless, I think you have an incorrect URL as the first part should point to the &lt;STRONG&gt;user&lt;/STRONG&gt; content url (&amp;lt;usercontent-url&amp;gt;). &amp;nbsp;Follow the SDK links to track down the full url:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//&amp;lt;usercontent-url&amp;gt;/addItem&lt;BR /&gt;//&amp;lt;content-url&amp;gt;/users/&amp;lt;username&amp;gt;/addItem&lt;/P&gt;&lt;P&gt;//&amp;lt;root-url&amp;gt;/content&lt;SPAN&gt;/users/&amp;lt;username&amp;gt;/addItem&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;//www.arcgis.com/sharing/rest/&lt;SPAN&gt;/content&lt;/SPAN&gt;&lt;SPAN&gt;/users/&amp;lt;username&amp;gt;/addItem&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, since we're dealing with an operation specific to a user I normally use the organization url instead of "www.arcgis".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2017 16:02:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/help-calling-content-additem-from-java/m-p/233478#M21778</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2017-07-18T16:02:59Z</dc:date>
    </item>
  </channel>
</rss>

