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.
Thanks for the update! I'll check this out and I'm sure I will learn a few things. I wasn't aware of the "sleep" function in Integromat, so I'll have to look into that as well. Awesome!
Hoping you can advise on this one @Peter_Klingman...
I've started using Integromat to automate and grab the resulting json file and give me the specific attributes I am after (referenced at the bottom of the blog post). The only issue I'm encountering is that my feature service needs to be publicly shared for this to work. Is it possible to build into the Integromat scenario an authentication so that this can be achieved without needing to publicly share an editable feature service?
Hi @JoshHarris - I had to check the blog to be sure, but it is surprising that it was written for a publicly editable hosted layer. Since we are now more explicitly discouraging publicly editable layers, this would be important to amend.
You will need to generate a token that will be appended to the URLs. You can do this in Integromat with the HTTP module. I did test this quickly and it returns a token that can be used to access a secure service. Then you would append the token to each of the service URLs to access the endpoints. Below are the parameters I used in the request body, also documented in the generateToken link.
I hope this helps ~ it definitely needs some fine-tuning but I hope this gets you started!
That's great, thanks @Peter_Klingman. I've managed to get the token to generate and then append to the URLs along the scenario, utilising the substring function to grab the token from HTTP response. It's not the prettiest but it works!
@Peter_Klingman @JoshHarris Thanks for this information! I'm trying the same thing, the token is generated, I appended it to the changesUrl, which works, but when I append it to the statusUrl the output gives me an error:
The length of the URL for this request exceeds the configured maxUrlLength value.
Any ideas how to solve this?
@JoshHarrisThanks for the advice. I did use the substring function but instead of using "/0?token=" I used "&token=". This works in the HTTP request to the changesUrl, but not in the HTTP request to the statusUrl or the resultUrl. So now it looks like this and it works:
Hi @JoshHarris and @MennoTerBals1 I've been taking a much closer look at webhooks in preparation for a dev summit tech session (shameless plug, definitely check it out if you're planning to attend). I left out earlier the importance of the JSON module in Integromat. You shouldn't need to use the substring function; instead, choose the Parse JSON option from the JSON module and parse the JSON response of generate token to obtain the token.
In working with some colleagues as well (my apologies for not having as much awareness of this a few weeks back) we are really recommending the use of Integromat's HTTP module to make an Oauth2 request both for secure resources obtained with a GET request and to generate a server token that can be reused in post requests. Follow these steps to get started. You will need to register an app in ArcGIS Online with the redirect URI that Integromat specifies, too.
Here are some sample screenshots of how my Oauth2 request module is set up:
You'll also input your app's client ID and client secret when setting up the module, but these are hidden after configuration.
I hope this helps,