title: Can't get the UploadURL from Microsoft Graph in Upload Session
body: <p>I have been trying to implement the following procedure with python</p>
  
  <p><a href="https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online#create-an-upload-session" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online#create-an-upload-session</a></p>
  
  <p>I have been trying to get the upload URL part</p>
  
  <p>Please note that I already got the access token and created the required client Id and secret</p>
  
  <pre><code>    def getUploadUrl(filename="test.txt"):
          global token
          if (not token):
              with open('token.json', 'r') as f:
                  token = json.load(f)
          if (token["expires_at"] &lt; time.time()):
              refreshToken()
          location = "/me/drive/root:/FolderA/" + filename + ":/createUploadSession"
          client = OAuth2Session(client_id=client_id,
                                 redirect_uri=REDIRECT_URI, token=token)
  
          headers = {'Content-Type': 'application/json'}
  
          json_file = {
              "item": {"@odata.type": "microsoft.graph.driveItemUploadableProperties",
                  "@microsoft.graph.conflictBehavior": "replace",
                  "name": filename
              }
          }
          json_string = json.dumps(json_file, indent=4)
          r = client.post(BaseUrl + location,
                          data=json_string, headers=headers)
          print(r.status_code)
          print(r.text)
          upload_url = ""
          if(r.status_code == 200):
              upload_url = r.json()['uploadUrl']
              return upload_url, r
          else:
              return "", ""
  </code></pre>
  
  <p>I keep getting the following Error response though </p>
  
  <pre><code>{
   "error": {
    "code": "invalidRequest",
     "message": "Invalid request",
      "innerError": {
       "request-id": "7893d0aa-fcdb-46bc-b0b6-58fd90c4cb46",
        "date": "2020-03-21T17:15:13"
      }
    }
  </code></pre>