Skip to content

Instantly share code, notes, and snippets.

@nommuna2
Last active April 26, 2019 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nommuna2/48888a5cb7757a8b3dda7f4f155152d4 to your computer and use it in GitHub Desktop.
Save nommuna2/48888a5cb7757a8b3dda7f4f155152d4 to your computer and use it in GitHub Desktop.
(ArcGIS API for Python) Make items authoritative in AGOL
import arcgis
from arcgis.gis import GIS
import requests
gis = GIS(None,'username', 'password', verify_cert=False)
try:
featureLayerItem = gis.content.get('item id')
r = requests.post('https://{0}/sharing/rest/content/items/{1}/setContentStatus'.format('org domain',featureLayerItem.id), data= {'status': 'org_authoritative','clearEmptyFields': 'false', 'f':'json', 'token': 'token'})
print(r)
except Exception as e:
print(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment