0

I am trying to display page content of my OneNote's page using Angular Web. Although I can get the other contents, I cannot get images from OneNote page. Here is the code that I am using for getting page content and the error.

public async getOneNoteContent(pageUrl: any) {  
let url = pageUrl+'/?preAuthenticated=true';
let token =  await this.authService.getAccessToken();
let header = new HttpHeaders().set('Authorization', 'Bearer '+token);
return(this.http.get(url, {headers:header, responseType: 'text'}));}

Error Code

How can I solve this. Please help me.

Hasini
  • 327
  • 4
  • 19
  • 1. Use https://jwt.ms/ to parse your access token and provide screenshots. 2. Provide your reference Microsoft graph api document. – Carl Zhao Dec 28 '20 at 10:21
  • You are getting a 401 Unauthorized. Are you adding preAuthenticated=true to your request? – codeye Dec 29 '20 at 14:20
  • Sorry I see it in your url. What happens if you paste the link directly into a browser? – codeye Dec 30 '20 at 23:47
  • Please check if you have Notes.Read.All permission in your scope and if not add it and give a try. Also please share the requestid and timestamp of this failed request. – Shiva Keshav Varma Jan 04 '21 at 12:48

0 Answers0