+ body = {
+ "name": name,
+ "parents": [folder_id],
+ "mimeType": "application/vnd.google-apps.spreadsheet"
+ }
+
+ spreadsheet = turb.files.create(body=body, fields='id').execute()
+ id = spreadsheet['id']
+
+ # The files.create call gives us the ID for our new sheet, but we
+ # need the URL for it as well. So we get that with the sheets API.
+ spreadsheet = turb.sheets.get(spreadsheetId=id,
+ fields='spreadsheetUrl').execute()
+ url = spreadsheet['spreadsheetUrl']
+
+ # Finally, we want to also allow anyone with the link to the sheet
+ # to be able to edit it.
+ turb.permissions.create(fileId=id,
+ body={'type': 'anyone', 'role': 'writer'},
+ fields='').execute()