onenote-api

Error “request too large (413)” when trying to upload a PDF file to OneNote

℡╲_俬逩灬. 提交于 2019-12-08 15:22:36
I'm trying to create new pages in OneNote using Microsoft Graph REST API (Objective-C). Those new pages should contain a PDF document as an attachment. The POST operations succeed with PDF files that are under ~4MB. However, the operations for files that are over 4MB fail with the error message request too large (413) and the following response: { "error": { "code": "BadRequest", "message": "Maximum request length exceeded.", "innerError": { "request-id": "269c663c-9289-47cc-a833-d471b7b867f6", "date": "2019-04-09T09:35:49" } } } The end point that is used is: https://graph.microsoft.com/v1.0

Python MultiPart POST Malformed

烈酒焚心 提交于 2019-12-08 05:45:57
问题 I'm trying to figure out how to write a MultiPart POST request to OneNote using Python. Here is what I've done so far: url = ROOT_URL+"pages" headers = {"Content-Type":"multipart/form-data; boundary=MyAppPartBoundary", "Authorization" : "bearer " + access_token} txt = """--MyAppPartBoundary Content-Disposition:form-data; name="Presentation" Content-type:text/html <!DOCTYPE html> <html> <head> <title>One Note Text</title> </head> <body> <p>Hello OneNote World</p> </body> </html> -

Error “request too large (413)” when trying to upload a PDF file to OneNote

谁说胖子不能爱 提交于 2019-12-08 04:13:59
问题 I'm trying to create new pages in OneNote using Microsoft Graph REST API (Objective-C). Those new pages should contain a PDF document as an attachment. The POST operations succeed with PDF files that are under ~4MB. However, the operations for files that are over 4MB fail with the error message request too large (413) and the following response: { "error": { "code": "BadRequest", "message": "Maximum request length exceeded.", "innerError": { "request-id": "269c663c-9289-47cc-a833-d471b7b867f6

Python MultiPart POST Malformed

爱⌒轻易说出口 提交于 2019-12-06 15:40:51
I'm trying to figure out how to write a MultiPart POST request to OneNote using Python. Here is what I've done so far: url = ROOT_URL+"pages" headers = {"Content-Type":"multipart/form-data; boundary=MyAppPartBoundary", "Authorization" : "bearer " + access_token} txt = """--MyAppPartBoundary Content-Disposition:form-data; name="Presentation" Content-type:text/html <!DOCTYPE html> <html> <head> <title>One Note Text</title> </head> <body> <p>Hello OneNote World</p> </body> </html> --MyAppPartBoundary-- """ session = requests.Session() request = requests.Request(method="POST", headers=headers, url

OneNote Add in: Getting HTML content

依然范特西╮ 提交于 2019-12-05 21:17:09
In the example , code is provided to get RichText. It is able to get the plain text content of the page, but I cannot seem to get it to return the HTML formatted content of the page. For example: Header: A B should be: <p>Header:</p> <ul> <li>A</li> <li>B</li> </ul> However, the example code uses richText/text and only returns Header: . Is it possible to do something like richText/HTML and get the HTML shown above? (Note: I want to use the add-in only, not the OneNote REST API.) Thanks! Code snippet from documentation: OneNote.run(function (context) { // Get the collection of pageContent items

OneNote parsing - how to get to the Text Blobs in the document?

故事扮演 提交于 2019-12-03 09:14:24
问题 This bounty has ended . Answers to this question are eligible for a +500 reputation bounty. Bounty grace period ends in 16 hours . Kermit wants to draw more attention to this question. I am creating a parser for the .one file extension, which when finished I will add to the Apache Tika project. Here is the APL 2.0 licensed Open Source project I'm creating: https://github.com/nddipiazza/onenote-parser-java I used the specification document here: https://docs.microsoft.com/en-us/openspecs

Difference between notebook id by OfficeJS and OneNote API

走远了吗. 提交于 2019-12-02 06:40:42
问题 I'm trying to build task-pane add-in for OneNote ClassNotebook. I want to know whether current user is teacher or student. To achieve this, my plan was: 1. Get ID of activeNotebook from officeJS 2. Get class notebooks with ID from 1 from OneNote API 3. Use students and teachers from 2 to check if current user is student or teacher But the id from 2 is something weird form like this - {3b9c6337-cd8c-5c1c-a87b-1a9515237c48}{1} How can I fetch notebook with that ID? Code: let notebook = ctx

How to Access/Download OneNote notebook with Python?

百般思念 提交于 2019-11-30 20:15:10
How do I access a OneNote notebook using Python? Is there a way to export it to a pdf or other file programmatically? The notes are taken by hand, so I unfortunately can't just parse it for text. I've found this article from 2011, but the links are dead and I imagine it would be outdated anyway. I've also found this GitHub but I don't see how to implement it to do what I want. Alternatively, is there another language I could use? If your notebooks are stored in OneDrive or Office 365, you can use the OneNote APIs to access them. Information about the APIs are on http://dev.onenote.com/ . For