I would like to get the question names for a Survey123 form using the REST API. What is the best way to do that?
I found the following endpoint, which gets me close:
https://www.arcgis.com/sharing/rest/content/items/[item_number]/info/[form_name].webform
In the return object from the above endpoint I get a key-value pair where the key is "model" and the "value" is shown below. It looks like XML, but there is a "\n" on every line that is making it difficult for us to process.
<Form_3
xmlns:esri=\"http://esri.com/xforms\"
xmlns:jr=\"http://openrosa.org/javarosa\"
xmlns:odk=\"http://www.opendatakit.org/xforms\"
xmlns:orx=\"http://openrosa.org/xforms\" id=\"Form_3\">\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>starttime</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>AOMInitials</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>AOMOther</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>DailyScheduled</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>SpecialInspectionType</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>SpecialOther</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>SpecialLocation</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>endtime</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>meta</SPAN><SPAN class="punctuation token">></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>instanceID</SPAN><SPAN class="punctuation token">/></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>meta</SPAN><SPAN class="punctuation token">></SPAN></SPAN>\n
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>Form_3</SPAN><SPAN class="punctuation token">></SPAN></SPAN>\n<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
How can we convert that to standard XML/JSON? Is there a better endpoint we could use where we could get back the "model" in JSON or correctly formatted JSON?
Thanks!
Matt