Hi,
I am the administrator of an AGOL account, but when I run this script, I get a 403 error. How is it possible and any idea how I can solve this?
from arcgis.gis import GIS
from arcgis import features
from datetime import date
import pandas as pd
import os
import io
import requests
gis = GIS("Home")
# Specify the item ID of the map
map_item_id = "470e800329c9490fba5e43f9ba7faef1"
# Retrieve the map item
map_item = gis.content.get(map_item_id)
# Retrieve the layers from the map item
map_layers = map_item.get_data()['operationalLayers']
# Extract only the titles of the feature layers
layer_titles = [layer['title'] for layer in map_layers if layer['layerType'] == 'ArcGISFeatureLayer']
# Print the layer titles
print(layer_titles)