Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to get the HTTP Status code from a API request with the Qlik REST Connector?
I want to have the status 200, 204 or 206 from my API Datasource, as long as I got a 206 (Partial) there is more data available, so I have to page.
BR Jochem
Hi Jochem,
I'm using ScriptErrorDetails in my script and searches for '404' to stop loading. You should be able to do something similar.
SET ErrorMode = 0;
Do
SQL SELECT
<something>
FROM <something>;
Let vContinueLoad = SubStringCount('$(ScriptErrorDetails)','206');
exit do when vContinueLoad <> 1;
Something like that might do the trick
I like to use it in the 'WITH CONNECTION' part of the script
I already tried the errormode, but there is no error coming from the 'WITH CONNECTION'
So ScriptErrorDetails stays <NULL>
When I get a 206 means there is more data available from the REST API so I would like to take the next 100 (page_size).
My script was exiting without saving when HTTP Error 416 was returned, and that is when I know the system is making a call beyond last page. So I just did
SET ErrorMode = 0;
Before loading part and I just ignore the errors.
Not sure what's the proper way of telling:
IF HTTP Error = 416 THEN STOP