Upload (POST) Content on ArcEnterprise using REST API

1104
11
05-04-2022 12:15 PM
moremeowbell
New Contributor III

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?

0 Kudos
11 Replies
Scott_Tansley
MVP Regular Contributor

Coming at this from left field and not understanding all of your use cases, but are you aware of:

ArcGIS Online Assistant (esri.com)

Scott Tansley
Consulting Architect (ArcGIS Enterprise)
https://www.linkedin.com/in/scotttansley/
0 Kudos
moremeowbell
New Contributor III

Thanks for sending that link over! However, I am using ArcEnterprise and not AGOL.

0 Kudos
Brian_Wilson
Occasional Contributor III

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.

 

Scott_Tansley
MVP Regular Contributor

Thanks Brian, beer me to it!  Yes I use the same tool for enterprise all the time.  🙂

Scott Tansley
Consulting Architect (ArcGIS Enterprise)
https://www.linkedin.com/in/scotttansley/
0 Kudos
moremeowbell
New Contributor III

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?

0 Kudos
Brian_Wilson
Occasional Contributor III

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.

 

 

0 Kudos
moremeowbell
New Contributor III

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.

0 Kudos
Brian_Wilson
Occasional Contributor III

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. 

0 Kudos
moremeowbell
New Contributor III

That would be awesome! If you need any help with the python aspect, feel free to reach out.

0 Kudos