Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OneNote Pages not being returned using contentUrl #107

Closed
vjpudelski opened this issue Sep 9, 2018 · 3 comments
Closed

OneNote Pages not being returned using contentUrl #107

vjpudelski opened this issue Sep 9, 2018 · 3 comments
Labels

Comments

@vjpudelski
Copy link

I have tried using the page.contentUrl to return the page content using the client get command and the getStream to no avail. I would appear the get command the result is undefined while the getstream just produces an empty file when trying to write the stream to file.

@muthurathinam
Copy link
Contributor

muthurathinam commented Sep 10, 2018

Thanks for reporting this issue. will look into this.

876747

@juniorfoo
Copy link

Setting the response type to TEXT should do it for you.

client.api(ms_page.contentUrl).responseType(ResponseType.TEXT).get();

@muthurathinam
Copy link
Contributor

muthurathinam commented Jan 23, 2019

Sample code to download OneNote content (Assuming you have OneNote pages):

const downloadOneNoteContent = async () => {
    try {
        let pagesResponse = await client.api("/me/onenote/pages").get(),
            pages = pagesResponse.value;
        let content = await client.api(pages[0].contentUrl).get();
        console.log(content);
    } catch (error) {
        console.error(error);
    }
};

Fixed in this release: https://github.com/microsoftgraph/msgraph-sdk-javascript/releases/tag/1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants