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?