<?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 Create folder in ArcGSI Server in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-folder-in-arcgsi-server/m-p/1575194#M4911</link>
    <description>&lt;P&gt;I am trying to create ArcGIS Server folders with the rest API. This is what I have tried:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def create_folders(admin, password):
    url = 'https://xyzx.com:6443/arcgis/admin/services/createFolder'
    headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
    payload = {'folderName': 'my_test'}
    auth = (admin, password)
    response = requests.post(url, headers=headers, json=payload, auth=auth)
    print(response.json)&lt;/LI-CODE&gt;&lt;P&gt;The print statement is dumping out&amp;nbsp;&amp;lt;bound method Response.json of &amp;lt;Response [200]&amp;gt;&amp;gt; and no folder is created.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/enterprise-administration/server/createfolder/" target="_blank"&gt;https://developers.arcgis.com/rest/enterprise-administration/server/createfolder/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2025 00:49:04 GMT</pubDate>
    <dc:creator>forestknutsen1</dc:creator>
    <dc:date>2025-01-14T00:49:04Z</dc:date>
    <item>
      <title>Create folder in ArcGSI Server</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-folder-in-arcgsi-server/m-p/1575194#M4911</link>
      <description>&lt;P&gt;I am trying to create ArcGIS Server folders with the rest API. This is what I have tried:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def create_folders(admin, password):
    url = 'https://xyzx.com:6443/arcgis/admin/services/createFolder'
    headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
    payload = {'folderName': 'my_test'}
    auth = (admin, password)
    response = requests.post(url, headers=headers, json=payload, auth=auth)
    print(response.json)&lt;/LI-CODE&gt;&lt;P&gt;The print statement is dumping out&amp;nbsp;&amp;lt;bound method Response.json of &amp;lt;Response [200]&amp;gt;&amp;gt; and no folder is created.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/enterprise-administration/server/createfolder/" target="_blank"&gt;https://developers.arcgis.com/rest/enterprise-administration/server/createfolder/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 00:49:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-folder-in-arcgsi-server/m-p/1575194#M4911</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2025-01-14T00:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create folder in ArcGSI Server</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-folder-in-arcgsi-server/m-p/1575200#M4912</link>
      <description>&lt;P&gt;I got it to work with python 2&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import json
import urllib2
from urllib import urlencode

data = {
    'username': 'xyzx',
    'password': 'xyzx',
    'client': 'requestip',
    'expiration': 15,
    'f': 'json'
}
url = 'xyzx.com:6443/arcgis/admin/generateToken'
post = urlencode(data)
req = urllib2.Request(url, post)
response = urllib2.urlopen(req)
json_response = response.read()
json_response = json.loads(json_response)
token = json_response['token']

data = {
    'token': token,
    'folderName': 'my_test',
    'f': 'json'
}
url = 'xyzx.com:6443/arcgis/admin/services/createFolder'
post = urlencode(data)
req = urllib2.Request(url, post)
response = urllib2.urlopen(req)
json_response = response.read()
json_response = json.loads(json_response)&lt;/LI-CODE&gt;&lt;P&gt;Maybe I needed to create a token first with my python 3 attempt...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 01:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-folder-in-arcgsi-server/m-p/1575200#M4912</guid>
      <dc:creator>forestknutsen1</dc:creator>
      <dc:date>2025-01-14T01:44:51Z</dc:date>
    </item>
  </channel>
</rss>

