I want to create a new spreadsheet in Google Drive, using the V4 REST API in Javascript. I can write data to an existing one, since I have an id, like this, once oauthed:

```
var accessToken=gapi.auth.getToken().access_token;
var str="https://sheets.googleapis.com/v4/spreadsheets/"+id+"/values/Sheet1!A1:E50?valueInputOption=USER_ENTERED";
var xhr=new XMLHttpRequest();
xhr.open("PUT",str);                                                                
xhr.setRequestHeader('Authorization','Bearer '+ accessToken);
xhr.send(JSON.stringify(data));

```

But I don't know how to create one from scratch in Javascript.