Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jochem_zw
Partner Ambassador
Partner Ambassador

REST Connector - Http Status Codes in Variable

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

4 Replies
Bjorn_Wedbratt
Former Employee
Former Employee

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

jochem_zw
Partner Ambassador
Partner Ambassador
Author

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).

celindho
Partner - Creator
Partner - Creator

Did you manage to solve this?
Josh-Head-of-BI-HGreg
Contributor II
Contributor II

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