<?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: Admiralty API - Request Headers syntax in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/admiralty-api-request-headers-syntax/m-p/1225570#M45592</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/251557"&gt;@ZacharySutherby&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the awsome tip! I was so almost there, but using Postman was an excellent suggestion - a few other tweeks and I was there. Postman will certainly come in useful again in future for other projects too, so 1000 thank yous for the signpost. v. much appreciated.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2022 10:37:39 GMT</pubDate>
    <dc:creator>ChrisMaclaurin</dc:creator>
    <dc:date>2022-10-26T10:37:39Z</dc:date>
    <item>
      <title>Admiralty API - Request Headers syntax</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/admiralty-api-request-headers-syntax/m-p/1224510#M45502</link>
      <description>&lt;P data-unlink="true"&gt;Hi &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I am tying to call back tide station data to populate a survey form using &lt;A href="https://admiraltyapi.portal.azure-api.net/docs/services/uk-tidal-api/operations/Stations_GetStation" target="_self"&gt;Admiralty API&lt;/A&gt;. I used to use csv files for the approprate stations / day / tide data but I have to update these every year manually. Yawn!&lt;/P&gt;&lt;P data-unlink="true"&gt;I have not come accross request headers using JavaScript before and I am struggling with the syntax. what I have so far is...&lt;/P&gt;&lt;P&gt;function runTideCalcs(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var xmlhttp = new XMLHttpRequest();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var url = `&lt;A href="https://admiraltyapi.azure-api.net/uktidalapi/api/V1/Stations/0065/TidalEvents?duration=1" target="_blank" rel="noopener"&gt;https://admiraltyapi.azure-api.net/uktidalapi/api/V1/Stations/0065/TidalEvents?duration=1&lt;/A&gt;`;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;xmlhttp.open("GET",url,false);&lt;/P&gt;&lt;P&gt;xmlhttp.send();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (xmlhttp.status!=200){&lt;/P&gt;&lt;P&gt;return null;&lt;/P&gt;&lt;P&gt;} else {&lt;/P&gt;&lt;P&gt;var responseJSON=JSON.parse(xmlhttp.responseText)&lt;/P&gt;&lt;P&gt;if (responseJSON.error){&lt;/P&gt;&lt;P&gt;return responseJSON.error;&lt;/P&gt;&lt;P&gt;} else {&lt;/P&gt;&lt;P&gt;if (responseJSON){&lt;/P&gt;&lt;P&gt;return JSON.stringify(responseJSON);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;else {&lt;/P&gt;&lt;P&gt;return "";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;....But I am not sure what syntax or where to incorporate the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Naturally I have an Admiralty account and Sub. key. Any pointers would be very welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 13:45:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/admiralty-api-request-headers-syntax/m-p/1224510#M45502</guid>
      <dc:creator>ChrisMaclaurin</dc:creator>
      <dc:date>2022-10-23T13:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Admiralty API - Request Headers syntax</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/admiralty-api-request-headers-syntax/m-p/1224967#M45550</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/416653"&gt;@ChrisMaclaurin&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would suggest using an API debugging software like &lt;A href="https://www.postman.com/" target="_self"&gt;Postman&lt;/A&gt; for example, Postman has a nice GUI that help set up the API call to get it in a state where it is working. When it's up and running in Postman there is a nice code snippet functionality that will format the request in a JavaScript XHR format that you can copy over to your JavaScript function and modify as needed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 23:01:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/admiralty-api-request-headers-syntax/m-p/1224967#M45550</guid>
      <dc:creator>ZacharySutherby</dc:creator>
      <dc:date>2022-10-24T23:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Admiralty API - Request Headers syntax</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/admiralty-api-request-headers-syntax/m-p/1225570#M45592</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/251557"&gt;@ZacharySutherby&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the awsome tip! I was so almost there, but using Postman was an excellent suggestion - a few other tweeks and I was there. Postman will certainly come in useful again in future for other projects too, so 1000 thank yous for the signpost. v. much appreciated.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 10:37:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/admiralty-api-request-headers-syntax/m-p/1225570#M45592</guid>
      <dc:creator>ChrisMaclaurin</dc:creator>
      <dc:date>2022-10-26T10:37:39Z</dc:date>
    </item>
  </channel>
</rss>

