<?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: attempting to upload files to Notebook Files using arcgis.gis.nb in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1303045#M8828</link>
    <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;We're still working on this, and I'm just now seeing your response.&amp;nbsp; So thank you and apologies.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying this, and I still can't get it to work.&amp;nbsp; I was told this:&lt;/P&gt;&lt;P&gt;To fix this you have to modify this line:&lt;BR /&gt;nb_daccess = NotebookDataAccess(url=nb_da_url, gis=ago)&lt;BR /&gt;&lt;BR /&gt;to this:&amp;nbsp;&lt;BR /&gt;nb_daccess = NotebookDataAccess(url=nb_da_url[“url”], gis=ago)&lt;/P&gt;&lt;P&gt;It worked, thanks!!&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still confused as to what the ["url"] is.&amp;nbsp; I thought it was the url of my notebook, so I put that in at first, of course that didn't work.&amp;nbsp; When I changed it back to just ["url'], that worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 16:01:51 GMT</pubDate>
    <dc:creator>Levon_H</dc:creator>
    <dc:date>2023-06-26T16:01:51Z</dc:date>
    <item>
      <title>attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1288227#M8683</link>
      <description>&lt;P&gt;Hi folks.&amp;nbsp; We're attempting to move files from our local network to our AGOL Notebook "&lt;STRONG&gt;Files&lt;/STRONG&gt;" location programmatically, using ArcGIS API for Python. It looks like the&amp;nbsp;&lt;STRONG&gt;arcgis.gis.nb&lt;/STRONG&gt; module may be the solution, using &lt;STRONG&gt;NotebookDataAccess&lt;/STRONG&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;API reference here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.nb.html#notebookdataaccess" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.gis.nb.html#notebookdataaccess&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the end, I've got the Boolean to be "True" as in, it worked.&amp;nbsp; However, when I go to my Notebook Files, nothing is there at "/arcgis/home".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I have so far (working in Jupyter Notebooks):&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;import&lt;/STRONG&gt; arcgis.gis.nb&lt;BR /&gt;&lt;STRONG&gt;import&lt;/STRONG&gt; arcgis.gis.nb._dataaccess&lt;BR /&gt;f&lt;STRONG&gt;rom&lt;/STRONG&gt; arcgis.gis.nb._dataaccess &lt;STRONG&gt;import&lt;/STRONG&gt; NotebookDataAccess&lt;BR /&gt;&lt;STRONG&gt;import&lt;/STRONG&gt; arcpy&lt;BR /&gt;&lt;STRONG&gt;from&lt;/STRONG&gt; arcgis.gis &lt;STRONG&gt;import&lt;/STRONG&gt; GIS&lt;BR /&gt;&lt;STRONG&gt;from&lt;/STRONG&gt; arcgis.gis.nb &lt;STRONG&gt;import&lt;/STRONG&gt; NotebookManager, Notebook, NotebookServer, _dataaccess&lt;BR /&gt;gis = GIS(&lt;STRONG&gt;'Home'&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;# URL to the desired Notebook&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;url = "&lt;A href="https://levon.maps.arcgis.com/home/notebook/notebook.html?id=d693b3892c8747a892adxxxxxxxcb#" target="_blank"&gt;https://levon.maps.arcgis.com/home/notebook/notebook.html?id=d693b3892c8747a892adxxxxxxxcb#&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;# path to the zipfile on our network&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;zipfgdb = r"N:\gis\Levon\Sandbox\LIVE_TEST.zip"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;# test to see if I'm actually pinging AGOL Notebook&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;nb_server = gis.notebook_server[0]&lt;BR /&gt;nb_server&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;# test to see if I'm accessing the correct notebook&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;notebook_item = gis.content.get('d693b3892c8747a892xxxxxxxxx30cb')&lt;BR /&gt;notebook_item&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;# attempt to upload the zipfile from our network to Notebook /arcgis/home&amp;nbsp;Files &lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;st_up = NotebookDataAccess(url, gis)&lt;BR /&gt;st_up.upload(zipfgdb)&lt;/P&gt;&lt;P&gt;Result: &lt;STRONG&gt;"True"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So, it's saying True, as in it worked, but when I check, nothing is there.&amp;nbsp; See below.&amp;nbsp; Any help!?&amp;nbsp; Be nice, I'm a intermediate/beginner! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; We've been working on this for days, this is the closest we've gotten.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Levon_H_0-1683821759046.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70435i3A85ACA6AC01EFC1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Levon_H_0-1683821759046.png" alt="Levon_H_0-1683821759046.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;</description>
      <pubDate>Thu, 11 May 2023 16:23:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1288227#M8683</guid>
      <dc:creator>Levon_H</dc:creator>
      <dc:date>2023-05-11T16:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1299361#M8782</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/404466" target="_self"&gt;&lt;SPAN class=""&gt;Levon_H&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The Python API reference documentation currently does not provide an example of how to accomplish your workflow. Sorry for the confusion caused, and we'll update that documentation to provide an example.&lt;/P&gt;&lt;P&gt;There is a method on the&amp;nbsp;&lt;EM&gt;User&amp;nbsp;&lt;/EM&gt;class called&amp;nbsp;&lt;EM&gt;generate_direct_access_url()&amp;nbsp;&lt;/EM&gt;that serves to provide the proper&amp;nbsp;&lt;EM&gt;url&amp;nbsp;&lt;/EM&gt;argument to initialize a&amp;nbsp;&lt;EM&gt;NotebookDataAccess&amp;nbsp;&lt;/EM&gt;object for loading files into the&amp;nbsp;&lt;EM&gt;/arcgis/home&amp;nbsp;&lt;/EM&gt;directory.&amp;nbsp; Here is a snippet to accomplish this. The following will create a subdirectory in&amp;nbsp;&lt;EM&gt;home&amp;nbsp;&lt;/EM&gt;called &lt;EM&gt;notebookworkspace:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.gis.nb._dataaccess import NotebookDataAccess

ago = GIS(profile="your_online_profile")
connected_user = gis.users.me

file_path="local/path/to/data/shpfile.zip"

nb_da_url = connected_user.generate_direct_access_url(store_type="notebook")
nb_daccess = NotebookDataAccess(url=nb_da_url, gis=ago)

nb_daccess.upload(file_path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 18:55:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1299361#M8782</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2023-06-14T18:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1303045#M8828</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;We're still working on this, and I'm just now seeing your response.&amp;nbsp; So thank you and apologies.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying this, and I still can't get it to work.&amp;nbsp; I was told this:&lt;/P&gt;&lt;P&gt;To fix this you have to modify this line:&lt;BR /&gt;nb_daccess = NotebookDataAccess(url=nb_da_url, gis=ago)&lt;BR /&gt;&lt;BR /&gt;to this:&amp;nbsp;&lt;BR /&gt;nb_daccess = NotebookDataAccess(url=nb_da_url[“url”], gis=ago)&lt;/P&gt;&lt;P&gt;It worked, thanks!!&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still confused as to what the ["url"] is.&amp;nbsp; I thought it was the url of my notebook, so I put that in at first, of course that didn't work.&amp;nbsp; When I changed it back to just ["url'], that worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 16:01:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1303045#M8828</guid>
      <dc:creator>Levon_H</dc:creator>
      <dc:date>2023-06-26T16:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1303074#M8830</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Levon_H -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I misstyped the code in my first code snippet. I'm sorry for my mistake - the correct snippet is below:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.gis.nb._dataaccess import NotebookDataAccess

ago = GIS(profile="your_online_profile")
connected_user = gis.users.me

file_path="local/path/to/data/shpfile.zip"

nb_da_url = connected_user.generate_direct_access_url(store_type="notebook")
nb_daccess = NotebookDataAccess(url=nb_da_url["url"], gis=ago)

nb_daccess.upload(file_path)&lt;/LI-CODE&gt;&lt;P&gt;The &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User.generate_direct_access_url" target="_self"&gt;generate_direct_access_url()&lt;/A&gt;&amp;nbsp;method on a&amp;nbsp;&lt;EM&gt;User&amp;nbsp;&lt;/EM&gt;object returns a Python dictionary with a key named &lt;EM&gt;url&amp;nbsp;&lt;/EM&gt;whose values is the organizational endpoint necessary to initialize a&amp;nbsp;&lt;EM&gt;NotebookDataAccess&amp;nbsp;&lt;/EM&gt;object for&amp;nbsp; uploading files to the ArcGIS Online files area. As you noted, the url is not to the notebook itself, but to a system administration endpoint for the uploading operation. Glad this worked - and sorry for the confusion. We'll work to adjust the documentation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 16:44:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1303074#M8830</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2023-06-26T16:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1303082#M8831</link>
      <description>&lt;P&gt;Excellent.&amp;nbsp; Thank you.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 17:08:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1303082#M8831</guid>
      <dc:creator>Levon_H</dc:creator>
      <dc:date>2023-06-26T17:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1405850#M9840</link>
      <description>&lt;P&gt;I am trying to use above code to upload files to our ArcGIS Enterprise Notebook files folder, but generate_direct_access_url() does not return anything. Am I missing something?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 16:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1405850#M9840</guid>
      <dc:creator>Tim_E</dc:creator>
      <dc:date>2024-04-04T16:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1405864#M9841</link>
      <description>&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;Not sure if you'd be expecting anything to return.&amp;nbsp; Maybe John can jump in here.&amp;nbsp; From my understanding, that simply allows access to your online Notebook files.&amp;nbsp; Those 12 lines of code above are all I'm using.&amp;nbsp; In that example, you'd find shpfile.zip in your Notebook files.&amp;nbsp; Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 16:26:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1405864#M9841</guid>
      <dc:creator>Levon_H</dc:creator>
      <dc:date>2024-04-04T16:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1405867#M9842</link>
      <description>&lt;P&gt;Hi Levon,&lt;/P&gt;&lt;P&gt;I tried to replicate it, but got an error saying:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimElrick_0-1712248180268.png" style="width: 636px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/100075i19E2C4AC71B69F14/image-dimensions/636x27?v=v2" width="636" height="27" role="button" title="TimElrick_0-1712248180268.png" alt="TimElrick_0-1712248180268.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hence, I assumed the empty return of generate_direct_access_url() might have to do with it. If I understand correctly, the difference between your use case and mine is that you use Arc Online while I try to use Arc Enterprise.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 16:31:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1405867#M9842</guid>
      <dc:creator>Tim_E</dc:creator>
      <dc:date>2024-04-04T16:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: attempting to upload files to Notebook Files using arcgis.gis.nb</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1684627#M11854</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;I'm trying to accomplish the same thing with the snippet you provided, but unsuccessfully&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.gis.nb._dataaccess import NotebookDataAccess
    
gis = GIS("Pro")
print(f"Connected to ArcGIS Online as: {gis.users.me.username}")

nb_da_url = gis.users.me.generate_direct_access_url(store_type="notebook")
print(nb_da_url)
# Define the folder containing the images
image_folder = "C:/SlimmerWerkenInHetVeld/moffen"

nda = NotebookDataAccess(url=nb_da_url["url"], gis=gis)&lt;/LI-CODE&gt;&lt;P&gt;I can see that I'm connected to the correct AGOL with the correct user&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Connected to ArcGIS Online as: hoogerwerf_esrinederland
{'url': 'https://notebooksdataaccess.arcgis.com/&amp;lt;orgid&amp;gt;/arcgis/admin/dataaccess/azureblob/notebooksWorkspace'}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the nda= line fails with the attached JSON decode related error&lt;/P&gt;&lt;P&gt;Any idea what I'm missing?&lt;/P&gt;&lt;P&gt;BTW, it would be great to see some example code related to&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;arcgis.gis.agonb.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;NotebookManager&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 05:51:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/attempting-to-upload-files-to-notebook-files-using/m-p/1684627#M11854</guid>
      <dc:creator>MarcHoogerwerf_EsriNL</dc:creator>
      <dc:date>2026-02-17T05:51:42Z</dc:date>
    </item>
  </channel>
</rss>

