none
Permission is not able migrate to One Drive RRS feed

  • Question

  • I am trying to migrate permission from google domain to ONE Drive using following http request

       string driveUrl = "https://graph.microsoft.com/v1.0/me/drive /items/{p_strItemID }/invite";

    where p_strItemID  is my ONE Drive Item ID.

     HttpWebRequest httpRequest           = (HttpWebRequest)WebRequest.Create(webUrl);
                   httpRequest.Timeout         = 1000000;
                   httpRequest.ContentType   = "application/json";
                   httpRequest.Method          = "POST";

                   httpRequest.Headers.Add("Authorization", Token);

    where Token is access token.

           using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
                   {
                       string json = "{\"recipients\":" + "[{" + "\"email\":" + p_strRecepientEmailAdder + "}]," +
                                      "\"message\":" + "Here's the file that we're collaborating on." + "," +
                                      "\requireSignIn\":" + " true," +
                                      "\"sendInvitation\":" + " true," +
                                      "\roles\":" + "[\"" + p_strRole + "\"]}";

                       streamWriter.Write(json);
                       streamWriter.Flush();
                       streamWriter.Close();
                   }

                                                       

                 //get http response
                   using (HttpWebResponse httpResponse = (HttpWebResponse)(httpRequest.GetResponse()))
                   {
                       using (Stream stream1 = httpResponse.GetResponseStream())
                       {
                           using (StreamReader strmVal = new StreamReader(stream1))
                           {
                               responseContent = strmVal.ReadToEnd();

                               //extract refresh token and access token to perform API request.




                           }
                       }
                   }

    I get exception as bad request while getting httpResponse.

    can we add permission for other organization user to ONE Drive ?

    If yes then how to add permissions for other organization user to ONE Drive ?

    Friday, September 22, 2017 12:52 PM