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: 
Anonymous
Not applicable

Connect to local Qlik Engine API using R

Hello all,

I'm trying to connect my local Qlik Sense using R in the R Studio environment. With the help of the Engine Explorer I created a JSON file which is then to be send to the Engine API and finally read back in in R Studio for further processing. This is the R code:

library(jsonlite)

Get_DocList <- function(){

  json <-

    '[

      {

      "handle": -1,

      "method": "GetDocList",

        "params": {}

      }

    ]'

  json <- fromJSON(json)

  return(json)

  #toJSON(json, pretty=TRUE)

}

con <- socketConnection(host="localhost", port = 4848, blocking=TRUE,server=FALSE, open="r+")

  stream_out(Get_DocList(), con)

  b <- stream_in(con)

 

  close(con)

When sending the JSON request I get a completion status message but when reading the data I get: " Imported 0 records. Simplifying..."

Can someone explain why I get no JSON-response?

Thanks in advance

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Which R package are you using for WebSockets. From your code it looks to me like you are using normal Sockets communication and not WebSockets. If you are it will not work. Qlik use WebSockets for communication.

View solution in original post

1 Reply
petter
Partner - Champion III
Partner - Champion III

Which R package are you using for WebSockets. From your code it looks to me like you are using normal Sockets communication and not WebSockets. If you are it will not work. Qlik use WebSockets for communication.