Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
echildm
Contributor II
Contributor II

Rest connection "With connection" function

Hello everybody,

Im using rest connector to extract monetary indicators from central banks, i wanted to use one connector to extract diferent series but i get an error that I have not been able to fix, the code is the following:

LIB CONNECT TO 'BancoCentralMéxicoDólar';
 
// token: d78e714795304daab6fbf34d4170fcecc1c5d6cc514182fde6a41d11db35b9d9
 
 
RestConnectorMasterTableDolarMexico:
SQL SELECT 
"__KEY__response_header",
(SELECT 
"__FK_bmx",
"__KEY_bmx",
(SELECT 
"__FK_series",
"__KEY_series",
(SELECT 
"fecha",
"dato",
"__FK_datos"
FROM "datos" FK "__FK_datos")
FROM "series" PK "__KEY_series" FK "__FK_series")
FROM (wrap off) "bmx" PK "__KEY_bmx" FK "__FK_bmx")
FROM JSON "_response_header" PK "__KEY__response_header";
 
 
RestConnectorMasterTableIpcMexico:
SQL SELECT 
"__KEY_bmx",
(SELECT 
"__FK_series",
"__KEY_series",
(SELECT 
"fecha",
"dato",
"__FK_datos"
FROM "datos" FK "__FK_datos")
FROM "series" PK "__KEY_series" FK "__FK_series")
FROM JSON (wrap off) "bmx" PK "__KEY_bmx"
WITH CONNECTION (     
                                                                               URL "$(vURL)",
                                                                               QUERY "token" "d78e714795304daab6fbf34d4170fcecc1c5d6cc514182fde6a41d11db35b9d9",
                                                                               QUERY "formato" "JSON"
);
 
This is the error message:

The following error occurred:
(Connector error: HTTP protocol error 400 (Bad Request):

You typed an invalid character in one of the fields on the form. Please return to the previous screen and try the operation again.)
The error occurred here:

RestConnectorMasterTableIpcMexico:
SQL SELECT 
"__KEY_bmx",
(SELECT 
"__FK_series",
"__KEY_series",
(SELECT 
"fecha",
"dato",
"__FK_datos"
FROM "datos" FK "__FK_datos")
FROM "series" PK "__KEY_series" FK "__FK_series")
FROM JSON (wrap off) "bmx" PK "__KEY_bmx"
WITH CONNECTION (     
                                                                               URL "$(vURL)",
                                                                               QUERY "token" "d78e714795304daab6fbf34d4170fcecc1c5d6cc514182fde6a41d11db35b9d9",
                                                                               QUERY "formato" "JSON"
 
If I try this with two different connections changing the URL's values  and in this way it works correctly, but when i use the "with connection" function the error occurs ¿Any idea how to fix this?
Thanks in advance.
Labels (1)
2 Replies
Chirantha
Support
Support

Hey,

Please try removing the space character at the beginning of the ''vURL'' variable and see if it helps:

Let vURL = 'https://www.banxico.org.mx/SieAPIRest/service/v1/series/SP30577/datos/';
 

echildm
Contributor II
Contributor II
Author

I tried and still get the same error.

ps: thx for the try.