Select to view content in your preferred language

Add webhook to all surveys in Organization

227
1
Jump to solution
02-09-2024 07:50 AM
mattkramer
Occasional Contributor

Hello,

My organization has multiple staff members publishing forms and I was wondering if there is a way for me to script something that will ensure that a webhook we require on every form is added to each form. From looking at the documentation for the survey object in the ArcGIS API for Python, I do not see anything about accessing the webhooks associated with a form.

0 Kudos
1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

Not aware of a way to do this within the API directly.

You can search for survey items, get a list of ids, and compose URLs to the webhook page for each survey. Do this for recently created surveys. 

https://survey123.arcgis.com/surveys/' + surveyid + '/settings/webhook'

Otherwise I've done this before with python downloading the surveys, opening the .iteminfo file, searching it for matching webhook strings. It's a lot of effort.

Neither approach will tell you if the webhook still works.

End of the day... publisher privileges comes with responsibility. If they aren't creating the webhooks or following other best practices, then you'll have to work/communicate with the users and other stakeholders around expectations.

View solution in original post

0 Kudos
1 Reply
ChristopherCounsell
MVP Regular Contributor

Not aware of a way to do this within the API directly.

You can search for survey items, get a list of ids, and compose URLs to the webhook page for each survey. Do this for recently created surveys. 

https://survey123.arcgis.com/surveys/' + surveyid + '/settings/webhook'

Otherwise I've done this before with python downloading the surveys, opening the .iteminfo file, searching it for matching webhook strings. It's a lot of effort.

Neither approach will tell you if the webhook still works.

End of the day... publisher privileges comes with responsibility. If they aren't creating the webhooks or following other best practices, then you'll have to work/communicate with the users and other stakeholders around expectations.

0 Kudos