I have developed a script using the ArcGIS API for Python in order to add content and publish data onto ArcGIS Portal. However, I am looking for a methodology to move this data through a REST API instead. The only information I can find on accomplishing this task is here: https://developers.arcgis.com/rest/services-reference/enterprise/upload.htm. The example that ESRI provides simply shows how to use a UI for the Upload of data. How can this be accomplished on the "backend" using Python? Could someone point me towards to scripting documentation or share a sample script?
Coming at this from left field and not understanding all of your use cases, but are you aware of:
ArcGIS Online Assistant (esri.com)
Thanks for sending that link over! However, I am using ArcEnterprise and not AGOL.
The AGO Assistant works on Portal too, it's the second login link.
AGO Assistant can be downloaded and installed on your own machine if you want to use it behind a firewall. See https://github.com/Esri/ago-assistant
If you need Javascript code, the source is actually pretty readable.
Thanks Brian, beer me to it! Yes I use the same tool for enterprise all the time. 🙂
Oh okay awesome, I'll definitely see if that will help out. Do you happen to have a code snippet of how to call the Upload function using python?
My impression has always been that the Python API is just a thin wrapper that makes REST API calls for you.
What are you trying to do that can't be done in the Python API?
I did a bunch of tests a few months ago with Postman, if you have not used it yet you should grab a copy (it's free) and start using it for testing. I was getting ready to use the Accela API but that ended up going nowhere. I set up a bunch of tests with ArcGIS Server too, mostly "get info" types of things.
It's good to be able to test out API calls before wasting time coding.
Thanks, I'll try out some calls using Postman. Have you tried using code for the Upload function before? I can't find any snippets for syntax.
I probably have time to take a crack at it. I am actually working on uploads right now but have been struggling along with the Python.
That would be awesome! If you need any help with the python aspect, feel free to reach out.