<?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: Use a REST json response field (token) as next REST call http header (authorization token) in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648347#M4665</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;For the part on your question to remove the token from your initial request. never done that before (i am the only Qlik developer in my company..) &lt;/FONT&gt;&lt;FONT&gt;&lt;STRONG&gt;&lt;FONT&gt;This is a hunch, but i think its worth a try.&lt;/FONT&gt;&lt;/STRONG&gt; perhaps you can remove it via the &lt;STRONG&gt;QMC&lt;/STRONG&gt; in the &lt;STRONG&gt;dataconnections&lt;/STRONG&gt;. &lt;/FONT&gt;&lt;FONT&gt;If you open your connection you can see and edit your &lt;STRONG&gt;Connection string&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To completly build your request&lt;/STRONG&gt; search the community or google with the&lt;STRONG&gt; "With Connection"&lt;/STRONG&gt; function, you can change everything from your request.&lt;/P&gt;&lt;P&gt;I only got this example in SOAP I use for you:&lt;/P&gt;&lt;P&gt;I first created my body and put it into a variable&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Set &lt;STRONG&gt;vRequestBody&lt;/STRONG&gt; = '&amp;lt;soapenv:Envelope xmlns:soapenv="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank" rel="noopener"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:emp="https://...../...."&amp;gt;&amp;lt;soapenv:Header&amp;gt;&amp;lt;emp:AuthHeader&amp;gt;&amp;lt;emp:Username&amp;gt;&lt;STRONG&gt;$(vUser)&lt;/STRONG&gt;&amp;lt;/emp:Username&amp;gt;&amp;lt;emp:Token&amp;gt;&lt;STRONG&gt;$(vToken)&lt;/STRONG&gt;&amp;lt;/emp:Token&amp;gt;&amp;lt;/emp:AuthHeader&amp;gt;&amp;lt;/soapenv:Header&amp;gt;&amp;lt;soapenv:Body&amp;gt;&amp;lt;emp:&lt;FONT&gt;GetList&lt;/FONT&gt;&amp;gt;&amp;lt;emp:EmployeeId&amp;gt;&lt;STRONG&gt;$(vEmployee)&lt;/STRONG&gt;&amp;lt;/emp:EmployeeId&amp;gt;&amp;lt;emp:Year&amp;gt;&lt;STRONG&gt;$(vYear)&lt;/STRONG&gt;&amp;lt;/emp:Year&amp;gt;&amp;lt;/emp:GetList&amp;gt;&amp;lt;/soapenv:Body&amp;gt;&amp;lt;/soapenv:Envelope&amp;gt;';&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;then i do the request like this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SQL &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SELECT&lt;BR /&gt;……………………...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;WITH CONNECTION (&lt;BR /&gt;BODY "&lt;STRONG&gt;$(vRequestBody)&lt;/STRONG&gt;"&lt;BR /&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Other topic which can help you on your Quest:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Sense-Integration/With-Connection-statement-What-are-all-the-parameters-possible/m-p/1237208#M6577" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Qlik-Sense-Integration/With-Connection-statement-What-are-all-the-parameters-possible/m-p/1237208#M6577&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Hope this will help you.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2019 09:00:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-19T09:00:35Z</dc:date>
    <item>
      <title>Use a REST json response field (token) as next REST call http header (authorization token)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1647888#M4658</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have been struggling trying to link several standard REST calls together (LIB CONNECT TO [xxx];).&lt;/P&gt;&lt;P&gt;Can we get a first call response (json field) as http header for a second one?&lt;/P&gt;&lt;P&gt;Call 1:&lt;/P&gt;&lt;P&gt;LIB CONNECT TO [Call1];&lt;/P&gt;&lt;P&gt;[root]:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"access_token"&lt;BR /&gt;FROM JSON (wrap on) "root" QDL;&lt;/P&gt;&lt;P&gt;Call 2:&lt;/P&gt;&lt;P&gt;LIB CONNECT TO [NextCAll];&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 14:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1647888#M4658</guid>
      <dc:creator>ngazelle</dc:creator>
      <dc:date>2021-12-21T14:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Use a REST json response field (token) as next REST call http header (authorization token)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648056#M4661</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;yes you can. understand that the first response also creates a datatable.&lt;/P&gt;&lt;P&gt;So in order to get the value of the first response, you have to PEEK the value from the datatable.&lt;/P&gt;&lt;P&gt;After that you take this peeked value which you put in a variable, and send it in the next request.&lt;/P&gt;&lt;P&gt;I do the following in my own app:&lt;/P&gt;&lt;DIV&gt;&lt;FONT&gt;LIB CONNECT TO 'Json EndPoint';&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;&amp;nbsp;"sid"&lt;BR /&gt;FROM XML "response";&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;[response]:&lt;BR /&gt;LOAD&amp;nbsp;[sid] AS [sid]&lt;BR /&gt;RESIDENT RestConnectorMasterTable;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;//read the response:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;Let &lt;STRONG&gt;vSomething&lt;/STRONG&gt; = &lt;STRONG&gt;peek('sid',0,'RestConnectorMasterTable');&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;DROP TABLE RestConnectorMasterTable;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;LIB CONNECT TO 'EndPoint2';&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;&amp;nbsp;"__KEY_results",&lt;BR /&gt;&amp;nbsp;(SELECT&lt;BR /&gt;&amp;nbsp;FROM "meta"),&lt;BR /&gt;&amp;nbsp;(SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;(SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"attr:k" AS "k",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"__KEY_field",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"__FK_field_u0",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"text",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"__FK_value"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM "value" FK "__FK_value")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;FROM "field" PK "__KEY_field" FK "__FK_field_u0")&lt;BR /&gt;&amp;nbsp;FROM "result" PK "__KEY_result" FK "__FK_result")&lt;BR /&gt;FROM XML "results" PK "__KEY_results"&lt;BR /&gt;WITH CONNECTION(&lt;BR /&gt;Url "https://........:....../services/search/jobs/&lt;STRONG&gt;$(&lt;FONT&gt;&lt;STRONG&gt;vSomething&lt;/STRONG&gt; &lt;/FONT&gt;)&lt;/STRONG&gt;/results"&lt;BR /&gt;)&lt;BR /&gt;;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Nov 2019 15:34:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648056#M4661</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-18T15:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Use a REST json response field (token) as next REST call http header (authorization token)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648295#M4664</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The parameter I need to re-use is the query header "Authorization" "Bearer xxx".&lt;/P&gt;&lt;P&gt;But I am not able to remove my token from the REST editor for this call; if I remove it, I get an authentication error and cannot click on save because QLIK tests the connection before saving it.&lt;/P&gt;&lt;P&gt;I was expecting I could remove it from the editor so that the token is exclusively taken from the previous call.&lt;/P&gt;&lt;P&gt;I do not want to share my token when I share the QLIK project...&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 07:43:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648295#M4664</guid>
      <dc:creator>ngazelle</dc:creator>
      <dc:date>2019-11-19T07:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Use a REST json response field (token) as next REST call http header (authorization token)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648347#M4665</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;For the part on your question to remove the token from your initial request. never done that before (i am the only Qlik developer in my company..) &lt;/FONT&gt;&lt;FONT&gt;&lt;STRONG&gt;&lt;FONT&gt;This is a hunch, but i think its worth a try.&lt;/FONT&gt;&lt;/STRONG&gt; perhaps you can remove it via the &lt;STRONG&gt;QMC&lt;/STRONG&gt; in the &lt;STRONG&gt;dataconnections&lt;/STRONG&gt;. &lt;/FONT&gt;&lt;FONT&gt;If you open your connection you can see and edit your &lt;STRONG&gt;Connection string&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To completly build your request&lt;/STRONG&gt; search the community or google with the&lt;STRONG&gt; "With Connection"&lt;/STRONG&gt; function, you can change everything from your request.&lt;/P&gt;&lt;P&gt;I only got this example in SOAP I use for you:&lt;/P&gt;&lt;P&gt;I first created my body and put it into a variable&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Set &lt;STRONG&gt;vRequestBody&lt;/STRONG&gt; = '&amp;lt;soapenv:Envelope xmlns:soapenv="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank" rel="noopener"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:emp="https://...../...."&amp;gt;&amp;lt;soapenv:Header&amp;gt;&amp;lt;emp:AuthHeader&amp;gt;&amp;lt;emp:Username&amp;gt;&lt;STRONG&gt;$(vUser)&lt;/STRONG&gt;&amp;lt;/emp:Username&amp;gt;&amp;lt;emp:Token&amp;gt;&lt;STRONG&gt;$(vToken)&lt;/STRONG&gt;&amp;lt;/emp:Token&amp;gt;&amp;lt;/emp:AuthHeader&amp;gt;&amp;lt;/soapenv:Header&amp;gt;&amp;lt;soapenv:Body&amp;gt;&amp;lt;emp:&lt;FONT&gt;GetList&lt;/FONT&gt;&amp;gt;&amp;lt;emp:EmployeeId&amp;gt;&lt;STRONG&gt;$(vEmployee)&lt;/STRONG&gt;&amp;lt;/emp:EmployeeId&amp;gt;&amp;lt;emp:Year&amp;gt;&lt;STRONG&gt;$(vYear)&lt;/STRONG&gt;&amp;lt;/emp:Year&amp;gt;&amp;lt;/emp:GetList&amp;gt;&amp;lt;/soapenv:Body&amp;gt;&amp;lt;/soapenv:Envelope&amp;gt;';&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;then i do the request like this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SQL &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;SELECT&lt;BR /&gt;……………………...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;WITH CONNECTION (&lt;BR /&gt;BODY "&lt;STRONG&gt;$(vRequestBody)&lt;/STRONG&gt;"&lt;BR /&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Other topic which can help you on your Quest:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Sense-Integration/With-Connection-statement-What-are-all-the-parameters-possible/m-p/1237208#M6577" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Qlik-Sense-Integration/With-Connection-statement-What-are-all-the-parameters-possible/m-p/1237208#M6577&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Hope this will help you.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 09:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648347#M4665</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-19T09:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Use a REST json response field (token) as next REST call http header (authorization token)</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648359#M4666</link>
      <description>&lt;P&gt;Thanks for the feedback.&lt;/P&gt;&lt;P&gt;But unless there i a way to save a REST connection from the editor without "Test connection" being a blocker, not much we can do.&lt;/P&gt;&lt;P&gt;I have the same issue with the our login call (credentials are pushed as body). If I do not put the body in th call editor, the test connection fails and I cannot save the call with the editor...&lt;/P&gt;&lt;P&gt;"WITH CONNECTION" seems to be working only for optional parameters.&lt;/P&gt;&lt;P&gt;I tried setting a CUSTOM CONNECT with no luck. It seems nobody is able to make it work, in the Net. I always get "Obsolete" error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CUSTOM CONNECT TO [Provider=QvRestConnector.exe;&lt;BR /&gt;timeout=30;&lt;BR /&gt;method=POST;&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;let vBody = '"{""login"":""Me"",""password"":""Blabla""}"';&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"access_token"&lt;BR /&gt;FROM JSON (wrap on) "root" QDL&lt;BR /&gt;WITH CONNECTION (&lt;BR /&gt;Url "https://xxx/api/auth/login-credentials",&lt;BR /&gt;BODY $(vBody),&lt;BR /&gt;HTTPHEADER "Content-Type" "application/json"&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 09:36:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Use-a-REST-json-response-field-token-as-next-REST-call-http/m-p/1648359#M4666</guid>
      <dc:creator>ngazelle</dc:creator>
      <dc:date>2019-11-19T09:36:46Z</dc:date>
    </item>
  </channel>
</rss>

