Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3667

QLIK REST API giving 401 Unauthorized Error

$
0
0

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:

enter image description hereenter image description hereenter image description here

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:

enter image description here

Does anyone know why this isnt working?


Viewing all articles
Browse latest Browse all 3667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>