get sharing url with ArcGIS API for Python

559
2
Jump to solution
02-27-2019 08:43 AM
Nicole_Ueberschär
Esri Regular Contributor

I am looking for a way to get a list of my items (images) with the corresponding sharing URL. 

I know how to get a list of my items but I don't find (if there is) the right property of the item to get that URL. (I am looking for the one that you find at the lower right of the item's details page.)

Thanks for hints!

Tags (2)
1 Solution

Accepted Solutions
Nicole_Ueberschär
Esri Regular Contributor

I tried item.url but I get "none" as response. 

Ah, yes "yoursharingurl" makes sense pluse item id + /data. 

That was easier than I thought: 

folderitems = me.items(folder)

for item in folderitems:
   print(str(item.title)+" url: <yoururl>sharing/rest/content/items/" + str(item.id) + "/data")‍‍‍‍

View solution in original post

2 Replies
EarlMedina1
Occasional Contributor III

If I understand you correctly, what you're looking for might be the .url property: item.url

If it's not that and instead you're wanting to get the URL for the item which includes the Item ID, I think you'll need to get the item id from the item and then append that to a url string. So something like:

url = "yoursharingurl" + item.url

0 Kudos
Nicole_Ueberschär
Esri Regular Contributor

I tried item.url but I get "none" as response. 

Ah, yes "yoursharingurl" makes sense pluse item id + /data. 

That was easier than I thought: 

folderitems = me.items(folder)

for item in folderitems:
   print(str(item.title)+" url: <yoururl>sharing/rest/content/items/" + str(item.id) + "/data")‍‍‍‍