Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bskemp01
Contributor III
Contributor III

Need help with the Qlik Cloud REST API

Hey all, i am trying to use the following api for qlik cloud along with the documentation URL:

 

curl "https://your-tenant.us.qlikcloud.com/api/v1/apps/{appId}" \
 -H "Authorization: Bearer <API-key>"

https://qlik.dev/apis/rest/apps/#%23%2Fentries%2Fv1%2Fapps%2F-appId-get

 

i am using this REST API in Angular 16 (Typescript) however i keep getting an '401 Unauthorized' error. here is my code:

 

export class ApiService {
  constructor(private http: HttpClient) {}

  getApp() {
    const appId = '<MY-APP-ID>';
    const apiUrl = `https://<MY-Company-Tenant.us.qlikcloud.com/api/v1/apps/${appId}`;
    const apiKey =
      'Bearer <MY-API-KEY>';

    const headers = {
      authorization: apiKey,
    };

    return this.http.get<any>(apiUrl, { headers: headers });
  }
}

 

here is a couple screenshots of my test app so far along with the error i am getting:

bskemp01_0-1714398219221.png

bskemp01_1-1714398288696.png

bskemp01_2-1714398308338.png

 

Now i know this 401 error means the API key isnt being applied or is wrong however i am testing this in another app and the API call works:

bskemp01_3-1714398446909.png

Does anyone know why this isnt working?

Labels (5)
5 Replies
igoralcantara
Partner - Creator III
Partner - Creator III

What are the parameters of your data connection for this Rest API?

----
datavoyagers.net
bskemp01
Contributor III
Contributor III
Author

im not sure i follow. are you referring to the Appid and API key?

igoralcantara
Partner - Creator III
Partner - Creator III

Let me rephrase it. I am assuming you have created a Rest API connection in Qlik Cloud to connect to this tenant? Or, maybe I misunderstood and you're doing it outside of Qlik to connect to a cloud tenant.

----
datavoyagers.net
bskemp01
Contributor III
Contributor III
Author

i am using the Qlik Apps Rest apis, specifically the one that retrieves the general information about an app in my tenant. i did not make the rest connection itself, no. here is a link to the page where the APIs are listed on the qlik website: Qlik Developer Apps APIs 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The OP is not using a Data Connection. They are connecting using Typescript. 

-Rob