<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automatically Update Coded Values in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850911#M23407</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to write a script to rezip the survey file and update. &amp;nbsp;One thing to note while testing - the update resource is POST only, if you're experimenting you should use a program like POSTMAN first to get everything correct manually.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 May 2017 21:53:14 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2017-05-17T21:53:14Z</dc:date>
    <item>
      <title>Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850910#M23406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I was wondering if I am able to write a script to update the Survey123 Form Coded Values periodically because they are time sensitive to changes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I noticed that my developer application token is forbidden at the following address&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;A class="link-bare" href="https://www.arcgis.com/sharing/rest/content/users/islgispub/{accountId}/items/{ServiceId}/update" title="https://www.arcgis.com/sharing/rest/content/users/islgispub/{accountId}/items/{ServiceId}/update"&gt;https://www.arcgis.com/sharing/rest/content/users/islgispub/{accountId}/items/{ServiceId}/update&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 20:32:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850910#M23406</guid>
      <dc:creator>TonyDaSilva1</dc:creator>
      <dc:date>2017-05-17T20:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850911#M23407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to write a script to rezip the survey file and update. &amp;nbsp;One thing to note while testing - the update resource is POST only, if you're experimenting you should use a program like POSTMAN first to get everything correct manually.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 21:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850911#M23407</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-17T21:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850912#M23408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already written a script to update and re-zip it and send it to the&amp;nbsp;&lt;STRONG&gt;/update&lt;/STRONG&gt; endpoint using POST but even with a token it is giving me a 403 forbidden error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var zipfile = File.ReadAllBytes(ZipPath);&lt;BR /&gt; var thumbfile = File.ReadAllBytes(ExtractPath + "\\esriinfo\\Survey.png");&lt;BR /&gt; var postData = new MultipartFormDataContent();&lt;BR /&gt; postData.Add(new StringContent("pjson"), "f");&lt;BR /&gt; postData.Add(new StringContent(""), "snippet");&lt;BR /&gt; postData.Add(new StringContent("Survey"), "title");&lt;BR /&gt; postData.Add(new StringContent(Token), "token");&lt;BR /&gt; postData.Add(new StringContent("Form, Survey123, Survey123 Connect, xForm"), "typeKeywords");&lt;BR /&gt; postData.Add(new ByteArrayContent(zipfile, 0, zipfile.Count()), "thumbnail", ServiceId + ".zip");&lt;BR /&gt; postData.Add(new ByteArrayContent(thumbfile, 0, thumbfile.Count()), "thumbnail", "Survey.png");&lt;BR /&gt; var response = client.PostAsync(UpdateUrl, postData);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{[error, {&lt;BR /&gt; "code": 403,&lt;BR /&gt; "messageCode": "GWM_0003",&lt;BR /&gt; "message": "You do not have permissions to access this resource or perform this operation.",&lt;BR /&gt; "details": []&lt;BR /&gt;}]}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 May 2017 23:45:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850912#M23408</guid>
      <dc:creator>TonyDaSilva1</dc:creator>
      <dc:date>2017-05-17T23:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850913#M23409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The token should be a parameter in the UpdateURL component, not posted in the form data (token authorization happens before processing of form data)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 15:35:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850913#M23409</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-18T15:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850914#M23410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am replicating what Survey123 form data is using and &lt;SPAN&gt;Survey123 &lt;/SPAN&gt; is providing the token in the form data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if I grab a Survey123's token that it generates and use it, it returns successful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 May 2017 21:27:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850914#M23410</guid>
      <dc:creator>TonyDaSilva1</dc:creator>
      <dc:date>2017-05-18T21:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850915#M23411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have found my answer:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/authentication/limitations-of-application-authentication/" title="https://developers.arcgis.com/authentication/limitations-of-application-authentication/"&gt;Limitations of App Login | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="color: #4c4c4c; font-size: 0.9375rem; margin-left: 0.775rem; margin-bottom: 1.55rem;"&gt;&lt;LI style="margin: 0.3875rem 0px 0.3875rem 1.5rem;"&gt;Applications cannot create, update, share, modify, or delete items (layers, files, services, maps) in &lt;A href="http://www.esri.com/software/arcgis/arcgisonline" style="color: #0079c1; text-decoration: none;"&gt;ArcGIS Online&lt;/A&gt; or &lt;A href="http://www.esri.com/software/arcgis/arcgisserver/extensions/portal-for-arcgis" style="color: #0079c1; text-decoration: none;"&gt;Portal for ArcGIS&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Am I correct in thinking that a web service cannot automatically updated coded values of a Survey123 form?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 20:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850915#M23411</guid>
      <dc:creator>TonyDaSilva1</dc:creator>
      <dc:date>2017-05-26T20:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850916#M23412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh- I missed completely that you were using an application ID/secret token instead of a username based token. &amp;nbsp;Yes, that is the issue.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 15:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850916#M23412</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-30T15:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850917#M23413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way around this, we would like to synchronize our data with our forms without manually updating them every time the data changes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 23:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850917#M23413</guid>
      <dc:creator>TonyDaSilva1</dc:creator>
      <dc:date>2017-05-30T23:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850918#M23414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest way to do that would be to generate a long-life user token and use that instead of the app login.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 23:13:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850918#M23414</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-30T23:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850919#M23415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay thanks, that's what i figured i would have to head towards... I've been reading up on OAuth2, is it possible to have the token refresh itself as 2 week expiration is not ideal ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 23:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850919#M23415</guid>
      <dc:creator>TonyDaSilva1</dc:creator>
      <dc:date>2017-05-30T23:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically Update Coded Values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850920#M23416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Absolutely -&amp;nbsp;take a look at the 'server-based workflow'. &amp;nbsp;As part of the token generation process, a the expiration and a refresh token accompanies. &amp;nbsp;You would have your script store these locally and check the expiration time to now; if less than your criteria, you exchange the refresh token for a new token. &amp;nbsp;The documentation mentions a 'permanent' token; be advised that capability will be removed in an upcoming ArcGIS Online release. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have to start this process manually by using, manually constructed urls, a local web server that won't attempt to process the codes or tokens&amp;nbsp;as your redirect_URI &amp;nbsp;&amp;amp;&amp;nbsp;Postman or curl to complete the authorization code &amp;gt; token and initial (short life) token &amp;gt; long life token exchanges.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 15:59:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/automatically-update-coded-values/m-p/850920#M23416</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-31T15:59:16Z</dc:date>
    </item>
  </channel>
</rss>

