Skip to content

Instantly share code, notes, and snippets.

@sj82516
Created June 13, 2018 02:38
Show Gist options
  • Select an option

  • Save sj82516/1e601a3af02f83bb2b131fb2127c3df7 to your computer and use it in GitHub Desktop.

Select an option

Save sj82516/1e601a3af02f83bb2b131fb2127c3df7 to your computer and use it in GitHub Desktop.
return axios.post(
encodeURI(
`https://sheets.googleapis.com/v4/spreadsheets/${local.spreadsheet_id}:batchUpdate`
), {
"requests": [{
"insertRange": {
"range": {
"sheetId": local.sheet,
"startRowIndex": 3,
"endRowIndex": 4
},
"shiftDimension": "ROWS"
}
},
{
"pasteData": {
"data": data.join(","),
"type": "PASTE_NORMAL",
"delimiter": ",",
"coordinate": {
"sheetId": local.sheet,
"rowIndex": 3,
}
}
}
]
}, {
headers: {
'Authorization': `Bearer ${accessToken}`
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment