Select to view content in your preferred language

ArcGIS Online feature layer webhooks - view required?

139
2
Jump to solution
12-17-2024 02:48 PM
DavidPike
MVP Frequent Contributor

Hi,

In AGOL I have a hosted feature service layer created by a Survey123 published form.  

Trying to create a feature service webhook in AGOL (don't want to do this in Survey123 because another API will be interacting with the layer outside of the 123 app).  It seems a view must first be created to allow a webhook to be set in the JSON REST settings.

Seems a bit of a strange requirement to me.  Can anyone shed any light on this and/or the rationale behind it.

 

Thanks!

1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

Are you saying you can't create a webhook on the source feature layer at all, or only after a view is created?

Are you sure it wasn't another action like enabling change tracking, or maybe query being disabled by default on survey123 layers because of editing settings?

I was looking at this earlier in the week and found very little documentation on this around the behaviour with views.

Testing it I found:

  • If the webhook is on the feature layer, all edits made against the feature layer or any of its views trigger the webhook
  • If the webhook is on the view, it will only trigger if the edit is made against the view itself. However, I noticed some webhook payloads were empty of data in make. Not sure why but suspect it's because the feature was moved out of the view definition by the edit. 

Even though I hit that issue I'd recommend considering the impact of making edits on your service and the webhook. You may want to make the API interactions via a view, particularly if they're adds, so that other interactions can be made with the service without triggering the webhook or needing to disable it.

If anyone coming across this thread has more resources on views and webhooks that would be great... 

View solution in original post

0 Kudos
2 Replies
ChristopherCounsell
MVP Regular Contributor

Are you saying you can't create a webhook on the source feature layer at all, or only after a view is created?

Are you sure it wasn't another action like enabling change tracking, or maybe query being disabled by default on survey123 layers because of editing settings?

I was looking at this earlier in the week and found very little documentation on this around the behaviour with views.

Testing it I found:

  • If the webhook is on the feature layer, all edits made against the feature layer or any of its views trigger the webhook
  • If the webhook is on the view, it will only trigger if the edit is made against the view itself. However, I noticed some webhook payloads were empty of data in make. Not sure why but suspect it's because the feature was moved out of the view definition by the edit. 

Even though I hit that issue I'd recommend considering the impact of making edits on your service and the webhook. You may want to make the API interactions via a view, particularly if they're adds, so that other interactions can be made with the service without triggering the webhook or needing to disable it.

If anyone coming across this thread has more resources on views and webhooks that would be great... 

0 Kudos
DavidPike
MVP Frequent Contributor

Thanks Christopher.

You're right - on checking my original assumption I was mistaken and it seems a view is not required (which would have been strange!).

The only setting needing ticked was - 'Keep track of changes to the data (add, update, delete features).'

this then made the 'Webhooks' option available in the rest/admin page of the service. (also I previously said JSON which was me getting confused again..).