'Pass OneNote Authentication token to custom action

I would like to delete a OneNote page in a Microsoft Flow. I appears there are no standard actions to do so, but I can call the DELETE api on the page that's passed in.

But, how do I obtain the bearer token from the OneNote connector?



Solution 1:[1]

Actually you do not need to extract authentication token from existing Connection as OneNote API is available via the Microsoft Graph API.

  1. Authenticate using Bearer obtained from /oauth2/v2.0/token endpoint using grant_type=client_credentials or any other flow
  2. Get Page ID of desired document
  3. Use one of HTTP DELETE methods described here https://docs.microsoft.com/graph/api/page-delete?view=graph-rest-1.0&tabs=cs

1]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nervuzz