<?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 Need help on Rest API connection in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Rest-API-connection/m-p/687439#M19347</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a tool that connects to Baidu Maps API to extract travel time data based on the different modes of transport.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've successfully manage to create a custom function that allows dynamic changes to Start and End destinations. However, results i get from Baidu maps is that the "&lt;STRONG&gt;App is not present, there is error in the AK&lt;/STRONG&gt;" refer to Column D . When i tested the URL link in a blank webpage, it manage to return valid results for the Start and End locations if i typed in manually. However, if i copy the data from the cell into the URL, it gives error (shown below). Appreciate if anyone can enlighten on what went wrong. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(Start as text, End as text) =&amp;gt; 

let 

   Baidu_API_key = "API_key", 
   Distance_lite = Web.Contents("http://api.map.baidu.com/directionlite/v1/driving?origin=Start&amp;amp;destination=End&amp;amp;ak=Baidu_API_key"),
   Results = Json.Document(Distance_lite)

in

Results&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.PNG" style="width: 890px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/163487iD3B4C222D98A55EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error.PNG" alt="Error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error 2.PNG" style="width: 579px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/163498iF0D2F212466E1861/image-size/large?v=v2&amp;amp;px=999" role="button" title="error 2.PNG" alt="error 2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2019 09:29:47 GMT</pubDate>
    <dc:creator>slackerhx</dc:creator>
    <dc:date>2019-05-09T09:29:47Z</dc:date>
    <item>
      <title>Need help on Rest API connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Rest-API-connection/m-p/687439#M19347</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a tool that connects to Baidu Maps API to extract travel time data based on the different modes of transport.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've successfully manage to create a custom function that allows dynamic changes to Start and End destinations. However, results i get from Baidu maps is that the "&lt;STRONG&gt;App is not present, there is error in the AK&lt;/STRONG&gt;" refer to Column D . When i tested the URL link in a blank webpage, it manage to return valid results for the Start and End locations if i typed in manually. However, if i copy the data from the cell into the URL, it gives error (shown below). Appreciate if anyone can enlighten on what went wrong. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(Start as text, End as text) =&amp;gt; 

let 

   Baidu_API_key = "API_key", 
   Distance_lite = Web.Contents("http://api.map.baidu.com/directionlite/v1/driving?origin=Start&amp;amp;destination=End&amp;amp;ak=Baidu_API_key"),
   Results = Json.Document(Distance_lite)

in

Results&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error.PNG" style="width: 890px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/163487iD3B4C222D98A55EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Error.PNG" alt="Error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error 2.PNG" style="width: 579px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/163498iF0D2F212466E1861/image-size/large?v=v2&amp;amp;px=999" role="button" title="error 2.PNG" alt="error 2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 09:29:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Rest-API-connection/m-p/687439#M19347</guid>
      <dc:creator>slackerhx</dc:creator>
      <dc:date>2019-05-09T09:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Rest API connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Rest-API-connection/m-p/688412#M19358</link>
      <description>&lt;P&gt;I've made modifications to my query function and its now pulling the same data as what is available on webpage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(Start as text, End as text) =&amp;gt; 

let 

   Baidu_API_key = "APIkey", 
   Distance_lite = Web.Contents("http://api.map.baidu.com/directionlite/v1/transit?",
                   [Query=
                         [origin=Start,
                          destination=End,
                          ak=Baidu_API_key]]),
   Results = Json.Document(Distance_lite)

in

Results&lt;/PRE&gt;&lt;P&gt;I read the documentation for Baidu Directions Lite API again, it states that the format of origin needs to be &lt;STRONG&gt;Double, Double. &lt;/STRONG&gt;(please see documentation here&amp;nbsp;&lt;A href="http://lbsyun.baidu.com/index.php?title=webapi/direction-api-v2" target="_blank" rel="noopener"&gt;http://lbsyun.baidu.com/index.php?title=webapi/direction-api-v2&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greatly appreciate if anyone can suggest a solution to pass the query inputs as number instead of string. I haven't figure out a way to pass the parameter as numbers when comma is involved. The example coordinates i've used were &lt;STRONG&gt;origin =&amp;nbsp;22.599244, 114.049508 | destination =&amp;nbsp;22.543648, 113.947003&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 08:06:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Rest-API-connection/m-p/688412#M19358</guid>
      <dc:creator>slackerhx</dc:creator>
      <dc:date>2019-05-10T08:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on Rest API connection</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Rest-API-connection/m-p/692381#M19405</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my colleague helped to solve the above issue. It is crucial for the orign and destination inputs to omit spacing for the api to be connected correctly. Hence, instead of&amp;nbsp;&lt;STRONG&gt;22.543648, 113.947003 &lt;/STRONG&gt;it should be&amp;nbsp;&lt;STRONG&gt;22.543648,113.947003.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 06:25:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-Rest-API-connection/m-p/692381#M19405</guid>
      <dc:creator>slackerhx</dc:creator>
      <dc:date>2019-05-16T06:25:17Z</dc:date>
    </item>
  </channel>
</rss>

