AGOL Feature Service Webhooks

9861
38
07-07-2020 02:35 AM
RonParis
Occasional Contributor

Referencing the recent blog post which has introduced webhook to hosted feature services in AGOL. I was wondering if it was possible to use this to return the updates that have been made to the feature class. 

At the moment, it will tell me when a feature has been created, but I want to be able to pull the attributes of the feature that was created.

TIA

Tags (1)
0 Kudos
38 Replies
RonParis
Occasional Contributor

Thanks @Anonymous User , I've increased to 30s and all seems smoother. 

On another note, should it be possible for edits in Pro to be pulled through? I've got a hosted feature service and I'm making edits to the service in Pro, but it's not triggering my scenario in Integromat. 

 

Thanks for sessions details

0 Kudos
by Anonymous User
Not applicable

Hi Josh,

I would expect that any editing client would trigger the webhook. I just tested this myself and may need to dig into it further/possibly get an issue logged - I am getting a 'bad request' error when I try to submit an edit from Pro on a feature layer that has an active webhook. 

  • What change types do you have configured?
  • What version of Pro are you using?

Thanks,

-Peter

0 Kudos
RonParis
Occasional Contributor

Hi Peter,

Thanks, I am getting the same error, but not consistently. I'm using 2.7.0 (aware of update). Originally it was just configured to FeatureUpdates, but I then switched to the wildcard to see if that would make any difference. 

Just an fyi, my original workflow was to calculate certain fields using python, and then capture these updates in the webhook. I noticed it wasn't capturing in the webhook so switched to Pro directly, to see if it would be captured there

 

Cheers

Josh

0 Kudos
by Anonymous User
Not applicable

Hi @RonParis thanks for the response on this. At 2.7.1 I can repro the error consistently so I did end up logging an issue for it. If you can DM me your customer number or shoot an email to pklingman@esri.com with that information I'll get your account attached. Re: calculating fields with Python, that should definitely trigger on FeaturesUpdated. Were you using ArcPy or the API for Python? Would be great to get an issue logged for this too.

Best regards,

-Peter

0 Kudos
SFM_TravisBott
Occasional Contributor III

@Anonymous User - Just to add on to this thread of thinking, I have not been able to reproduce said error in Pro (2.7.1), as it lets me update the service just fine, but updating attributed via the Field Calculator does not seem to trigger the webhooks. My workflow is similar to @RonParis. When a record is marked 'Approved,' I would like a Survey123 Feature Report generated and emailed. I have the process set, and it triggers fine when edits are done in AGOL. But it's important to also have the ability batch approve records, which I had planned to do in the Field Calculator. 

Any insight would be appreciated. 

0 Kudos
by Anonymous User
Not applicable

Hi @SFM_TravisBott - Good timing, I actually just messaged Josh yesterday on this - I was able to repro calculating a field not triggering a webhook with all change types enabled. I logged ENH-000138947: Enable hosted feature layer webhooks to fire when fields are calculated for this functionality. From what I can tell, /calculate does not currently fall under the featureUpdated change type umbrella - this is why I logged this as an enhancement request rather than a bug. If you can drop me a private message or email pklingman@esri.com with your customer number I can get your account attached. 

Thanks,

-Peter

JoshConrad1
New Contributor III

@Anonymous User 

Thank you for the thorough work you have done throughout this thread, it is extremely helpful.

I am interested in creating a webhook with fieldmaps that sends an email when a specific "status" field is updated in an existing feature. However my question is: will the webhook be triggered based off the "last_edited" field, or will the email be sent based off the specific "status" change? I am apprehensive to implement this workflow if the webhook is only triggered when the last_edited field is changed since that will happen if any field within the feature is updated. I am having a difficult time finding documentation regarding this specific work flow question.

thank you for your time.

MikeFiguray
New Contributor III

Hi @Anonymous User , Hoping you or someone else can help me out. I'm not a developer, and I expect that the answer to my question is pretty simple. I'm following along with your video from the dev summit, trying to set up webhooks on a protected feature layer. The video mentions that in order to get the resultsURL json file, I need to generate a server token through the HTTP Oauth2 module. I'm having a hard time figuring out what the service URL is that I need to pass into the ServerURL parameter in the query string of the Oauth2 module. Any help on where to find that would be appreciated!

Thank you,
Mike

0 Kudos
MikeFiguray
New Contributor III

Sorry... figured it out. In case anyone else has a hard time figuring this out, this is how I found the Service url:

1. Go to the hosted feature layers page in "My Content"
2. At the bottom right, "Copy" the Url
3. Paste this url into the Query parameter, then delete the feature layer name and "FeatureServer" from the url so it looks like this:

https://services.arcgis.com/xxxxxxxxxxxxxxxx/arcgis/rest/services

Thank you,
Mike

0 Kudos