AGOL Feature Service Webhooks

9869
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
Danielle_Journey
Occasional Contributor

@Anonymous User  In the dev summit presentation will you go over how to register an app in AGO, and how to get the app's client ID and client secret?  I'm trying to follow this post to set up my Integromat scenario for a hosted feature service but I'm new to all of this and need a bit more instruction.  Thanks!  

0 Kudos
by Anonymous User
Not applicable

Hi @Danielle_Journey - this is gone over in a lot of depth in the presentation, and it is definitely not the easiest of workflows. In the meantime - this documentation also goes over the steps of registering an app in ArcGIS Online. It's for Web AppBuilder but the steps are the same in the workflow. Integromat also has some good documentation on their Oauth2 HTTP request module that might help. This is the module where you will use the app ID and app secret obtained from the app registration. 

Hope this helps!

Danielle_Journey
Occasional Contributor

@Anonymous User I've been following along to your Dev Summit video for Hosted Feature Layer Webhooks (which is awesome, and just what I needed!), but I keep getting stuck at the same point in the process.  I'm having trouble registering the app and getting the Oauth 2 in Integromat to connect.  Following along with your example of creating an app, registering it, I get the pop up to log in with my credentials, but then I get the following blue screen error.  Any help would be much appreciated! 

"\n\n\n\n\n\n\n\n<html>\n\n\n\n\n\n\n<head>\n<title>\nError: Invalid URL</title>\n<link href=\"/sharing/rest/files/gw.css\" rel=\"stylesheet\" type=\"text/css\"/>\n</head>\n\n<body>\n\n<table width=\"100%\" class=\"topTable\">\n<tr valign=\"top\">\n<td>\n<b>ArcGIS Portal Directory</b>\n\n</td>\n<td align=\"right\">\n\n</td>\n</tr>\n</table>\n\n<table class=\"navTable\" width=\"100%\"><tr><td class=\"breadcrumbs\">Error</td></tr></table>\n\n<div class=\"gwDiv\">\n\n<h3>Invalid URL</h3><br/>\n\n<b>Error: </b>400<br/><br/>\n\n\n\n</div>\n\n</body>\n\n</html>\n"

 

Screenshot 2022-02-08 140229-error.jpg

0 Kudos
by Anonymous User
Not applicable

Glad the video is helpful! Interesting, as a test can you try registering a different app and see if you can sign into it? Invalid URL to me points to the redirect URIs specified when registering the app. There are few more listed here that I may not have covered in the video, possibly adding those would help: https://community.esri.com/t5/arcgis-quickcapture-blog/connecting-integromat-to-an-arcgis-enterprise...

If this is still not working, though not ideal you could, as a temporary workaround, generate the server token with a generateToken call and your ArcGIS Online username and password, then just use that token with the requests. 

I hope this helps,

-Peter

0 Kudos
Derek_Bedarf
New Contributor

Hi Peter,

Is there a way to use the extract changes example you have above to take the coordinates of a newly created feature and reverse geocode to a field? I'm trying to think of a way to auto-populate a field with an address derived from only a point placed on the map.

Thanks. -Derek

0 Kudos
by Anonymous User
Not applicable

Hi @Derek_Bedarf - this sounds possible to me. You have access to the attributes of the feature (here is the blog on how to accomplish that component), so you would need to obtain the X/Y from the edit, then chain together some HTTP modules to reverse geocode the coordinates and then update the feature or apply the edit, back into the desired field. Hope this helps!

0 Kudos
julian_svcs
Occasional Contributor

Hi Peter. 

I am trying to run the extract changes for an ArcGIS Online feature layer. When I try and access the job's resulting URL I get an error stating "Invalid Sync model type. syncLayers json object is required.".

Do you know what is causing this?

Thanks, Julian.

julian_svcs_0-1611282971775.png

 

0 Kudos
by Anonymous User
Not applicable

Hi Julian,

The one record of this error I am seeing internally indicated it was caused by a mismatch between the layerServerGens and Layers parameters in the extractChanges call.

I would make sure the same layers are referenced in each parameter (e.g. 0 in both parameters vs. 0 in one parameter and 0 and 1 in the other). If they are and you are still running into the issue, let me know and I can help get a support case going for an analyst to take a closer look at the issue. 

I hope this helps,

-Peter

0 Kudos
RonParis
Occasional Contributor

Thanks @Anonymous User , that's working a treat now with Oauth2. I'm noticing though I'm quite frequently getting the below error when trying to get the resultUrl. Any ideas to what could be causing/why it would be missing from the JSON module?

Screenshot 2021-02-10 at 08.37.41.png

Screenshot 2021-02-10 at 08.46.20.png

Screenshot 2021-02-10 at 08.38.00.png

RE shameless plug, when is the tech session and how can I attend?

0 Kudos
by Anonymous User
Not applicable

Hi @RonParis - thanks for the response on this and glad Oauth is working. I think you are running into that error because the result URL is still pending. I have run into this a few times too and needed to increase the time of Integromat's sleep tool to delay requesting the result URL:

Peter_Klingman_0-1612971939015.png

Re: Dev Summit session - it is a pre-recorded 30 minute demo that will be made available to conference attendees. So if you register for Dev Summit, once the event begins you can view it. 

Best,

-Peter

0 Kudos