HOW TO
All URLs in Esri Story Maps must use HTTPS, as described in Story Maps: Frequently Asked Questions. There are circumstances that may require a URL conversion from HTTP to HTTPS within a Story Map or other web applications. The URL can be updated manually, but this is tedious through the User Interface, especially with Story Maps containing a large number of linked items. ArcGIS API for Python provides a quick workflow to do this (for single web applications).
Note: Both options convert all URLs in the application to HTTPS.
from arcgis.gis import GIS, Item
user = "<user>" # enter desired user password = "<password>" # enter password url = "https://www.arcgis.com" # change Portal URL if needed gis = GIS(url , user, password)
Note: To use an active Portal for ArcGIS login from ArcGIS Pro, if enterprise logins are used, replace the "gis" parameter with the following:
gis = GIS("pro")
itemid = "<item id>" #Set the item ID
app = Item(gis, itemid) appdata = app.get_data(False)
new_appdata = appdata.replace("https://", "https://")
app.update({"text": new_appdata})
print("Successfully updated item " + itemid)
from arcgis.gis import GIS, Item
user = "username"
password = "password"
url = "https://www.arcgis.com"
itemid = "abc123"
gis = GIS(url , user, password)
app = Item(gis, itemid)
appdata = app.get_data(False)
new_appdata = appdata.replace("https://", "https://")
app.update({"text": new_appdata})
print("Successfully updated item " + itemid)
Article ID: 000018243
Get help from ArcGIS experts
Start chatting now