An item
Each item in a portal is associated with metadata, including a title, description, tags, and sharing settings. Items can be created, accessed, shared, and managed within an organization through the item page
You use the portal service
Code examples
Below are example on how to create items in a portal.
Create a web map
Create a new web map item.
from arcgis.gis import GIS, ItemProperties, ItemTypeEnum
# To learn more about using profiles, go to
# https://developers.arcgis.com/python/latest/guide/working-with-different-authentication-schemes/#storing-your-credentials-locally
portal = GIS(profile="YOUR_ARCGIS_ACCOUNT")
root_folder = portal.content.folders.get()
new_item_props = ItemProperties(
title= "Word geography",
description= "This is a map of the world",
tags= ["map", "world", "geography"],
item_type=ItemTypeEnum.WEB_MAP
)
add_item_job = root_folder.add(item_properties=new_item_props)
if not add_item_job.done():
print("add item job processing...")
else:
print(add_item_job.result())REST API
curl https://www.arcgis.com/sharing/rest/content/users/<USER_NAME>/addItem \
-d 'f=pjson' \
-d 'title=World geography' \
-d 'description=This is the map of the world' \
-d 'type=Web Map' \
-d 'tags=map, world, geography' \
-d 'token=<ACCESS_TOKEN>'Import a CSV file
Create an item in a portal by importing a CSV file.
from arcgis.gis import GIS, ItemProperties, ItemTypeEnum
portal = GIS(
username="<YOUR_USERNAME>",
password="<YOUR_PASSWORD>"
)
root_folder = portal.content.folders.get() # root portal folder
trailhead_item_props = ItemProperties(
title="Trailheads",
description="Trailheads imported from CSV file",
tags="LA Trailheads",
item_type=ItemTypeEnum.CSV
)
csv_file = './data/LA_Hub_datasets/LA_Hub_datasets/Trailheads.csv'
csv_item = root_folder.add(item_properties=trailhead_item_props, file=csv_file)
if not csv_item.done():
print("CSV item processing...")
else:
print("CSV item processing complete.")
trailhead_service = csv_item.publish()
print(trailhead_service)Tutorials
Use tools to create different types of content

Import data to create a feature layer
Use data management tools to import files and create a feature layer in a feature service.

Manage a feature layer
Use a hosted feature layer item to set the properties and settings of a feature layer in a feature service.

Add a feature layer
Access and display point, line, and polygon features from a feature service.
Services
API support
- 1. Limited operations, use HTTP requests.
- 2. Access via ArcGIS REST JS.
Tools
Use tools to access the portal and create and manage content for applications.