Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
elaineng
Contributor III
Contributor III

Qlik - Load data from GraphQL API with REST data connector

Hi There,

I am using Qlik Sense Enterprise Aug 2022 version on prem 
Qliksense server: 14.78.5

I would like to load data from GraphQL API with REST data connector.

I test using graphQL from this site: https://swop.cx/

This are my settings:

URL: https://swop.cx/graphql
Method: Post

Request Body: 
query {
latest {
baseCurrency
quoteCurrency
quote
}
}

Query headers:

Name: Authorization
Value: ApiKey <xxxxx>

I've created the connection successfully.

elaineng_0-1670408546955.png

 

However, when I try to preview the Metadata. It show that Malformed message body: Invalid JSON

elaineng_1-1670408613047.png

I wonder Qlik support nested JSON format.

 

 

 

Labels (2)
5 Replies
Jay_Brown
Support
Support

Hello @elaineng , some developers have had success doing this so hopefully they can offer some guidance.

One thing I have seen suggested is normalizing the data as discussed here:
https://community.qlik.com/t5/Connectivity-Data-Prep/How-to-convert-nested-JSON-output-into-a-single...

I've also seen workarounds such as importing the JSON data into another database that supports nested JSON and then using Qlik to retrieve the data from that.


Hope that helps!

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
elaineng
Contributor III
Contributor III
Author

Thanks @Jay_Brown, in order for me to convert nest JSON to single, the information have to be loaded into fields, however, currently the load data I get is error.

salonibhatia
Contributor III
Contributor III

Hi @elaineng,

You can add additional query headers as below:

Name: content-type

Value: application/json 

 Then while extracting the data, click on the drop-down and select the relevant table records and not everything. In the above screenshot, you have selected the main root; unselect it and select the records of the table only.

Am also trying to create a Rest API connection for Graph QL at the moment, have been able to connect and fetch records of a particular table. However, looking to make it dynamic. Have you been able to create one connection and fetch data from different tables using with connector?

 

Thanks!

Sivanesan
Partner - Contributor III
Partner - Contributor III

Hi @elaineng 

Were you able to make this work. I am also having the same issue.

Sivanesan
Partner - Contributor III
Partner - Contributor III

Hi @salonibhatia

Thanks for your input. I tried adding the content type but still I am having the same issue.