microsoftgraph / microsoftgraph/msgraph-sdk-java

Create Page in OneNote using Java SDK v6.x

Aberta
#2,083 3 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

area:serialization type:bug
Linguagem predominante
Java
Estrelas
444
Forks
154
Merge médio
18h 28min
PRs com merge (30d)
4

Descrição

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"
        )
    }

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece pelo Microsoft Graph Java SDK v6 Upgrade Guide e pelo artigo OneNote create-page vinculado na issue; em seguida, compare os padrões de solicitação disponíveis do Java SDK com os exemplos existentes de HTTP e JavaScript. Confirme o formato de solicitação multipart compatível e documente um exemplo funcional em Java 6.x, incluindo o conteúdo esperado da solicitação e uma verificação clara de conclusão.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
java
Domínio
api, documentation
Tipo de issue
Documentação
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.