SHARE
TWEET

Untitled

a guest Feb 18th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static async Task<Users> searchUsers(string token, string search)
  2.     {
  3.         string query = String.Format("https://graph.microsoft.com/v1.0/users?$filter=startswith(displayname,'{0}') or startswith(surname,'{1}')", search, search);
  4.         string users = null;
  5.         httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
  6.         HttpResponseMessage response = httpClient.GetAsync(query).Result;
  7.         users = response.Content.ReadAsStringAsync().Result;
  8.         Users usersJson = JsonConvert.DeserializeObject<Users>(users);
  9.         return usersJson;
  10.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top