<?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>Thema "Betreff: HowTo send a command via the API ? Or what is the correct syntax?" in Getting started programming with the Viessmann API</title>
    <link>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179287#M4</link>
    <description>&lt;P&gt;Thanks for the answer.&lt;/P&gt;&lt;P&gt;I did use POST and tried it also with the header Content-Type&amp;nbsp;&lt;SPAN&gt;application/json.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So far I did not put in any PARAMS for the POST request, using just the url as posted above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The result is always as the above posted (first) error message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm using&amp;nbsp;&lt;A href="https://www.postman.com/" target="_self"&gt;POSTMAN&lt;/A&gt;&amp;nbsp; to test-send such messages.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 27 Jun 2021 09:22:02 GMT</pubDate>
    <dc:creator>JueBag</dc:creator>
    <dc:date>2021-06-27T09:22:02Z</dc:date>
    <item>
      <title>HowTo send a command via the API ? Or what is the correct syntax?</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179232#M2</link>
      <description>&lt;P&gt;I'm trying to send a command via the API, for example I want to activate the feature "oneTimeCharge".&lt;/P&gt;&lt;P&gt;I tried to send such POST request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://api.viessmann-platform.io/iot/v1/equipment/installations/My-Installatio_ID/gateways/My-Gateway_Serial/devices/0/features/heating.dhw.oneTimeCharge/commands/activate" target="_blank"&gt;https://api.viessmann-platform.io/iot/v1/equipment/installations/My-Installation_ID/gateways/My-Gateway_Serial/devices/0/features/heating.dhw.oneTimeCharge/commands/activate&lt;/A&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sending the above with a valid&amp;nbsp; Bearer Token does return:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"viErrorId":&amp;nbsp;"req-06063841ce214195b3fa08643a51cd60",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"statusCode":&amp;nbsp;422,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"errorType":&amp;nbsp;"VALIDATION_ERROR",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"message":&amp;nbsp;"VALIDATION_ERROR",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"validationErrors":&amp;nbsp;[&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"path":&amp;nbsp;[&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"commandBody"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"type":&amp;nbsp;"any.invalid",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"message":&amp;nbsp;"invalid&amp;nbsp;value,&amp;nbsp;most&amp;nbsp;likely&amp;nbsp;wrong&amp;nbsp;format"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"extendedPayload":&amp;nbsp;{&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"commandBody":&amp;nbsp;"EMPTY_MODEL"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;or with the header Content-Type="application/x-www-form-urlencoded"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"viErrorId":&amp;nbsp;"req-25befbaad52e473c921fe9a0e8439be7",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"statusCode":&amp;nbsp;500,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"errorType":&amp;nbsp;"INTERNAL_ERROR",&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"message":&amp;nbsp;"Internal&amp;nbsp;server&amp;nbsp;error"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is my mistake?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:13:55 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179232#M2</guid>
      <dc:creator>JueBag</dc:creator>
      <dc:date>2021-06-25T17:13:55Z</dc:date>
    </item>
    <item>
      <title>Betreff: HowTo send a command via the API ? Or what is the correct syntax?</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179272#M3</link>
      <description>&lt;P&gt;Did you use POST and "Content-Type: application/json"? In this case params&amp;nbsp; is "{}" of course.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2021 18:57:23 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179272#M3</guid>
      <dc:creator>andreas13</dc:creator>
      <dc:date>2021-06-26T18:57:23Z</dc:date>
    </item>
    <item>
      <title>Betreff: HowTo send a command via the API ? Or what is the correct syntax?</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179287#M4</link>
      <description>&lt;P&gt;Thanks for the answer.&lt;/P&gt;&lt;P&gt;I did use POST and tried it also with the header Content-Type&amp;nbsp;&lt;SPAN&gt;application/json.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So far I did not put in any PARAMS for the POST request, using just the url as posted above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The result is always as the above posted (first) error message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm using&amp;nbsp;&lt;A href="https://www.postman.com/" target="_self"&gt;POSTMAN&lt;/A&gt;&amp;nbsp; to test-send such messages.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jun 2021 09:22:02 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179287#M4</guid>
      <dc:creator>JueBag</dc:creator>
      <dc:date>2021-06-27T09:22:02Z</dc:date>
    </item>
    <item>
      <title>Betreff: HowTo send a command via the API ? Or what is the correct syntax?</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179345#M5</link>
      <description>&lt;P&gt;You need to send a json request payload with every command. This is also true for commands with "empty" parameters, so you need to send just an empty json object. Also, make sure to have the correct request payload mime type, i.e. the "&lt;EM&gt;Content-Type&lt;/EM&gt;" header has to be "&lt;EM&gt;application/json&lt;/EM&gt;". Postman sets this header automatically for you if you enter a request payload and select "&lt;EM&gt;raw&lt;/EM&gt;" and "&lt;EM&gt;json&lt;/EM&gt;" from the two dropdown boxes like shown in the attached screenshot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 06:54:44 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/179345#M5</guid>
      <dc:creator>phildaub23</dc:creator>
      <dc:date>2021-06-28T06:54:44Z</dc:date>
    </item>
    <item>
      <title>Betreff: HowTo send a command via the API ? Or what is the correct syntax?</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/180112#M29</link>
      <description>&lt;P&gt;The problem was solved by&amp;nbsp;&lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/13760"&gt;@phildaub23&lt;/a&gt;&amp;nbsp;while the Developer part of the forum was created!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used a.) a wrong URL (&lt;EM&gt;&lt;A href="https://api.viessmann-platform.io/iot/v1/equipment/installations/My-Installatio_ID/gateways/My-Gateway_Serial/devices/0/features/heating.dhw.oneTimeCharge/commands/activate" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.viessmann-platform.io...&lt;/A&gt;&lt;/EM&gt;instead of&amp;nbsp;&lt;EM&gt;&lt;A href="https://api.viessmann.com." target="_blank"&gt;https://api.viessmann.com.&lt;/A&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and b.) missed the empty body ("{}") part.&lt;/P&gt;&lt;P&gt;In JavaScript that looks like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;headers["Authorization"] = "Bearer "+ token;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var url ="&lt;A href="https://api.viessmann.com/iot/v1/equipment/installations/" target="_blank"&gt;https://api.viessmann.com/iot/v1/equipment/installations/&lt;/A&gt;"+ installationID +"/gateways/" +gatewaySerial + "/devices/0/features/heating.dhw.oneTimeCharge/commands/activate";&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;//logger.info("url: {}", url);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var returnvalue = HTTP.sendHttpPostRequest(url,"application/json", "{}",headers,2*1000);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 15:39:29 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/HowTo-send-a-command-via-the-API-Or-what-is-the-correct-syntax/m-p/180112#M29</guid>
      <dc:creator>JueBag</dc:creator>
      <dc:date>2021-07-05T15:39:29Z</dc:date>
    </item>
  </channel>
</rss>

