microsoftgraph / microsoftgraph/msgraph-sdk-java
Create Page in OneNote using Java SDK v6.x
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 444
- Forks
- 154
- Merge medio
- 18 h 28 min
- PR fusionados (30 d)
- 4
Descripción
My current app successfully creates pages in OneNote using the Java SDK 5.x. I am looking to update to the latest Java SDK 6.x (in the process of also adding support for OneDrive).
I have read through the Microsoft Graph Java SDK v6 Changelog and Upgrade Guide and am obtaining valid tokens. I can't find, however, any documentation or examples of how to create a page in OneNote using the Java SDK 6.x. The article Create onenotePage provides examples for HTTP, CLI, and JavaScript, but is missing the examples for C#, Go, Java, etc. provided for other actions such as Create notebook.
Is it possible to create pages using the Java SDK 6.x? Are there any examples?
I have tried the Kotlin code below in the absence of documentation, but always receive the error "The multi-part payload was malformed". Debugging by enabling okhttp logging leads me to believe that this approach results in posting a serialized version of the OnenotePage object rather than the contents field as required. (I didn't provide my initialization for 'contents' as the whole approach seems invalid.)
val mypage = OnenotePage()
mypage.content = content
mGraphClient!!.me().onenote()
.pages()
.withUrl("https://graph.microsoft.com/v1.0/me/onenote/pages?sectionName=MySection")
.post(mypage) { requestConfiguration ->
requestConfiguration.headers.add(
"content-type",
"multipart/form-data; boundary=MyBoundary1234"
)
}
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el Microsoft Graph Java SDK v6 Upgrade Guide y el artículo OneNote create-page enlazado en el issue; después, compara los patrones de solicitud disponibles del Java SDK con los ejemplos existentes de HTTP y JavaScript. Confirma la forma de solicitud multipart compatible y documenta un ejemplo funcional de Java 6.x, incluido el contenido esperado de la solicitud y una comprobación clara de finalización.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- api, documentation
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100