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 ContentRequestBuilder does not support the includeIDs query parameter #2165

Open
aaronanderson opened this issue Sep 21, 2024 · 1 comment
Labels

Comments

@aaronanderson
Copy link

Describe the bug

The Graph API OneNote Get page API documentation indicates that the content endpoint supports an includeIDs parameter.

GET /me/onenote/pages/{id}/content[?includeIDs=true]

However, there is no way to set it using the Java SDK ContentRequestBuilder class.

Expected behavior

The Java SDK should support setting this query parameter so that IDs are embedded in the content that can be used in partial update requests.

How to reproduce

String pageId = "...";
OnenoteRequestBuilder requestBuilder = graphClient.me().onenote();
 
try (InputStream is = requestBuilder.pages().byOnenotePageId(pageId).content().get(r -> {
  //	r.queryParameters.includeIDs = true; 
})) {
	System.out.printf("\t\tContent %s\n", IOUtils.toString(is, Charset.defaultCharset()));
     } catch (IOException e) {
	e.printStackTrace();
}

SDK Version

6.16.0

Latest version known to work for scenario above?

No response

Known Workarounds

Use a different rest client (JAX-RS):

WebTarget base = client.target("https://graph.microsoft.com/v1.0/me/onenote");
Response response = base.path("/pages").path(pageId).path("content").queryParam("includeIDs", "true").request().get();
System.out.format("Page contents: %d %s\n", response.getStatus(), response.readEntity(String.class));

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@aaronanderson aaronanderson added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Sep 21, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Sep 23, 2024

@aaronanderson thank you for reaching out.
To unblock this scenario, kindly use the withUrl method to override the request URL & pass the query parameter:

graphClient.me().onenote().pages().byOnenotePageId(pageId).content().withUrl(
    graphClient.getRequestAdapter().getBaseUrl() + "/me/onenote/pages/{id}/content[?includeIDs=true]"
).get();

@Ndiritu Ndiritu added Status: Needs Investigation and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Sep 23, 2024
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

2 participants