Last active
April 26, 2019 21:00
-
-
Save nommuna2/48888a5cb7757a8b3dda7f4f155152d4 to your computer and use it in GitHub Desktop.
(ArcGIS API for Python) Make items authoritative in AGOL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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