Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static async Task<Users> searchUsers(string token, string search)
- {
- string query = String.Format("https://graph.microsoft.com/v1.0/users?$filter=startswith(displayname,'{0}') or startswith(surname,'{1}')", search, search);
- string users = null;
- httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
- HttpResponseMessage response = httpClient.GetAsync(query).Result;
- users = response.Content.ReadAsStringAsync().Result;
- Users usersJson = JsonConvert.DeserializeObject<Users>(users);
- return usersJson;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement