using microsoft graph api list events for a room - microsoft-graph-api

in microsoft graph api I can obtain a list of rooms
https://graph.microsoft.com/v1.0/places/microsoft.graph.room
how do I view the events for one of these rooms?
looks like my options for events are
/users/{id | userPrincipalName}/calendar/events
/groups/{id}/calendar/events
/users/{id | userPrincipalName}/calendars/{id}/events
/users/{id | userPrincipalName}/calendarGroups/{id}/calendars/{id}/events
is the room a "user"? or is it a "group"? not quite sure given a room find the events that occurring in that room.

Places does not have any relationship to events.
You should be able to only filter events for specific user or group by a location.
Example
GET /me/calendar/events?$filter=location/displayName eq 'xxx'
GET /users/{id | userPrincipalName}/calendar/events?$filter=location/displayName eq 'xxx'

Related

Microsoft Graph REST API v1.0 mailFolder id not unique?

My folder structure
Inbox
|- FolderA
| |-ChildA1
| |-ChildA2 ect.
|
|- FolderB
|-ChildB1
|-ChildB2 ect.
The problem
In the documentation is stated that the id-property for a mailFolder is unique. But several childs from FolderA does have the same id's as childs from FolderB.
a child of FolderA
Array
(
[id] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAH2RGbAAA=
[displayName] => childAx
[parentFolderId] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAETiFqAAA=
...
)
a child of FolderB
(
[id] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAH2RGBAAA=
[displayName] => childBx
[parentFolderId] => AAMkADc3NmMwNWE3<...>aXeP4l9AAAETiFtAAA=
...
)
As shown multiple mailFolders does have the same id.
Steps I took
Using /users/{id | userPrincipalName}/mailFolders/Inbox/childFolders I get the id's for FolderA and FolderB. After that I get the childFolders for both folderA and folderB via /users/{id | userPrincipalName}/mailFolders/{id}/childFolders
When using /users/{id | userPrincipalName}/mailFolders/{id} I get the mailFolder data from one of the folders with the same id's. How can I point out to another? Using a combination of the parentId and id?
I am unable to reproduce your issue. I have however noted that the ids are similar to some extent but not the same value. There is at least one digit difference. See below I have four sub children and each have a unique id with largely the first parts being the same
Folder A
Folder B
If you see any duplicate folder ids to exact matches, you may need to create a support request.

SendBird: Search personal chat along with group chat

SendBird treats every channel as their GroupChannel. The 1:1 chat too is technically a GroupChannel with only two users (with isDistinct = true so it would return the personal chat when you attempt to create it again).
My question is, how do I search GroupChannels by their name those include group AND 1:1 chat? The group chat would have a common name that would be shown to all the users in the group. But for 1:1 chat, the GroupChannel won't have a name, and if it has, that won't be shown to the users as for 1:1 chat, we always show the other person's name (like almost all the chat systems work).
Typically the main UI list contains mixture of the group chat and 1:1 chats (all the GroupChannels).
--------------------------------
| Search Chat TextField |
|--------------------------------|
|1 John (1:1) |
|2 John's Birthday Plan (group) |
|3 Johnney Eve (1:1) |
|4 Johansson Fans (group) |
| ... |
--------------------------------
All the items are technically GroupChannel. Note that all the 1:1 chats don't have actual name as shown in the list. The name shown in the list is the other person's nickname.
Expectation:
Now, if the user searches something like "joh", then it should return all the group chats whose name contains "joh" OR all the 1:1 chats where the other person's name contains "joh". (Basically all the items shown in the above example.)
My Attempt:
My initial solution to achieve this is to keep the 1:1 channel name as <user1 nickname> & <user2 nickname>, so when the user searches for the other user by their name, the 1:1 channel would appear just like a group channel.
Example Code:
query = SBDGroupChannel.createMyGroupChannelListQuery()
query?.order = .latestLastMessage
query?.limit = 30
query?.channelNameContainsFilter = "joh"
query.loadNextPage(...)
The Problem:
The problem with this are:
If the user searches for their own name (or just the separator character & or just a whitespace), then too all the personal chat would be visible, which is irrelevant.
My system allows user to change their nickname, so every time a user changes their nickname, then all the 1:1 channel names have to be updated (which is painful).
Sunil,
Typically when you retrieve a list of group channels for a user, it retrieves all channels that the user is potentially a part of (Depending on the memberStateFilter).
If you were explicitly looking to search, rather than providing an ongoing list of channels the user is part of, you may be able to filter channels by userIds. You'd have to filter for a channel that consists of the searching user, and the desired user.
Lets look at an example, assuming your userId is John and you're looking for your chat with Jay:
let listQuery = SBDGroupChannel.createMyGroupChannelListQuery()
listQuery?.userIdsExactFilter = ["John", "Jay"]
listQuery?.loadNextPage(completionHandler: { (groupChannels, error) in
guard error == nil else {
// Handle error.
}
// Only channelA is returned in a result list through the "list" parameter of the callback method.
...
})
If you wanted to explicitly use nicknames:
let listQuery = SBDGroupChannel.createMyGroupChannelListQuery()
listQuery?.nicknameContainsFilter = ["John", "Jay"]
listQuery?.loadNextPage(completionHandler: { (groupChannels, error) in
guard error == nil else {
// Handle error.
}
// Only channelA is returned in a result list through the "list" parameter of the callback method.
...
})
You mention that you allow users to change their nicknames, and thus rooms have to be updated. It may be worth giving your group channels (even 1:1) generic names, and then dynamically generate the display name of each chat.
Since each channel returns the list of members, you could look at the array of members, filter out the user that is logged in, and then pull the nickname of the remaining user from the array. This would ensure that no matter what the user changes their nickname to, its always accurate, and you don't have to update every channel when the user updates their nickname.
************ Updated 02/10 ************
Thanks for providing an example of what you're looking to achieve. It looks like you're essentially trying to search both channelNameContainsFilter and nicknameContainsFilter using the OR operator. This is not something we (Sendbird), currently support within the iOS SDK. So the question is, what could you do to achieve this?
One option would be to utilize the Platform API to obtain this information. The List my group channels has the search_query and search_fields parameters which would allow you to utilize that OR operator to find both channel names and nicknames that match your value.
Alternatively, since the SDK does return all of the necessary data that would be required to filter for these results, you could create a front-end filter that would only display the items that match your filter results. So the SDK returns the complete channel list, you store that list, and then when the user searches, you filter through the list to find channels that match your needs and display only those.
As a side note, Stackoverflow may not be the best place for this type of discussion as there is a lot of back and forth. Please feel free to join us in our community for more support.

how to create a meeting in English using graph api

When I create a meeting using Teams or Outlook directly, the info is something like:
Join Microsoft Teams Meeting
+xx xxxx China, All locations (Toll)
Conference ID: xxx xxx#
Local numbers | Reset PIN | Learn more about Teams | Meeting options
But when I use the graph api to create the meeting(https://graph.microsoft.com/v1.0/me/calendar/events), the info will be in Chinese like:
欢迎加入会议
+xx xxxx 中国, ....
....
I don't want to create the meeting in Chinese, how should I use the graph api?

How to filter Quickblox users?

I want to filter my application users based on their phone number or email, but I don't want exact match, instead part of the email or part of the number users should return in response. Is there a way in Quickblox iOS SDK?
Suppose, I've some quickblox users like below :
ID NAME Email Address Mobile Number
User1 | yuyuqabc#somedomain.com | +91-12345-67890
User2 | qerqrorp#somedomain.com | +1-123-000-7891
User3 | xyzabcqry#somedomain.com | +64-123-456-78
Now the filter should apply like this,
if I want to query on email, which contains "abc" then should return 1st and 3rd user.
if I want to query on phone number, which contains "23" then should return all users.
if I want to query on phone number, which contains "234" then should return 1st and 3rd user.
Is it possible?
It is possible only if you will use CustomObjects module instead of Users.
So you will need to create User class in CustomObjects and you will have all operators working there.
In Users it is impossible.

Getting the most recent record for each unique user in Parse using PFQuery

I'm using Parse.com, and have two classes: User and Report. A User may issue several reports during a day, but I'm only interested in the most recent one. However, I need to get all the reports that meet specific criteria, but only the most recent one.
The end result is an array of Reports, where the User is unique on each one, something like this:
ObjectId | ReportedValue | User | CreatedAt
1234 | 100 | aaaa | 2013-05-20T04:23:41.907Z
1235 | 100 | bbbb | 2013-04-29T05:10:41.907Z
1236 | 100 | cccc | 2013-05-20T02:14:41.907Z
1237 | 100 | dddd | 2013-05-19T04:03:41.907Z
So, User aaaa might have 20 reports, but I only need the most recent, for each user. However, I'm searching based on the ReportedValue being 100, and the desired result is the report objects, not the user, so I'd prefer not to go through every user.
Is this possible in Parse?
Consider using another object in the data model to assist with this. It would basically be a container with a relationship to Report. When any new report is saved, a bit of cloud code runs which:
Finds the previous latest Report for the associated user
Removes that report from the container relation
Adds the new report to the container relation
Working this way, your app can make a single, simple, query on the relation to get all of the latest Reports.
From Rest API.... works providing the user's OID is in the ACL segment in the records in the Class you are querying.
in addition to the other predicate of your query, parse can limit the number of returned rows..
--data-urlencode 'limit=1' \
--data-urlencode 'skip=0' \
For the user, if you GET the row from user table for the user you are querying
and the 'token' field value for that user and then with your report query, Set an extra header to the sessionToken value you will get ONLY THAT User's report objects.
-H "X-Parse-Session-Token: pn..." \
you will get just that user's reports
AND
results.size = 1

Resources