<?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 Qlik AutoML: How to test API realtime-predictions from Postman? in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-test-API-realtime-predictions-from-Postman/ta-p/1992894</link>
    <description>&lt;P&gt;In this article, I will outline the steps to POST an API call to realtime-predictions and return a response. The main purpose of the API is to send records to predict against an already deployed model in Qlik AutoML.&lt;/P&gt;
&lt;P&gt;This is an example with the &lt;A href="https://gist.github.com/netj/8836201" target="_blank" rel="noopener"&gt;iris.csv dataset&lt;/A&gt; used commonly in data science examples. Variety is the target variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Steps&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;OL&gt;
&lt;LI&gt;Upload, train and deploy model for iris.csv.&amp;nbsp; See&lt;A href="https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-upload-model-deploy-and-predict-on-Qlik-Cloud/ta-p/1960164" target="_blank" rel="noopener"&gt; this article&lt;/A&gt; for steps on how to deploy a model.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;XGBoost Classification was the champion model which I choose to deploy.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deployedmodel.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91361i26521282E0CB00E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="deployedmodel.png" alt="deployedmodel.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-generate-API-Keys/ta-p/1964795" target="_blank" rel="noopener"&gt;Generate an API key&lt;/A&gt;&lt;SPAN&gt;. Copy this information for later steps.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Open the Deployed model and navigate to the Real-time predictions tab&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deployemodel_realtimepreds.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91362i48BB69DDA93D971D/image-size/large?v=v2&amp;amp;px=999" role="button" title="deployemodel_realtimepreds.png" alt="deployemodel_realtimepreds.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Copy the Realtime-predictions URL to a safe place&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="copyurl_3.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91363i24C91BA23F90D7D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="copyurl_3.png" alt="copyurl_3.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Open a new Postman collection and set as a POST request&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman1.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91364iB7C017EC4692D718/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman1.png" alt="postman1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;In the request URL, enter the realtime-predictions URL from step #3&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman2.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91365iC8E1F0E0E26E1D8D/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman2.png" alt="postman2.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Under the Headers Tab, add your API key as an 'Authorization' key with the format "Bearer valuefromstep#2"&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman3.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91367iC7303BF0ACE0C0F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman3.png" alt="postman3.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Under the Body section enter the following JSON&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{"rows":[ [5.4,3.1,1.7,0.5], [4.4,3.4,1.2,0.4]],&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"schema": [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "sepal.length"},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "sepal.width"},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "petal.length"},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "petal.width"}]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Where rows represent new records you would like to score the deployed model against and get a predicted variety back from.&lt;/P&gt;
&lt;P&gt;Schema represents the 4 features used to train the model.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Click Send in the Postman application&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman4.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91368i21F581154084626E/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman4.png" alt="postman4.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;This will return a JSON payload with the predicted values&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman5.png" style="width: 861px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91369iBFC4C8C84BCE7EED/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman5.png" alt="postman5.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Note, if you would like the return to be sent back as a csv (easier readability), then add the following Header -&amp;gt; Accept : text/csv&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman6.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91370iE5BFD0CDAE15561D/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman6.png" alt="postman6.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Then you can see the variety Predicted in addition to the predicted probabilities of the other types.&lt;BR /&gt;&lt;BR /&gt;
&lt;H4&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman7.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91371i979B090378B2F30C/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman7.png" alt="postman7.png" /&gt;&lt;/span&gt;&lt;/H4&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Conclusion&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;In this article, we are generating predictions on a small number of records and this is meant to serve as an example on how to interact with the API.&lt;/P&gt;
&lt;P&gt;This is based on the &lt;A href="https://qlik.dev/apis/rest/automl-real-time-predictions#%23%2Fentries%2Fv1%2Fautoml-deployments%2F-deploymentId%2Frealtime-predictions-post" target="_blank" rel="noopener"&gt;API developers documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Coming soon....&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;We will &lt;A href="https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-generate-predictions-via-API-realtime/ta-p/1995683" target="_blank" rel="noopener"&gt;document similar steps using Python instead&lt;/A&gt; of Postman and link to this article.&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;LI-PRODUCT title="Qlik AutoML" id="qlikAutoML"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-style: italic;"&gt;The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2022 09:25:48 GMT</pubDate>
    <dc:creator>KellyHobson</dc:creator>
    <dc:date>2022-10-24T09:25:48Z</dc:date>
    <item>
      <title>Qlik AutoML: How to test API realtime-predictions from Postman?</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-test-API-realtime-predictions-from-Postman/ta-p/1992894</link>
      <description>&lt;P&gt;In this article, I will outline the steps to POST an API call to realtime-predictions and return a response. The main purpose of the API is to send records to predict against an already deployed model in Qlik AutoML.&lt;/P&gt;
