AnsweredAssumed Answered

how to add the token parameter to applyEdits

Question asked by cwoldorf on Oct 3, 2017

I'm trying to send updates from my web app to a feature service rest api and need to add the token parameter to the request in addition to the "attributes" json but the applyEdits documentation doesn't address the token (or client_id) parameter. The parameter requirements in the documentation are nested and I can't determine which level the token parameter belongs to. Here is the syntax from the documentation for applyEdits:

[
{ "id" : <layerId1>,
"adds" : [<feature1>, <feature2>],
"updates" : [<feature1>, <feature2>],
"deletes" : [<objectID1>, <objectID2>]
},
{ "id" : <layerId2>,
"adds" : [<feature1>, <feature2>],
"updates" : [<feature1>, <feature2>],
"deletes" : [<objectID1>, <objectID2>]
}
]

 

For an update, the <feature1> json might look like this:

"attributes" : {
"OBJECTID" : 50,
"datetime" : 1272210710000,
"region" : "Andreanof Islands, Aleutian Islands, Alaska"
}

 

I haven't been able to get a test record update to work and i think it has to do with the fact that the portal where the feature service is located requires login so i need to add the valid token in the param list. I have been able to use the query to get the attributes back from the feature service but that json is not nested so it works much easier. Any help would be greatly appreciated!

Outcomes