Rest connector: With connection + Authentication scheme
I've a question about the with connection statement. I want the connection variable, so I have to use the with connection statement. In my rest connection I use the authentication scheme basic with an username and password. I need to know how to write this scheme in the with connection!?!?
I loaded the normal rest conn table and instead of the conn string I used a dummy conn. In addition I add (FROM JSON (wrap on) "root" PK "__KEY_root") to the FROM Clause. Thereafter the with connection statement. Here is an example of what I reached so far:
LIB CONNECT TO 'Dummyconnection';
RestConnectorMasterTable: SQL SELECT "__KEY_reportAssessments_v2_0s", (SELECT "ALL_FIELDS", "__FK_ReportAssessment_v2_0" FROM "ReportAssessment_v2_0" FK "__FK_ReportAssessment_v2_0") FROM XML "reportAssessments_v2_0s" PK "__KEY_reportAssessments_v2_0s" FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION( Url "$(URL)", HTTPHEADER "Authorization: Basic $(username):$(password)" );
Please let my know what I have to change, because it's not working now. Qlik support told me I could possible use this: Authorization: Basic <credentials>, where credentials is the base64 encoding of id and password joined by a single colon :.
Re: Rest connector: With connection + Authentication scheme
What I had to use is different, but I had double quote around "Authorization" and double quote around the entire value of it. Maybe try to assign the whole value part of it to a variable and use it that way and see if it helps: