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

Not able to publish a SharePoint page, so created page is stuck in "Checked out" #1962

Open
jdimeo opened this issue Apr 25, 2024 · 1 comment

Comments

@jdimeo
Copy link

jdimeo commented Apr 25, 2024

Expected behavior

Based on the API documentation here:
https://learn.microsoft.com/en-us/graph/api/sitepage-publish?view=graph-rest-1.0

I would expect this code to compile:

client.sites().bySiteId(ms.getSiteId()).pages()
	.byBaseSitePageId("0eb44212-1667-41bb-b200-d41689ffddc8")
	.graphSitePage()
	.publish();

Actual behavior

I can only do a GET from the graphSitePage point in the SDK, there is no publish() method.

Steps to reproduce the behavior

Use the POST to create a site page and then try to publish it via the SDK.
This is important because I used a app client secret, not myself, so I can't "see" the page in the Sharepoint UI when I log in as myself.

@jdimeo
Copy link
Author

jdimeo commented Apr 25, 2024

Hacktacular workaround that shockingly works:

client.sites().bySiteId(ms.getSiteId()).pages().withUrl(
	client.getRequestAdapter().getBaseUrl() + "/sites/" + ms.getSiteId() + "/pages/0eb44212-1667-41bb-b200-d41689ffddc8/microsoft.graph.sitePage/publish"
).post(new BaseSitePage());

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

No branches or pull requests

1 participant