Extract Changes Error - Invalid Sync model type. syncLayers json object is required.

4222
19
11-04-2020 10:49 AM
AidanDonnelly
New Contributor II

Hello,

I'm receiving a strange error when I try to run extractChanges on some of my Hosted Feature Services.  I'm pretty new to using the REST API but had everything working yesterday via Integromat HTTP requests and JSON. 

Sync is turned off on this service as well as the others that are experiencing the issue, but change tracking is turned on.

Thanks for any help.

 Error received from Extract Changes

19 Replies
PhilLarkin1
Occasional Contributor III

Were you able to resolve this issue? 

When Posting the extractChanges via Power Automate, the job ID returned always leads to the Invalid Sync error. When I submit via the Services Directory the job ID leads to a successful status and I get the edits back via JSON.  

0 Kudos
JulieK
by
Occasional Contributor

Hello,

Were you able to get it to work on Power automate? Any work around?

Thanks,

Julie

0 Kudos
PhilLarkin1
Occasional Contributor III

Hello

I don't recall what my initial issue was but was able to get it working. 

This is showing a POST to the Extract Changes endpoint: https://services1.arcgis.com/<yourOrgID>/ArcGIS/rest/services/Addresses/FeatureServer/extractChanges

The response includes the statusUrl property with a job ID: https://services1.arcgis.com/<yourOrgID>/ArcGIS/rest/services/Addresses/FeatureServer/jobs/9edaa7a1-4fce-4b69-a521-3example9

PhilLarkin1_0-1626103713484.png

 

0 Kudos
JulieK
by
Occasional Contributor

Hey @PhilLarkin1 ,

When I send the Statusurl along with the generated token, I get an error saying ' The length of the URL for this request exceeds the configured maxUrlLength value.'. I am using HTTP connect with GET and sending the StatusUrl&token=generated token. 

Did you experience anything similar? Wonder where I am going wrong with Power Automate.

0 Kudos
PhilLarkin1
Occasional Contributor III

Try using POST to the FeatureServer/jobs/<guid> endpoint. Your token and format key/values should be sent as queries.

PhilLarkin1_0-1627484337766.png

 

0 Kudos
JulieK
by
Occasional Contributor

Yes, I tried that. That leads me to 'Unable to synchronize replica. Invalid Sync model type. syncLayers json object is required.' The feature service has the sync option disabled but I get the same error when it is enabled too.

0 Kudos
PhilLarkin1
Occasional Contributor III

Congratulations! You've at least overcome the issue resulting from the GET to FeatureServer. I'd keep sending it as POST.

Does the result of the post to the FeatureServer/jobs/<guid> endpoint throw that error, or does it happen at an earlier step? This should be occurring at the extractChanges endpoint, which should happen after you get the changes URL. 

One troubleshooting step is to walk through the calls to AGS manually. 

 

Have you tried manually entering info from the services endpoint? 

0 Kudos
JulieK
by
Occasional Contributor

When I do it manually from the REST api, I am able to get the json file fine. In a browse, the statusUrl with token gives me maxUrlLength value error. In PA, I am able to send the changeurl to receive  statusurl fine but when I send statusUrl using GET, it gives the maxUrlError and POST gives me  Invalid Sync model type error.

Wonder what I am missing . Appreciate your time!!

0 Kudos
PhilLarkin1
Occasional Contributor III

Maybe your statusUrl is invalid.

I had some issues when my query values were not setup properly on my POST to /extractChanges. Try sending returnInserts, ReturnUpdates, and returnDeletes if these are valid operations on your Feature Service. You might also want to leave your layers value empty if you are only processing edits from a single layer. Worked for me. 

PhilLarkin1_0-1627499592327.png

Example Query: 

{
  "token": "5Dtmq06...",
  "f": "json",
  "layers": "",
  "returnInserts": "false",
  "returnUpdates": "false",
  "returnDeletes": "true",
  "serverGens": "[1949280,1949301]",
  "dataFormat": "json",
  "returnAttachmentsDataByUrl": "true"
}



0 Kudos