msgraph-sdk-php icon indicating copy to clipboard operation
msgraph-sdk-php copied to clipboard

Exception with code ErrorInvalidRecipients

Open emajlo opened this issue 4 years ago • 1 comments

SDK_VERSION is 1.13.0

I am getting exception:

Exception: Client error: `POST https://graph.microsoft.com/v1.0/users/{emailaddress}/calendar/events` resulted in a `400 Bad Request` response:
{
  "error": {
    "code": "ErrorInvalidRecipients",
    "message": "At least one recipient isn't valid.",

The sent data is:

{
  "subject": "Testing",
  "start": {
    "dateTime": "2020-03-20T10:00",
    "timeZone": "Europe\/Stockholm"
  },
  "end": {
    "dateTime": "2020-03-20T10:30",
    "timeZone": "Europe\/Stockholm"
  },
  "attendees": [
    {
      "emailAddress": {
        "address": "{another_emailaddress}"
      }
    }
  ]
}

The odd thing is that it still is creating the event correctly and if I run this same thing from Graph Explorer it works and returns Status code 201.

It also works if the attendee is the same emailaddress as in the url.

AB#7370

emajlo avatar Mar 17 '20 12:03 emajlo

Is this something I can expect someone to look into? Or should a do a special solution for this on my own?

emajlo avatar Apr 08 '20 05:04 emajlo

Works in latest v1 release. Also works in v2 preview

Ndiritu avatar Oct 06 '22 06:10 Ndiritu