How to search users in groups and return display names using graph API? - asp.net-core

Net core application. I have search box in web application where user can search user belongs to specific group. I am trying as below to search users
var members = await graphClient.Groups["0001b29c-fd90-4ae9-a5a1-h8afe65777e9"].Request().Expand("members").GetAsync();
var usersInGroup = members.Members.ToList();
In the above code I want to apply filter also to list users name starting with. I am struggling to apply filter. Can someone help me to add filters here. Any help would be greatly appreciated. thank you

Please try below API to search users in groups
https://graph.microsoft.com/beta/groups/groupid/members/microsoft.graph.user?$count=true&$orderby=displayName&$search="displayName:sr"&$select=displayName,id
ConsistencyLevel: eventual

Related

Show logged in user's case details in IBM Case Manager

I am creating a Healthcare solution in IBM Case Manager Case Builder. I have a role called 'Patient'. I would like to show the case details of the patient when they log in. Is there any way I can show the case details when the patient logs in.
I have another role called 'Doctor', who can view the case details of any patient by clicking the link in the row of the list of returned search results on searching the patient. However, on the patient side, there is no search and they have to see their case details as soon as they log in.
If someone could point me in the right direction regarding this, I would really appreciate it.
Thanks in advance.
Allright, i guess there are many ways to accomplish this, but having thought about it a few minutes, here's a suggestion.
a. Create a script-adapter on the landing page (Case Manager page).
While it would be more intuitive to connect to the ecm.moel.desktop.onLogin event, the onLogin is within the navigator scope, and we need to be sure that ICM was started because we need to acces role info / ICM api. By using a scriptadapter on the landing page, we not only ensure the ICM context/api is loaded, but we'll also be able to use the ICM api to retrieve a case, and open it...
b. In the script adapter, do your role check; this can be done through:
var role = ecm.model.desktop.currentRole.name; (see this blog)
c. If the role is patient, find out the case(id's) you want to open; you might want to query using the ecm.model.SearchQuery or you could construct a pluginservice (see this redbook on services).
d. With the result of c, you'd then be able to open the case-page using the OpenCase event with a corresponding payload.
var caseId = "the id resulting from c.";
this.getSolution().retrieveCase(caseId, lang.hitch(this, function(caseFolder) {
this.onBroadcastEvent ('icm.OpenCase', {
"caseEditable": caseFolder.createEditable(),
"coordination": new icm.util.Coordination()
});
});

How to find user's and groups accociated to a particular Content in ektron?

Am am working on ektron 9.0.
Suppose i have a content in workarea, and had permissions to some users and groups.
How can i find the user's and groups associated with that particular content by ektron api?
Any help on this..
Thanks in advance
Try this
var permissionManager = new PermissionManager(ApiAccessMode.Admin);
var criteria = new PermissionCriteria();
criteria.AddFilter(PermissionProperty.ContentId, CriteriaFilterOperator.EqualTo, contentId);
List<UserPermissionData> permissionDataList = permissionManager.GetList(criteria);
The list of UserPermissionData objects contains a UserId property so you can see what users have permission to that content item. More info can be found in Ektron's documentation.

Rally request user story

We are using Rally Agile tool and Im trying to request all User Strories expecting to get list like:
S12
S13
S53
etc.
when I use [rally-server-address]/slm/webservice/v2.0/hierarchicalrequirement.js I receive list of:
US12
US43
etc.
Maybe I do not understand how to query User Stories clearly... Any help are really appreciated.
Could you elaborate on what is the problem with US12 US43 etc ? Is it the order? If you want the user stories to be ordered by FormattedID, you may specify it using order parameter, &order=FormattedID:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/1111&query=&start=1&pagesize=200&&fetch=FormattedID,ScheduleState&order=FormattedID
If you want your user stories prefix to be 'S' instead of 'US', Work Product Prefixes can be changed on a workspace level in Setup. Workspace administrator rights are necessary.
Also, when using v2.0 there is no need to have .js in the query.

Retrieving Interest/Page information out of facebook

Im wondering if there is anyway to interogate facebook data on user interests. i.e. Retrieve the following data sets:
What are the most like interests/Pages on facebook?
Retreive the current users facebook interest and also their friends interests?
Really want to know if we can get facebook global interest/like data and than also if the user connects their facebook account to the site than we can also retrieve their interest data.
Thanks in advance
So you want to implement something like http://www.socialbakers.com/ ?
To get 1) you'd have to periodically poll the API for the public fan count of a known set of page IDs to see the current fan counts ( i think this is what socialbakers do)
To get 2, get the user_likes and friend_likes extended permissions from your users and access the /likes connection of the users whose likes you want to read
Yes you can retrieve user interests from facebook. You just need to include the user_interests permission required in your jsp page.
https://developers.facebook.com/tools/explorer/
If you are using spring social you can generate your own url for /me/interests:
URIBuilder uriBuilder1 = URIBuilder.fromUri(facebook.GRAPH_API_URL + "me" +"/interests");
String s = facebook.restOperations().getForObject(uriBuilder1.build(), String.class);

Use custom function to populate gSpreadsheet cell based on a XML/JSON response

Ok, this one has become a little tricky for me and I really need some assistance to work through it.
Problem
I have a GSpreadsheet which has a list of data, in this case Twitter usernames. Using the API of a service provider (in this case the Klout API), I would like to retrieve information about that user to populate a cell within a spreadsheet.
Based on what I can work out so far, I would need to write a custom function to do this but I have no idea where to start, how I might construct it, or if there are any examples of doing this.
Scenario
The Klout API can return either an XML or JSON response (see http://developer.klout.com/docs/read/api/API), based on the string passed. For example, the URL:
http://api.klout.com/1/users/show.xml?key=SECRET&users=thewinchesterau
would return the following XML response:
<users>
<user>
<twitter_id>17439480</twitter_id>
<twitter_screen_name>thewinchesterau</twitter_screen_name>
<score>
<kscore>56.63</kscore>
<slope>0</slope>
<description>creates content that is spread throughout their network and drives discussions.</description>
<kclass_id>10</kclass_id>
<kclass>Socializer</kclass>
<kclass_description>You are the hub of social scenes and people count on you to find out what's happening. You are quick to connect people and readily share your social savvy. Your followers appreciate your network and generosity.</kclass_description>
<kscore_description>thewinchesterau has a low level ofinfluence.</kscore_description>
<network_score>58.06</network_score>
<amplification_score>29.16</amplification_score>
<true_reach>90</true_reach>
<delta_1day>0.3</delta_1day>
<delta_5day>0.5</delta_5day>
</score>
</user>
</users>
Based on this response, I would like to be able to populate different cells with the values returned within the XML (or JSON if easier) packet.
So, for example, I would have a spreadsheet like the following which would have custom functions to go out and retrieve the value of the relevant XML element response to populate the cell:
Cell A B C D E
1 Username kscore Network score Amplification score True reach
2 thewinchester =kscore(A2) =nscore(A2) =ascore(A2) =tscore(A2)
Questions
Are there any gSpreadsheet examples you know of that use an API to pull data in from an external source?
How would one write a custom function to fetch the result from the API and populate a cell with a result of a specific element?
Any information, examples or helpers you have are greatly appreciated.
You want the importXML function, documented here. The formula you want will look something like this:
=importXML("http://api.klout.com/1/users/show.xml?key=SECRET&users=" + A1, "//users/user/score/kscore")
You could write a custom script with Google AppScript, but there's a simple solution to this similar to what Nick Johnson posted. I've tested this against the score function, but it could be easily adapted to the show endpoint with different XPath.
=importXML("http://api.klout.com/1/klout.xml?users="&A1&"&key=YOUR_API_KEY", "//users/user/kscore")
This presumes your Twitter IDs are in the A column.
Note, Google Docs limits the number of such importXML functions to 50 per spreadsheet. You could concatenate groups of 5 userids for each importXML call, effectively putting your limit to 250 a sheet.
This could also be adapted to a similar call in Excel that doesn't have that limit. Keep in mind the Klout ToS, though, using proper attribution and rate limits.