Get a content item
The examples below show how to access a public and private item by ID.
See more examples in Search, Items, Users and Groups.
APIs
from arcgis.gis import GIS
gis = GIS()
item = gis.content.get("5a5147abe878444cbac68dea9f2f64e7")
print(item)
const portal = new Portal({
url: "https://www.arcgis.com/",
authMode: "immediate"
});
// OR
esriConfig.apiKey = "YOUR_ACCESS_TOKEN" // Scoped to access item below
const portalItem = new PortalItem({
portal: portal,
id: "ITEM_ID"
});
portalItem.load().then((response)=>{
console.log(response);
});
REST API
## Public
curl https://www.arcgis.com/sharing/rest/content/items/5a5147abe878444cbac68dea9f2f64e7 \
-d 'f=pjson'
## Private
curl https://www.arcgis.com/sharing/rest/content/items/<ITEM_ID> \
-d 'f=pjson' \
-d 'token=<ACCESS_TOKEN>'
Response
// Public
{
"id": "5a5147abe878444cbac68dea9f2f64e7",
"owner": "esri_devlabs",
"orgId": "GVgbJbqm8hXASVYi",
"created": 1569537110000,
"modified": 1569537111000,
"guid": null,
"name": null,
"title": "Seven Natural Wonders of the World Map",
"type": "Web Map"
}
// Private
{
"id": "ITEM_ID",
"owner": "OWNER",
"orgId": "ORG_ID",
"created": "DATE_CREATED",
"modified": "DATE_MODIFIED",
"guid": null,
"name": null,
"title": "ITEM_TITLE",
"type": "ITEM_TYPE"
}