<?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>article API Calls in Legacy - Engage Bot</title>
    <link>https://community.sinch.com/t5/Legacy-Engage-Bot/API-Calls/ta-p/19198</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;The Chatbot can perform a webservice (API) call to an external system from within a dialogue for retrieving additional data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If you would like to use this functionality, please raise a ticket.&amp;nbsp;&lt;/STRONG&gt;When the module is activated, an additional field for the URL (endpoint) of the target system appears in the detailed view of a dialogue. Furthermore there will be a field where you can choose the classical REST methods like&amp;nbsp; GET, PUT, POST, DELETE for the call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In our example, we are performing a request to a weather service for retrieving the current weather. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sinch.com/t5/Legacy-Engage-Bot/Variables/ta-p/19148" target="_blank" rel="noopener"&gt;variable&amp;nbsp;&lt;/A&gt;$openweather$&amp;nbsp;holds the desired place that the user wants to get the weather info for.&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="apicalls_dialogue_weather.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7043i1E671E119126E985/image-size/large?v=v2&amp;amp;px=999" role="button" title="apicalls_dialogue_weather.png" alt="apicalls_dialogue_weather.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how the API response looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
  "coord": {
    "lon": -0.13,
    "lat": 51.51
  },
  "weather": [
    {
      "id": 500,
      "main": "Rain",
      "description": "light rain",
      "icon": "10d"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 10.68,
    "pressure": 996,
    "humidity": 87,
    "temp_min": 9.44,
    "temp_max": 11.67
  },
  "visibility": 10000,
  "wind": {
    "speed": 3.1,
    "deg": 120
  },
  "clouds": {
    "all": 75
  },
  "dt": 1556174048,
  "sys": {
    "type": 1,
    "id": 1414,
    "message": 0.0109,
    "country": "GB",
    "sunrise": 1556167474,
    "sunset": 1556219532
  },
  "id": 2643743,
  "name": "London",
  "cod": 200
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use JSON-Path for printing the API response to&amp;nbsp;the bot-answer, e.g.&amp;nbsp;$api.main.temp$&amp;nbsp;for the temperature. $api$ holds the JSON-Object of the response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how the whole thing looks like in action:&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="3.png" style="width: 720px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7044iA3D8820A5EA883BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use the response in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sinch.com/t5/Legacy-Engage-Bot/If-Else-conditions/ta-p/19168" target="_blank" rel="noopener"&gt;if-else conditions&lt;/A&gt;, for example for reacting on errors (e.g. just like in the above example, the text response will be returned only in case of success, $api.cod$ == 200).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;special syntax&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;you can save values from the API response to variables and make them available for further use: $temperature=($api.main.temp$)$ where $temperature$ is the variable the value should be saved to and $api.main.temp$ is the value of the response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: For debugging purposes you can output the call made by the bot using a variable $api_request$.&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 19 Feb 2026 15:08:32 GMT</pubDate>
    <dc:creator>VishalSandhu</dc:creator>
    <dc:date>2026-02-19T15:08:32Z</dc:date>
    <item>
      <title>API Calls</title>
      <link>https://community.sinch.com/t5/Legacy-Engage-Bot/API-Calls/ta-p/19198</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;The Chatbot can perform a webservice (API) call to an external system from within a dialogue for retrieving additional data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If you would like to use this functionality, please raise a ticket.&amp;nbsp;&lt;/STRONG&gt;When the module is activated, an additional field for the URL (endpoint) of the target system appears in the detailed view of a dialogue. Furthermore there will be a field where you can choose the classical REST methods like&amp;nbsp; GET, PUT, POST, DELETE for the call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In our example, we are performing a request to a weather service for retrieving the current weather. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sinch.com/t5/Legacy-Engage-Bot/Variables/ta-p/19148" target="_blank" rel="noopener"&gt;variable&amp;nbsp;&lt;/A&gt;$openweather$&amp;nbsp;holds the desired place that the user wants to get the weather info for.&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="apicalls_dialogue_weather.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7043i1E671E119126E985/image-size/large?v=v2&amp;amp;px=999" role="button" title="apicalls_dialogue_weather.png" alt="apicalls_dialogue_weather.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how the API response looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
  "coord": {
    "lon": -0.13,
    "lat": 51.51
  },
  "weather": [
    {
      "id": 500,
      "main": "Rain",
      "description": "light rain",
      "icon": "10d"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 10.68,
    "pressure": 996,
    "humidity": 87,
    "temp_min": 9.44,
    "temp_max": 11.67
  },
  "visibility": 10000,
  "wind": {
    "speed": 3.1,
    "deg": 120
  },
  "clouds": {
    "all": 75
  },
  "dt": 1556174048,
  "sys": {
    "type": 1,
    "id": 1414,
    "message": 0.0109,
    "country": "GB",
    "sunrise": 1556167474,
    "sunset": 1556219532
  },
  "id": 2643743,
  "name": "London",
  "cod": 200
}
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use JSON-Path for printing the API response to&amp;nbsp;the bot-answer, e.g.&amp;nbsp;$api.main.temp$&amp;nbsp;for the temperature. $api$ holds the JSON-Object of the response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how the whole thing looks like in action:&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="3.png" style="width: 720px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7044iA3D8820A5EA883BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use the response in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.sinch.com/t5/Legacy-Engage-Bot/If-Else-conditions/ta-p/19168" target="_blank" rel="noopener"&gt;if-else conditions&lt;/A&gt;, for example for reacting on errors (e.g. just like in the above example, the text response will be returned only in case of success, $api.cod$ == 200).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;special syntax&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;you can save values from the API response to variables and make them available for further use: $temperature=($api.main.temp$)$ where $temperature$ is the variable the value should be saved to and $api.main.temp$ is the value of the response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: For debugging purposes you can output the call made by the bot using a variable $api_request$.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Feb 2026 15:08:32 GMT</pubDate>
      <guid>https://community.sinch.com/t5/Legacy-Engage-Bot/API-Calls/ta-p/19198</guid>
      <dc:creator>VishalSandhu</dc:creator>
      <dc:date>2026-02-19T15:08:32Z</dc:date>
    </item>
  </channel>
</rss>