&lt;P&gt;This is an example with the &lt;A href="https://gist.github.com/netj/8836201" target="_blank" rel="noopener"&gt;iris.csv dataset&lt;/A&gt; used commonly in data science examples. Variety is the target variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Steps&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;OL&gt;
&lt;LI&gt;Upload, train and deploy model for iris.csv.&amp;nbsp; See&lt;A href="https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-upload-model-deploy-and-predict-on-Qlik-Cloud/ta-p/1960164" target="_blank" rel="noopener"&gt; this article&lt;/A&gt; for steps on how to deploy a model.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;XGBoost Classification was the champion model which I choose to deploy.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deployedmodel.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91361i26521282E0CB00E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="deployedmodel.png" alt="deployedmodel.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-generate-API-Keys/ta-p/1964795" target="_blank" rel="noopener"&gt;Generate an API key&lt;/A&gt;&lt;SPAN&gt;. Copy this information for later steps.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Open the Deployed model and navigate to the Real-time predictions tab&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deployemodel_realtimepreds.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91362i48BB69DDA93D971D/image-size/large?v=v2&amp;amp;px=999" role="button" title="deployemodel_realtimepreds.png" alt="deployemodel_realtimepreds.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Copy the Realtime-predictions URL to a safe place&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="copyurl_3.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91363i24C91BA23F90D7D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="copyurl_3.png" alt="copyurl_3.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Open a new Postman collection and set as a POST request&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman1.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91364iB7C017EC4692D718/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman1.png" alt="postman1.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;In the request URL, enter the realtime-predictions URL from step #3&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman2.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91365iC8E1F0E0E26E1D8D/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman2.png" alt="postman2.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Under the Headers Tab, add your API key as an 'Authorization' key with the format "Bearer valuefromstep#2"&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman3.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91367iC7303BF0ACE0C0F3/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman3.png" alt="postman3.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Under the Body section enter the following JSON&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{"rows":[ [5.4,3.1,1.7,0.5], [4.4,3.4,1.2,0.4]],&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"schema": [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "sepal.length"},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "sepal.width"},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "petal.length"},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{"name": "petal.width"}]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Where rows represent new records you would like to score the deployed model against and get a predicted variety back from.&lt;/P&gt;
&lt;P&gt;Schema represents the 4 features used to train the model.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Click Send in the Postman application&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman4.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91368i21F581154084626E/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman4.png" alt="postman4.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;This will return a JSON payload with the predicted values&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman5.png" style="width: 861px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91369iBFC4C8C84BCE7EED/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman5.png" alt="postman5.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Note, if you would like the return to be sent back as a csv (easier readability), then add the following Header -&amp;gt; Accept : text/csv&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman6.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91370iE5BFD0CDAE15561D/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman6.png" alt="postman6.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Then you can see the variety Predicted in addition to the predicted probabilities of the other types.&lt;BR /&gt;&lt;BR /&gt;
&lt;H4&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman7.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91371i979B090378B2F30C/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman7.png" alt="postman7.png" /&gt;&lt;/span&gt;&lt;/H4&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Conclusion&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;In this article, we are generating predictions on a small number of records and this is meant to serve as an example on how to interact with the API.&lt;/P&gt;
&lt;P&gt;This is based on the &lt;A href="https://qlik.dev/apis/rest/automl-real-time-predictions#%23%2Fentries%2Fv1%2Fautoml-deployments%2F-deploymentId%2Frealtime-predictions-post" target="_blank" rel="noopener"&gt;API developers documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Coming soon....&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;We will &lt;A href="https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-generate-predictions-via-API-realtime/ta-p/1995683" target="_blank" rel="noopener"&gt;document similar steps using Python instead&lt;/A&gt; of Postman and link to this article.&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;LI-PRODUCT title="Qlik AutoML" id="qlikAutoML"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-style: italic;"&gt;The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 09:25:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-AutoML-How-to-test-API-realtime-predictions-from-Postman/ta-p/1992894</guid>
      <dc:creator>KellyHobson</dc:creator>
      <dc:date>2022-10-24T09:25:48Z</dc:date>
    </item>
  </channel>
</rss>

