Microsoft Graph API Error – At least one recipient is not valid., A message can't be sent because it contains no recipients

Advertisements I am using microsoft Graph API to send email. I have set up my application in Entra. I am first saving a draft using API – https://graph.microsoft.com/v1.0/me/messages Which gave me response – { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(‘02720573-7ab2-4d63-b61b-97da9c881a5c’)/messages/$entity", "@odata.etag": "W/\"CQAAABYAAAAtK9qWA0ShRKzuJQcuV7P9AAAEfmZ6\"", "id": "AAMkADg1ZmUzYWU2LWNmNTEtNDNkYS1iMTMxLTE2ZWE3NThjOTJlNQBGAAAAAABc1YMkdg4qT74XBMUltssfBwAtK9qWA0ShRKzuJQcuV7P9AAAAAAEPAAAtK9qWA0ShRKzuJQcuV7P9AAAEglX3AAA=", "createdDateTime": "2024-02-09T09:52:12Z", "lastModifiedDateTime": "2024-02-09T09:52:12Z", "changeKey": "CQAAABYAAAAtK9qWA0ShRKzuJQcuV7P9AAAEfmZ6", "categories": [], "receivedDateTime": "2024-02-09T09:52:12Z", "sentDateTime": "2024-02-09T09:52:12Z", "hasAttachments": false, "internetMessageId":… Read More Microsoft Graph API Error – At least one recipient is not valid., A message can't be sent because it contains no recipients

C# Microsoft Graph Api Request_BadRequest

Advertisements Every time I try to add a license to a user using the Microsoft Graph Api in C#, I get this error: Microsoft.Graph.ServiceException: ‘Code: Request_BadRequest Message: License assignment cannot be done for user with invalid usage location. My code is here using Azure.Identity; using Microsoft.Graph; var scopes = new[] { "https://graph.microsoft.com/.default" }; var tenantId… Read More C# Microsoft Graph Api Request_BadRequest

How to incorporate the usage of AND when querying onPremisesExtensionAttributes/extensionAttribute in the MS Graph API?

Advertisements I’m currently trying to query multiple values when it comes to onPremisesExtensionAttributes/extensionAttribute in MS Graph API. I’m able to query this one: https://graph.microsoft.com/beta/users?$count=true&$filter=onPremisesExtensionAttributes/extensionAttribute13 eq ‘attr1′ But I want to query more values than attr1, but I haven’t managed to get it to work. I’ve tried queries, such as these two: https://graph.microsoft.com/beta/users?$count=true&$filter=onPremisesExtensionAttributes/extensionAttribute13 eq ‘attr1’ and… Read More How to incorporate the usage of AND when querying onPremisesExtensionAttributes/extensionAttribute in the MS Graph API?

Create subscription to a group conversation using microsoft graph api

Advertisements I would like to create a subscription to a user’s group conversation. In order to do so, I have an api call to https://graph.microsoft.com/v1.0/subscriptions with the following payload – { "changeType": "created, updated", "clientState": "something", "expirationDateTime": "2022-11-04T13:29:33.988006Z", "notificationUrl": "https://some.com", "resource": "groups(‘{id}’)/conversations" } But I am getting this error code (400 status code) – Subscription… Read More Create subscription to a group conversation using microsoft graph api

How to use receivedDateTime in Graph API Request?

Advertisements I am trying to use the receivedDateTime filter clause when calling the Graph API, but I’m running into issues when I use the exact datetime. For example, when I try running this API call: GET https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=receivedDateTime ge ‘2022-05-23T12:29:00’&$orderby=receivedDateTime%20ASC&$top=100&$skip=0 I get a 400 bad request (the specific error mentions "bad filter clause"). But it works… Read More How to use receivedDateTime in Graph API Request?

Graph Api officeLocation

Advertisements I am trying to run: https://graph.microsoft.com/beta/users?$filter=startsWith(officeLocation, ‘MOD’) and according to Microsoft Docs user resource type: officeLocation String Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values). However, the response I am getting is: "error": { "code": "Request_UnsupportedQuery", "message": "Unsupported or invalid query filter clause specified for property ‘officeLocation’ of… Read More Graph Api officeLocation