Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
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:
Does anyone know why this isnt working?
What are the parameters of your data connection for this Rest API?
im not sure i follow. are you referring to the Appid and API key?
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.
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
The OP is not using a Data Connection. They are connecting using Typescript.
-Rob