CreateNotBook via RESTapi for MSonenote 365 - microsoft-graph-api

While creating Notebook in MS365 authorized account via REST api call .I am facing some issue ,could anyone let me know what changes I have to make for this.
Request:
POST - https://graph.microsoft.com:443/v1.0/me/notes/notebooks
Body : {
"name": "MSOneNoteBusiness_OSSA_5LyC"
}
Response
Body : {
"error": {
"code": "BadRequest",
"message": "Unsupported segment type. ODataQuery: users/8dc0a74f-0aa6-45f4-813b-92e910f40bd4/notes/notebooks",
"innerError": {
"request-id": "fa409682-5395-4189-a43c-757adcfaea35",
"date": "2017-06-28T10:08:06"
}
}

The request should be POST https://graph.microsoft.com/v1.0/me/onenote/notebooks, not /me/notes, and the request body should have the property displayName. We also have a sample for this in the Graph Explorer:

Related

How to Filter Query Results from Microsoft-Graph-People?

I am trying to make a Get Request to the Microsoft Graph API for a specific user's email within my organization. Therefore, I have created the following query, to return the displayName, scoredEmailAddresses, and userPrincipalName for user "jane doe", whose userPrincipalName endsWith #something.com (see below). However, when I run this query in Graph Explorer, I receive the error below. Can any advise how I can fix this query?
QUERY:
https://graph.microsoft.com/v1.0/me/people?$search="Jane
Doe"&$select=displayName,scoredEmailAddresses,userPrincipalName&$count=true&$filter=endsWith(userPrincipalName,
'#something.com')
ERROR:
{
"error": {
"code": "ErrorInvalidUrlQueryFilter",
"message": "The query filter contains one or more invalid nodes.",
"innerError": {
"date": "2022-07-26T14:16:45",
}
}
}
It looks like that userPrincipalName does not support filtering.
If I try the simple filter query
https://graph.microsoft.com/v1.0/me/people?$filter=userPrincipalName eq 'john.doe#something.com'
The response returns an error
{
"error": {
"code": "ErrorInvalidProperty",
"message": "The property 'UserPrincipalName' does not support filtering.",
"innerError": {
"date": "2022-07-27T09:45:45",
"request-id": "9500af61-d1a9-4c9b-b405-05f9c07c81f1",
"client-request-id": "a0bda440-4f9b-aa4a-5d6c-4a0271bda023"
}
}
}
If you can directly search the user by following below API , why you are

The method openShiftsRequests return Resource not found for the segment 'openShiftsRequests'

Im try to get the pending shifts to approve in teams with api.
Pending shifts teams
Reading the API i think the correct method is https://learn.microsoft.com/en-us/graph/api/openshiftchangerequest-list?view=graph-rest-1.0
When I try to get this method using the graph explore the response request is :
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'openShiftsRequests'.",
"innerError": {
"date": "2020-09-04T17:33:34",
"request-id": "52f61a88-7f43-4653-9162-c8e90fc5998f"
}
}
}
My request is https://graph.microsoft.com/v1.0/teams/MY_TEAM_ID_WITH_SHIFT/schedule/openShiftsRequests
What can I do wrong??

OneDrive API Sovereign network. Change tracking is not supported against 'microsoft.graph.driveItem'

I am testing OneDrive APIs from the China cloud.
Authentication was successful, user discovery works fine, but tracking drive changes does not seem to work.
https://microsoftgraph.chinacloudapi.cn/v1.0/users/(user_UPN)/drive/root/delta
Bad Request Message: { "error": {
"code": "BadRequest",
"message": "Unsupported request: Change tracking is not supported against 'microsoft.graph.driveItem'.",
"innerError": {
"request-id": "1643c13e-4067-4230-8287-f321ca4bf017",
"date": "2020-01-22T15:17:16"
} } } 3436 9 01/22 16:17:16 2841762 ### * - ErrorInfo Json parse error : { "error": {
"code": "BadRequest",
"message": "Unsupported request: Change tracking is not supported against 'microsoft.graph.driveItem'.",
"innerError": {
"request-id": "1643c13e-4067-4230-8287-f321ca4bf017",
"date": "2020-01-22T15:17:16"
} } } 3436 9 01/22 16:17:16 2841762 ### * - other expcetion for Execute() : { "error": {
"code": "BadRequest",
"message": "Unsupported request: Change tracking is not supported against 'microsoft.graph.driveItem'.",
"innerError": {
"request-id": "1643c13e-4067-4230-8287-f321ca4bf017",
"date": "2020-01-22T15:17:16"
} }
Is this expected?
Is there any list of APIs that are not supported by Sovereign networks?
Plans for supporting those missing APIs?
Thanks.
You can find a recap of the supported features across different deployments here. The capability is currently not supported. To request new capabilities in national clouds please use uservoice

ErrorInvalidIdMalformed while accessing message through Microsoft Graph API

I am trying to access message using graph API with the following URL.
_graphAPIEndpoint = Uri.EscapeUriString("https://graph.microsoft.com/v1.0/me/messages/8577e5c2-3d1b-4882-b930-02de5ad18809#CH1GMEHUB07.gme.gbl");
However, I keep getting the following response:
{
"error": {
"code": "ErrorInvalidIdMalformed",
"message": "Id is malformed.",
"innerError": {
"request-id": "8b2d8f88-ff5b-44f7-bb71-8867a03136b7",
"date": "2018-06-07T18:00:32"
}
}
}
Any suggestions on what's wrong?
My bad. Message ID value should be taken from id field passed by Graph API. To use message ID, following query works:
_graphAPIEndpoint = "https://graph.microsoft.com/v1.0/me/messages?$filter=internetMessageId eq ''"

Sort Events by Start Date

I need to be able to get the events in both directions ASC/DESC using Microsoft Graph API. I'm trying the following API to achieve that:
https://graph.microsoft.com/v1.0/me/events?$orderby=start
However, when I perform the request I get the following error:
{
"error": {
"code": "BadRequest",
"message": "The $orderby expression must evaluate to a single value of primitive type.",
"innerError": {
"request-id": "c00d676d-ef8e-418b-8561-80e08729da71",
"date": "2017-11-16T13:31:59"
}
}
}
Also, I tried to access the date directly:
https://graph.microsoft.com/v1.0/me/events?$orderby=start.dateTime
Got the following error:
{
"error": {
"code": "BadRequest",
"message": "The child type 'start.dateTime' in a cast was not an entity type. Casts can only be performed on entity types.",
"innerError": {
"request-id": "240342f5-d7f6-430b-9bd0-190dc3e1f73b",
"date": "2017-11-16T13:32:39"
}
}
}
Is there a way to sort events by date in ASC/DESC order?
You're very close but you're referencing DateTime incorrectly. The proper format is {parent}/{child}. These will work:
https://graph.microsoft.com/v1.0/me/events?$orderby=start/dateTime
https://graph.microsoft.com/v1.0/me/events?$orderby=start/dateTime desc

Resources