1

https://learn.microsoft.com/en-us/graph/api/onlinemeeting-get?view=graph-rest-beta&tabs=csharp

We can use this GET method to get a meeting object from Join Url Address!

When i try that from the graph explorer its all working ! but when i try that from .net SDK its giving below error

"The query specified in the URI is not valid. Could not find a property named 'JoinWebUrl' on type 'Default.<>f__AnonymousType0_1Of<>f__AnonymousType1_2OfString_String

This is my code :

string body = string.Format("JoinWebUrl eq '{0}'", joinWeb);
var meetingTest = await graphServiceClient.Users[userId].OnlineMeetings
                .Request()
                .Filter(body)
                .GetAsync();

am I doing it wrong?

I'm using the graph beta SDK and I test this query in graph explorer it's working but not with SDK it gives me an error

Mobinkh
  • 117
  • 1
  • 7
  • So this question isn't really about Teams, is it? – Martin Liversage Nov 17 '20 at 08:09
  • its about MS Teams bot – Mobinkh Nov 17 '20 at 08:30
  • The reason behind this is the url need to be properly encoded to filter it. Please encode the whole filter like this `$filter=JoinWebUrl%20eq%20%27https%3A%2F%2Fteams.microsoft.com%2Fl%2Fmeetup-join%2F19%3Ameeting_OTg1YjAxNmYtN2EyZC00YWI0LWI1ZDMtMjVkZDljOTYzMTEz%40thread.v2%2F0%3Fcontext%3D%7B%22Tid%22%3A%22363147dc-b3be-41a7-af56-f673893ef5a7%22%2C%22Oid%22%3A%221ab4e76f-5f52-44b8-8a72-7d03c05e6ff4%22%7D%27`. Remember one thing, when you get the joinweburl, context parameter is already encoded. So try avoiding it or decode that part and encode the whole url and then apply the call. – Shiva Keshav Varma Nov 17 '20 at 13:26
  • @Shiva-MSFTIdentity actully i dident tried that how can i do that ? i mean any where to encode urls proberly ? – Mobinkh Nov 17 '20 at 15:17
  • You can look into this [SO Thread](https://stackoverflow.com/questions/575440/url-encoding-using-c-sharp) for Encoding and for Decoding look at this [SO thread](https://stackoverflow.com/questions/1405048/how-do-i-decode-a-url-parameter-using-c) – Shiva Keshav Varma Nov 17 '20 at 16:15

2 Answers2

2

I created a new meeting in outlook canlender, and I got a meeting Join Url Address like this: enter image description here

Then I tried the api you provided and got the same response. At first I tried to remove the filter parameter, I think 'filter' is an optional parameter, so if the parameter was removed, I would get correct answer, but it didn't work. I got a response like this: enter image description here

This error resulted from api permission:

enter image description here

Then I change the url, replace me to users/{userId}, but I got a response like 'app can not on behalf of the user.

I googled that error, and get this document, it describes the fact that applications should be allowed to access online meetings on behalf of a user. So I install Microsoft Teams PowerShell module, connect to Skype, and add policy.

Following the steps above, I can call the api successfully. enter image description here

Tiny Wang
  • 10,423
  • 1
  • 11
  • 29
0

I have also got the same error when I tried the call without encoding the filter parameter. Url need to be properly encoded to filter it. Please encode the whole filter like this

$filter=JoinWebUrl%20eq%20%27https%3A%2F%2Fteams.microsoft.com%2Fl%2Fmeetup-join%2F19%3Ameeting_OTg1YjAxNmYtN2EyZC00YWI0LWI1ZDMtMjVkZDljOTYzMTEz%40thread.v2%2F0%3Fcontext%3D%7B%22Tid%22%3A%22363147dc-b3be-41a7-af56-f673893ef5a7%22%2C%22Oid%22%3A%221ab4e76f-5f52-44b8-8a72-7d03c05e6ff4%22%7D%27

Remember one thing, when you get the joinweburl, context parameter is already encoded. So try avoiding it or decode that part and encode the whole url and then apply the call.

You can look into this SO Thread for Encoding and for Decoding look at this SO thread.

Shiva Keshav Varma
  • 3,398
  • 2
  • 9
  • 13
  • I did that tnx and it's not working it gives me the same error its weird I track the HTTP request and pasted the body to graph explorer it's working there but not in SDK of /net – Mobinkh Nov 20 '20 at 06:54
  • @Mobinkh: Could you please try to [create a event using online meeting provider](https://learn.microsoft.com/en-us/graph/outlook-calendar-online-meetings?tabs=http#example-create-and-make-meeting-available-as-an-online-meeting)? – Rama-MSFT Dec 08 '20 at 10:33