Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Venkadesh_Ponnu
Partner - Contributor III
Partner - Contributor III

How to access the data of Qlik dataset with Qlik api?

Hi,
when I am using qlik api to extract data of datasets as per Data sets | Qlik Developer Portal
I am getting error "404 Not Found" in Web and Postman application

Syntax as per Qlik api:
"https://your-tenant.us.qlikcloud.com/api/v1/data-sets/{data-set-id}"

Below are the scenarios and their results.

Trail 1: https://polestarllp-in.ap.qlikcloud.com/api/v1/dataset/6317438d0bbe036e62fc4de9
Response: "404 Not Found"
Trail 2: https://polestarllp-in.ap.qlikcloud.com/dataset/6317438d0bbe036e62fc4de9
Response: HTML output of that dataset page
Trail 3: https://polestarllp-in.ap.qlikcloud.com/v1/dataset/6317438d0bbe036e62fc4de9
Response: Opening Qlik but blank
Trail 4: https://polestarllp-in.ap.qlikcloud.com/data-sets/6317438d0bbe036e62fc4de9
Response: Opening Qlik but blank
Trail 5: https://polestarllp-in.ap.qlikcloud.com/api/v1/data-sets/6317438d0bbe036e62fc4de9
Response: "Exception.resourceNotFound"

My requirement is to access the data of that Dataset with Qlik API this is required for me to do automation workflow. How to access the data of Qlik dataset with Qlik api?


Labels (1)
1 Solution

Accepted Solutions
NadiaB
Support
Support

Hi @Venkadesh_Ponnu 

The id from the URL is the item id, you will need to get the details for that item using that id:

GET /v1/items/{itemId}

 

Once you get the item it will have the resourceid, and that is the one that can be used with 

GET/v1/data-sets/{data-set-id}

Kind Regards!!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm

View solution in original post

11 Replies
NadiaB
Support
Support

Hi @Venkadesh_Ponnu

 

