Select to view content in your preferred language

Error 498 when updating feature layer

49
0
Thursday
AnthonyCastelletto
New Contributor II

Hello Python Community,

    I'm attempting to update a feature layer in Arc GIS Online using Arc GIS Pro's Python Notebooks. I'm fairly competent with Python, but quite new to working with the Python API for Arc GIS Onine. I've been able to connect, find my layer, retrieve features, and edit them. The final step is updating the layer and that's where I've hit a snag. When I execute the update, I get an Invalid Token error (error 498). Can anyone point me towards a solution or show me what I've done wrong?

The code looks something like this:

boocGIS = GIS(host="https://arcgis.com/", client_id="my_client_id")

boocContent = boocGIS.content.advanced_search(query="id: my_feature_id", max_items=max_items)

boocCase = boocGeography.layers[0].query()

#To test my ability to update, I feed the search a specific record id
#Since we describe our records as cases, the attribute is caseID and 1087
#refers to a specific case.
boocCase_feature = [f for f in boocCase if f.attributes['caseID']=='1087'][0]

#Now set some keywords in our case to help users find what they're looking for
boocEdit = boocCase_feature
boocEdit.attributes['keywords'] = 'Marine heatwave prediction forecast aquaculture fishing recreation model, test'

#Now update. This is where I run into the problem
update_result = boocGeography.edit_features(updates=[boocEdit])
update_result

The code above will in end in the invalid token error.

BOOC stands for Benefits of Ocean Observing Catalog and this will be a GIS enabled catalog of applications of the Integrated Ocean Observing System.  Thanks in advance for all your help.

 

 

0 Kudos
0 Replies