OneNote API Get Notebooks issue

204 views Asked by At

The following is a sample schema from the OneNote API documentation at this site and will can be used with json2csharp.com with no problems.

http://dev.onenote.com/docs#/reference/get-notebooks.

    {
  "createdBy": "user name",
  "createdTime": "2013-10-05T10:57:00.683Z",
  "id": "notebook ID",
  "isDefault": false,
  "isShared": false,
  "lastModifiedBy": "user name",
  "lastModifiedTime": "2014-01-28T18:49:00.47Z",
  "links": {
    "oneNoteClientUrl": {
      "href": "onenote:https://{client URL}"
    },
    "oneNoteWebUrl": {
      "href": "https://{web URL}"
    }
  },
  "name": "notebook name",
  "sectionGroupsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sectionGroups",
  "sectionsUrl": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}/sections",
  "self": "https://www.onenote.com/api/v1.0/notebooks/{notebook ID}",
  "userRole": "Contributor"
}

However, using the following Get Notebooks link has a different schema that doe

sn't pass json2csharp. Parsing your JSON didn't work. Please make sure it's valid.

"https://graph.microsoft.com/v1.0/me/onenote/notebooks"

createdBy and lastmodifiedBy are thrown as exceptions.

The sample from the apigee.com/console app uses the https://www.onenote.com/api/v1.0/me/notes/notebooks link and has the correct schema.

How do I resolve this discrepancy? Or am I mistaken?

1

There are 1 answers

1
Manjusha On

The response payload returned from the Microsoft Graph API is slightly different from the response payload returned from the OneNote API directly.

Here's a reference to the notebook properties returned from Microsoft Graph: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/notebook

And this is what gets returned from the OneNote API directly: https://msdn.microsoft.com/en-us/library/office/dn769050.aspx => Response properties