If you place the URL directly in your browser (after you are authenticated in Qlik Cloud" what is the error you get ? I usually use Firefox for Get API methods, it should give you a more detailed error.

 

https://<yourtenant>/api/v1/data-sets/<data set id>

 

Kind Regards, 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Venkadesh_Ponnu
Partner - Contributor III
Partner - Contributor III
Author

Please find the error below when I am using https://polestarllp-in.ap.qlikcloud.com/api/v1/data-sets/6317438d0bbe036e62fc4de9
Error:

0  
status "404"
code "Exception.resourceNotFound"
title "Resource Not Found"
detail "No record of data set could be found with id 6317438d0bbe036e62fc4de9."
traceId "0000000000000000a82aa6f083fb7327"

ScreenShot:

Venkadesh_Ponnu_0-1663002050461.png

Please find screenshot when I used https://polestarllp-in.ap.qlikcloud.com/dataset/6317438d0bbe036e62fc4de9

Venkadesh_Ponnu_1-1663002228864.png

Please let me know for more information.

NadiaB
Support
Support

Hi @Venkadesh_Ponnu 

The id from the URL is the item id, you will need to get the details for that item using that id:

GET /v1/items/{itemId}

 

Once you get the item it will have the resourceid, and that is the one that can be used with 

GET/v1/data-sets/{data-set-id}

Kind Regards!!

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Chokiha
Contributor
Contributor

Once a connection to a REST data source has been established, you can select data and load it into a Qlik Sense or QlikView app. You select data by selecting REST tables and fields in the data selection dialog. You can load data using either Add data or the Data load editor.

Venkadesh_Ponnu
Partner - Contributor III
Partner - Contributor III
Author

Hi @Chokiha ,Hi @NadiaB 
I am getting below schema information rather than data present in the dataset. Could you please help me here?
URL used: https://tenant-in.ap.qlikcloud.com/api/v1/Data-sets/{{Item id}}
"schema": {
"dataFields": [
{
"name": "automl_row_index",
"alias": "automl_row_index",
"index": 0,
"dataType": {
"type": "INTEGER",
"properties": {
"qType": "U",
"qnDec": 0,
"qUseThou": 0
}
},
"tags": [
"$integer",
"$numeric"
],
"sensitive": false,
"primaryKey": false,
"encrypted": false,
"orphan": false,
"nullable": false
},
{
"name": "Impact_predicted",
"alias": "Impact_predicted",
"index": 1,
"dataType": {
"type": "STRING",
"properties": {
..........................................................................
...........................................................................

"name": "Impact_High",
"alias": "Impact_High",
"index": 2,
"dataType": {
"type": "DOUBLE",
"properties": {
"qType": "U",
"qnDec": 0,
"qUseThou": 0
}
},
"
"loadOptions": {},
"effectiveDate": "2022-09-06T12:56:48.340Z"


NadiaB
Support
Support

Hi @Venkadesh_Ponnu 

Did you call GET /v1/items/{itemId} first ?
Could you share that output ? 

That is the one that will give you the "resourceid" that is the one you use in the data-sets endpoint, I tested it yesterday and works fine. 

Could you share the result of the following ? (the ItemID is the one you copied from the URL when accessing to your dataset ) 

https://<yourtenant>/api/v1/items/<itemid>

Thank you !

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Venkadesh_Ponnu
Partner - Contributor III
Partner - Contributor III
Author

Hi @NadiaB ,
Yes, I received the resource id with the help of your information, with resource id I received the above-mentioned results it looks like metadata information. 
Require help to access the data.

URL 1:https://polestarllp-in.ap.qlikcloud.com/api/v1/items/{{Item id}} - gave me resource id
URL 2 : https://polestarllp-in.ap.qlikcloud.com/api/v1/Data-sets/{{resource id}} - gave me metadata information

@Chokiha 

URL 2 results:

{
    "id""ABC",
    "name""Iteration 4 Motor Vehicle Collision Prediction.csv",
    "description""",
    "tenantId""XYZ",
    "spaceId""ABC",
    "ownerId""ABC",
    "createdTime""2022-09-06T12:56:44.932Z",
    "createdBy""ABC",
    "lastModifiedTime""2022-09-14T07:44:47.546Z",
    "lastModifiedBy""ACBC",
    "version"7,
    "technicalDescription""",
    "technicalName""Iteration 4 Motor Vehicle Collision Prediction.csv",
    "dataAssetInfo": {
        "id""ABC",
        "name""Qlik Active Intelligence Challenge",
        "dataStoreInfo": {
            "id""ABC",
            "name""DataFilesStore",
            "type""qix-datafiles"
        }
    },
    "operational": {
        "size"149362,
        "rowCount"4436,
        "lastLoadTime""2022-09-14T07:44:47.546Z",
        "logMessage""{\n  \"cloudEventsVersion\": \"0.1\",\n  \"source\": \"qlik.com/qix-datafiles\",\n  \"contentType\": \"application/json\",\n  \"eventID\": \"XYZ\",\n  \"eventType\": \"com.qlik.datafile.updated\",\n  \"eventTypeVersion\": \"0.0.1\",\n  \"eventTime\": \"2022-09-14T07:44:47.5480812Z\",\n  \"extensions\": {\n    \"tenantId\": \"XYZ\",\n    \"userId\": \"ABC\",\n    \"header\": {\n      \"traceparent\": [\n        \"XYZ\"\n      ]\n    }\n  },\n  \"data\": {\n    \"id\": \"XYZ\",\n    \"name\": \"Iteration 4 Motor Vehicle Collision Prediction.csv\",\n    \"createdDate\": \"2022-09-06T12:56:44.932Z\",\n    \"modifiedDate\": \"2022-09-14T07:44:47.546291Z\",\n    \"createdByUser\": \"ABC\",\n    \"modifiedByUser\": \"ABC\",\n    \"ownerId\": \"62f1f7bb49e2c0307fd75ec1\",\n    \"spaceId\": \"ABC\",\n    \"size\": 149362,\n    \"contentUpdated\": true,\n    \"isInternal\": false,\n    \"reloadId\": \"ABC\",\n    \"qri\": \"qri:qdf:space://ABC\"\n  }\n}",
        "status""com.qlik.datafile.updated",
        "location""XYZ",
        "contentUpdated"true,
        "lastUpdateTime""2022-09-14T07:44:47.546Z"
    },
    "schema": {
        "dataFields": [
            {
                "name""automl_row_index",
                "alias""automl_row_index",
                "index"0,
                "dataType": {
                    "type""INTEGER",
                    "properties": {
                        "qType""U",
                        "qnDec"0,
                        "qUseThou"0
                    }
                },
                "tags": [
                    "$integer",
                    "$numeric"
                ],
                "sensitive"false,
                "primaryKey"false,
                "encrypted"false,
                "orphan"false,
                "nullable"false
            },
            {
                "name""Impact_predicted",
                "alias""Impact_predicted",
                "index"1,
                "dataType": {
                    "type""STRING",
                    "properties": {
                        "qType""U",
                        "qnDec"0,
                        "qUseThou"0
                    }
                },
                "tags": [
                    "$text",
                    "$ascii"
                ],
                "sensitive"false,
                "primaryKey"false,
                "encrypted"false,
                "orphan"false,
                "nullable"false
            },
            {
                "name""Impact_High",
                "alias""Impact_High",
                "index"2,
                "dataType": {
                    "type""DOUBLE",
                    "properties": {
                        "qType""U",
                        "qnDec"0,
                        "qUseThou"0
                    }
                },
                "tags": [
                    "$numeric"
                ],
                "sensitive"false,
                "primaryKey"false,
                "encrypted"false,
                "orphan"false,
                "nullable"false
            },
            {
                "name""Impact_Low",
                "alias""Impact_Low",
                "index"3,
                "dataType": {
                    "type""DOUBLE",
                    "properties": {
                        "qType""U",
                        "qnDec"0,
                        "qUseThou"0
                    }
                },
                "tags": [
                    "$numeric"
                ],
                "sensitive"false,
                "primaryKey"false,
                "encrypted"false,
                "orphan"false,
                "nullable"false
            },
            {
                "name""Impact_Moderate",
                "alias""Impact_Moderate",
                "index"4,
                "dataType": {
                    "type""DOUBLE",
                    "properties": {
                        "qType""U",
                        "qnDec"0,
                        "qUseThou"0
                    }
                },
                "tags": [
                    "$numeric"
                ],
                "sensitive"false,
                "primaryKey"false,
                "encrypted"false,
                "orphan"false,
                "nullable"false
            }
        ],
        "loadOptions": {},
        "effectiveDate""2022-09-06T12:56:48.340Z"
    },
    "qri""qdf:qix-datafiles:ABC:Iteration 4 Motor Vehicle Collision Prediction.csv",
    "secureQri""qri:qdf:space://XYZ",
    "type""DELIMETED"
}
NadiaB
Support
Support

Hi @Venkadesh_Ponnu

 

The result obtained with the api endpoint (metadata) is consistent with the documentation you have shared, so the API works fine. 

 

It looks you are looking to download the file itself, I found similar request marked as "no solution available", "feature request", it seems at the moment is not possible to do so. 

 

Let me know if there are any questions.

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Venkadesh_Ponnu
Partner - Contributor III
Partner - Contributor III
Author

Thank you for your information😊. please let me in any other way we can access data of dataset via api I will raise new request if required.