<?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: How do I pass query parameters (Credentials) in Body of a tRest component in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212058#M9833</link>
    <description>&lt;P&gt;In the end the solution turned out to be so (annoyingly) simple!&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tRest.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MZqx.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156522i2D6009773B2B9D5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MZqx.jpg" alt="0683p000009MZqx.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I just had to change the Content Type Dropdown from JSON to FORM&lt;/P&gt;</description>
    <pubDate>Sat, 06 Jun 2020 08:42:51 GMT</pubDate>
    <dc:creator>Davew1</dc:creator>
    <dc:date>2020-06-06T08:42:51Z</dc:date>
    <item>
      <title>How do I pass query parameters (Credentials) in Body of a tRest component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212055#M9830</link>
      <description>&lt;P&gt;I'm connecting to a rest API. The API provider previously accepted Login Requests to return an API key by passing the credentials as a query string in the URL.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;e.g.&amp;nbsp;POST &lt;A href="http://pi.XXXXX.com/api/login/version/4%20HTTP/1.1?format=JSON&amp;amp;email=XXXXX&amp;amp;user_key=XXXXX&amp;amp;password=XXXXXX" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;http://pi.XXXXX.com/api/login/version/4%20HTTP/1.1?format=JSON&amp;amp;email=XXXXX&amp;amp;user_key=XXXXX&amp;amp;password=XXXXXX&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This was working fine for me by using&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="query_string.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8m7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146989i5E64F3CA740E4588/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8m7.png" alt="0683p000009M8m7.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;However, the API provider has now deprecated this method and requires the credentials to be passed in the body, e.g. this is the API Spec.&lt;/P&gt; 
&lt;P&gt;Sample POST Request&lt;/P&gt; 
&lt;PRE&gt;POST https://pi.pardot.com/api/login/version/3 HTTP/1.1

email=&amp;lt;email&amp;gt;&amp;amp;password=&amp;lt;password&amp;gt;&amp;amp;user_key=&amp;lt;user_key&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;Request Parameters&lt;/P&gt; 
&lt;P&gt;Parameter Required Description&lt;/P&gt; 
&lt;TABLE&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;email&lt;/TD&gt; 
   &lt;TD&gt;X&lt;/TD&gt; 
   &lt;TD&gt;The email address of your user account&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;password&lt;/TD&gt; 
   &lt;TD&gt;X&lt;/TD&gt; 
   &lt;TD&gt;The password of your user account&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;user_key&lt;/TD&gt; 
   &lt;TD&gt;X&lt;/TD&gt; 
   &lt;TD&gt;The 32-character hexadecimal user key for your user account&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;If authentication was successful, a 32-character hexadecimal API key will be returned in the following format:&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;rsp stat="ok" version="1.0"&amp;gt;
    &amp;lt;api_key&amp;gt;5a1698a233e73d7c8ccd60d775fbc68a&amp;lt;/api_key&amp;gt;
&amp;lt;/rsp&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;Otherwise, the response will contain the following:&lt;/P&gt; 
&lt;PRE&gt;&amp;lt;rsp stat="fail" version="1.0"&amp;gt;
    &amp;lt;err code="15"&amp;gt;Login failed&amp;lt;/err&amp;gt;
&amp;lt;/rsp&amp;gt;&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;I'm unable to get this to work. My revised job is as below. I'm using a tFixedFlow input to pass the credentials via a tMap into the string field of the tRest (I will used context variables to hold the relevant credentials in due course). However, I can seem to get this to work, what am I doing wrong? I know my credentials are good as I can get them to work via SOAP UI. I'm assuming I have something wrong with the syntax of the string I'm passing through. Of course because it's a logon and for security reasons the response from the API doesn't provide much clue as to what the problem is.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="new_job.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8xj.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153583iC03EB3D685221EF4/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8xj.png" alt="0683p000009M8xj.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tmap.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8kL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154685iB20B54509035C498/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8kL.png" alt="0683p000009M8kL.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="trest.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M981.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142707iA47C15FB3FBB2D13/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M981.png" alt="0683p000009M981.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M986.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156443i0A25FE7EE0BE8425/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M986.png" alt="0683p000009M986.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 19:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212055#M9830</guid>
      <dc:creator>Davew1</dc:creator>
      <dc:date>2020-02-23T19:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass query parameters (Credentials) in Body of a tRest component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212056#M9831</link>
      <description>NB. The full API spec is here: &lt;A href="http://developer.pardot.com/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://developer.pardot.com/&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 23 Feb 2020 19:23:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212056#M9831</guid>
      <dc:creator>Davew1</dc:creator>
      <dc:date>2020-02-23T19:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass query parameters (Credentials) in Body of a tRest component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212057#M9832</link>
      <description>&lt;P&gt;I ended up using the tFileFetch to make the connection.&amp;nbsp; The response was saved to a cache which I parsed to get the api key.&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009MamO"&gt;Pardot Authenticate.PNG&lt;/A&gt;</description>
      <pubDate>Sat, 23 May 2020 10:22:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212057#M9832</guid>
      <dc:creator>ken7</dc:creator>
      <dc:date>2020-05-23T10:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass query parameters (Credentials) in Body of a tRest component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212058#M9833</link>
      <description>&lt;P&gt;In the end the solution turned out to be so (annoyingly) simple!&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tRest.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MZqx.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156522i2D6009773B2B9D5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MZqx.jpg" alt="0683p000009MZqx.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I just had to change the Content Type Dropdown from JSON to FORM&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 08:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212058#M9833</guid>
      <dc:creator>Davew1</dc:creator>
      <dc:date>2020-06-06T08:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass query parameters (Credentials) in Body of a tRest component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212059#M9834</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am facing a similar problem (at least I think so), with a banking API that I call to get some customer information. The whole API works with OAuth 2.0.&lt;/P&gt;&lt;P&gt;The process is as follows: first I call an authorization URL of the API (GET request with my Client_ID, Redirect URI and response_type = "code"), I then get redirected to a login page, where the user (whose info I want) has to enter his/her credentials (Branch, account id, subaccount id, pin). Once this is done, the user grants me access to its data and I get the token. My problem is that I dont know how to handle the step after the GET request. The response I get from calling the authorization URL is HTML, but I have no idea how to parse the user credentials into it. Itried another tRestClient, that takes in the response of the first tRestClient (which is a redirect to the user login site) and makes a POST call the user credentials (see screenshot). However, I am getting a 403 in the 2. tRestClient. Do you have any idea how to work with the response of the first tRestClient? Can I save it somehow? Any held would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000DsuiJAAR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157978iF35CFF1FD3B6A8A3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000DsuiJAAR.png" alt="0695b00000DsuiJAAR.png" /&gt;&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Sun, 21 Mar 2021 17:52:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-I-pass-query-parameters-Credentials-in-Body-of-a-tRest/m-p/2212059#M9834</guid>
      <dc:creator>Mopi</dc:creator>
      <dc:date>2021-03-21T17:52:48Z</dc:date>
    </item>
  </channel>
</rss>

