Forum Discussion
Using Graph API to create a OneNote tab in a Teams Channel
Hello,
I'm trying to create a new tab in an existing channel that opens a OneNote notebook using Graph API. According to official documentation (https://learn.microsoft.com/en-us/graph/api/channel-post-tabs?view=graph-rest-1.0&tabs=http), the call should look like this:
POST https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/tabs
{
"displayName": "OneNote",
"email address removed for privacy reasons" : "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/0d820ecd-def2-4297-adad-78056cde7c78",
"configuration": {
"entityId": "<Notebook_id>",
"contentUrl": "<OneNote_notebook_url>",
"websiteUrl": "<OneNote_notebook_url>"
}
}
It worked smoothly, but since recently, when you open the tab in Teams (desktop or web), it shows an error message stating that "the application can't be reached". In the end, the tab is created but OneNote notebook is not opened.
Reading the official documentation here: https://learn.microsoft.com/en-us/graph/teams-configuring-builtin-tabs#onenote-tabs it mentions that when creating OneNote tabs, "configuration is not supported". Does this mean now you can't specify the OneNote notebook to open in the tab using Graph API?
Any suggestions or recommendations?
Thanks in advance!
Ferran
Ferran-Chopo , We got below update from engineering team:
Configuration is not supported for OneNote tabs as per our documentation:
https://learn.microsoft.com/en-us/graph/teams-configuring-builtin-tabs#onenote-tabs
The URLs of each app are an internal implementation detail that is not publicly documented. App developer should only be using our Graph APIs to create tabs of their own apps for which they know the proper URL structure.
Engineering team is working on implementation to block one note tabs created with faulty content URLs by doing a domain check i.e. blocking creation of OneNote tabs with SharePoint domain URLs.
14 Replies
- JibbsAutomationsCopper Contributor
Hi, is there any solution for this issue? It's been nearly a year now.
- chrisk2185Copper Contributor
Hi
I have this working in my environment after advice from a Microsoft support ticket. App based auth was recently deprecated for onenote graph calls, so now need to use Delegated auth. I can forward you the email with the details; email me on: email address removed for privacy reasons
- JibbsAutomationsCopper Contributor
Hi chrisk2185 , your email was removed from your response. Can you email me? jeremy at jibbsautomations.com
Very grateful for your help, thank you!!
- ERobillardBrass Contributor
This is still broken. Creating OneNote tabs is an important part of the API, and right now there is no way to programatically add a OneNote tab into a Shared Channel except manually, which is totally unacceptable for automating deployments and backup/restore scenarios. It's also apparently impossible to copy a OneNote template from the base Team's SPO site into a Shared channel due to an unspecified permission error (my process's registration has all appropriate SPO and notebook read/write/full control permissions). Could the PG please provide a roadmap ID or any hope that these issues will be resolved in our lifetimes?
- Prasad_Das-MSFT
Microsoft
Ferran-Chopo - According to this documentation, Configuration is not supported. So, could you please try running the API query without configuration property and check if that helps?
If configuration is not supported, how do we specify which OneNote notebook should be opened when clicking the tab in the Teams channel? The contentUrl and websiteUrl are inside the configuration section, so there's no way to set the OneNote notebook url.
Best Regards,
Ferran
- Prasad_Das-MSFT
Microsoft
Ferran-Chopo , we completely understand the concern and we are too having the same issue.
We have raised a bug for the same and engineering team is looking into it. We will inform you once we get any further update.
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- Prasad_Das-MSFT
Microsoft
Ferran-Chopo - Thanks for raising your issue. We are checking the issue. We will get back to you shortly.