1

When calling the 'findRooms' endpoint and specifying the email address for a room list, the request works fine unless the email address contains special characters:

Example room list:

  • Name: Boston-rooms (1/3)
  • Email: Boston-rooms?1/3?@domain.onmicrosoft.com (note that Microsoft removes whitespace and converts parentheses to question marks)

Example API call:

  • https://graph.microsoft.com/beta/me/findRooms(RoomList='Boston-rooms?1/3?@domain.onmicrosoft.com')

Specifically, it's the ? and / characters that are causing the issue. I've tried escaping ?1/3? as %281%2F3%29, but no luck. The same error is returned.

Sample response returned:

{ "error": { "code": "BadRequest", "message": "Bad Request - Error in query syntax.", "innerError": { "request-id": "126e8ffc-9b13-4d28-99da-2258a867d1ba", "date": "2018-09-26T00:42:57" } } }

This call works just fine for room lists without special characters, however for this application to function it must work with all rooms, and some do contain those characters.

Thanks!

Ryan
  • 95
  • 9
  • Can you post an example Email-Address that doesn't work for you? Keep in mind that if you have an Email-Address with special characters you have to surround the [local-part](https://en.wikipedia.org/wiki/Email_address#Local-part) of the adress with doublequotes `"`. For example: `"unusual.:email][
    – Karlheinz Reinhardt Sep 26 '18 at 08:38
  • 1
    @KarlheinzReinhardt Just added the email address and some additional information about the offending API call. I did try surrounding the local-part of the email address with double quotes just now, but unfortunately the end result was no different. – Ryan Sep 28 '18 at 01:54

2 Answers2

0

Based on your latest description and our gained experience. This is not the API issue, but bad design of the AD account format.

Boston-rooms?1/3?@domain.onmicrosoft.com' is a bad UX room mail.

The good UX will be bostonroom13 or such as. Although you can submit an feature for your requirement in the UserVoice, but due to this is bad design on your side, so Graph team almost impossible to add this feature for you.

A good example of MS: bostonrm13@linkedin.com(Display Name: 1/3 boston room)

Keep good UX for your AD and software application.

Seiya Su
  • 1,836
  • 1
  • 7
  • 10
  • 1
    Thanks Seiya. Unfortunately the choice of room names and email addresses is not something this script has control over. – Ryan Oct 01 '18 at 13:06
0

For Emails allowed special characters are: ` and !#$%&'*+-/=?^_{|}~.
And if you want to use one of the characters "(),:;<>@[\] and whitespace you will have to use the Quoted-string form. Quoted-string form means that the local-part of the address is surrounded by " (see Wikipedia for more indepth information).

As your Email contains () and whitespaces your address will have to look like this

"Boston-rooms (1/3)"@domain.onmicrosoft.com

As you have to use this in an Url you will have to escape all characters that are not Alphanumeric, $-_.+!*'(), or reseverd (see also this stackoverflow post).

In your case the address will have to be escaped to

%22Boston-rooms%20%281%2F3%29%22%40domain.onmicrosoft.com

a and the call to Graph will be:

/beta/me/findRooms(RoomList='%22Boston-rooms%20%281%2F3%29%22%40domain.onmicrosoft.com')

It seems that this graph-operation is not fully compliant to all Email-formats. From quick testing in the Graph-Explorer I found that addresses with characters ?/\<> fail and .;(+-[] seem to work. I did not test every character. For Example "Boston-rooms (1.+-3)"@domain.onmicrosoft.com will work but the valid example Email-Address from Wikipedia "very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com does not.

To solve this issue I would recommend you to open a bug report on Github, stating that the documentation suggests that this operation is fully compatible with all Email address formats but in reallity it is not.

For now your only option will be to change the Email address of the meeting room and to wait and hope this is fixed.

Generally the Quoted-string form is not commongly used. Thus the probablity is high that it cannot be handeled everywhere (often only a simple RegEx is used for validation). Be aware that even the RFC-Standard warns to use the Quoted-string form in some cases:

[...] a host that expects to receive mail SHOULD avoid defining mailboxes where the Local-part requires (or uses) the Quoted-string form or where the Local-part is case- sensitive. [Quote from Rfc5321]

Community
  • 1
  • 1
Karlheinz Reinhardt
  • 1,025
  • 1
  • 11
  • 22
  • Thank you for your detailed response! Looks like no dice given the specific characters in the email address I flagged, but this is an extremely helpful jumping-off point as I work through next steps. – Ryan Oct 01 '18 at 13:05
  • I filed an issue against the Microsoft Graph API docs on Github (https://github.com/microsoftgraph/microsoft-graph-docs/issues/3542) back in December, 2018. They've yet to respond or fix the bug. – Zach Mathew Apr 05 '19 at 21:27