Errors in Logic Apps when listing OneNote pages
Vincent Bitter
6
Reputation points
We have a OneNote file with about 500 pages divided in 15 sections. To gather all content, we created a Logic App that gets all sections from the OneNote file, then all pages in those sections with a foreach loop and finally grabs the content of each page. When executing this, we run into two issues:
- When getting the pages for one specific section, this always returns an error 408 with this content: {
"error": {
"@Antti .url": "https://aka.ms/onenote-errors#C10028",
"code": "10028",
"message": "Request to Cobalt timed out"
}
} - We found out only 20 results are returned by default, so we only get 20 pages per section. If Pagination is enabled and the treshold is set to 41 or higher, it returns an error 400 with this content (up to 40 there is no problem...): {
"error": {
"@Antti .url": "https://aka.ms/onenote-errors#C20143",
"code": "20143",
"message": "The OData query is invalid. Query option '$expand' was specified more than once, but it must be specified at most once."
}
}
I also made a new Logic App with just this step to reproduce the issue, and this indeed shows the same behavior.
This is the example:
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Get_pages_for_a_specific_section": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['onenote']['connectionId']"
}
},
"method": "get",
"path": "/sections/Dynamic/pages",
"queries": {
"notebookKey": "XXXXX Notebook|$|https://xxxx.sharepoint.com/teams/XXXXX/SiteAssets/XXXXX Notebook",
"sectionId": "https://www.onenote.com/api/v1.0/myOrganization/siteCollections/XXXXXXXXXXXXXX/sites/XXXXXXXXX/notes/sections/XXXXX/pages"
},
"retryPolicy": {
"type": "none"
}
},
"runAfter": {},
"runtimeConfiguration": {
"paginationPolicy": {
"minimumItemCount": 41
}
},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {
"$connections": {
"value": {
"onenote": {
"connectionId": "/subscriptions/XXXXXXXX/resourceGroups/XXXX/providers/Microsoft.Web/connections/OneNoteConnection2",
"connectionName": "OneNoteConnection2",
"id": "/subscriptions/XXXXXXXXXXXX/providers/Microsoft.Web/locations/westeurope/managedApis/onenote"
}
}
}
}
}
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
Sign in to answer