How to update a survey in Survey 123 in C# instead of Python

122
1
08-21-2020 02:01 PM
by Anonymous User
Not applicable

I was pointed to a page (https://survey123.maps.arcgis.com/home/item.html?id=521168944ace40d0827991eeeba03689) by a colleague that provides a python script to automatically update a survey.  We'd like for this to happen from a custom app of ours written in C#.  I thought maybe I found the write library in Nuget to replicate the code (or at least extremely similar) and it is called Esri.ArcGISRuntime but that requires Esri.ArcGISRuntime.WPF which isn't valid for my type of app (an MVC app).  Is it possible to do this at all...if so what .NET library do I need (if you can do it via rest calls themselves we already have that going for other parts but I'm guessing that isn't possible for the update).

0 Kudos
1 Reply
JamesTedrick
Esri Esteemed Contributor

Hi Brandon,

In terms of re-writing this script in C#, that should be achievable; the python script is nearly pure python.  In particular, you should look at the following classes:

- HttpRequest - this would handle the download and upload of the zip file HttpRequest Class (System.Web) | Microsoft Docs 

- ZipFile - this would manage the extraction/repacking of the zip file on disk ZipFile Class (System.IO.Compression) | Microsoft Docs  

- File.Copy - this would copy a file File.Copy Method (System.IO) | Microsoft Docs 

The one thing remotely custom is the authentication component, but that again is a series of calls to the REST API. See Mobile and Native Named User Login | ArcGIS for Developers  for an overview.

0 Kudos