react-native-oauth icon indicating copy to clipboard operation
react-native-oauth copied to clipboard

Writing values to google sheet

Open tamirla opened this issue 8 years ago • 3 comments

I'm trying to write values to google sheet using makeRequest with 'https://sheets.googleapis.com/v4/spreadsheets/' api. I can read values successfully, however didn't figure how to use PUT method that will be equivalent to the following request:

PUT https://sheets.googleapis.com/v4/spreadsheets/sheetId/values/Sheet1!I2:J2?valueInputOption=RAW

{values : [["123", "456"]]}

I tried the following:

manager.makeRequest('google', requestUrl, { method : 'put', params : { values : [["123", "456"]] } })

But it's not working. Can you please explain if this is possible & demonstrate how to write the appropriate request ?

Thanks.

tamirla avatar Sep 17 '17 07:09 tamirla

@tamirla did you ever figure out a solution?

gonzalezchris avatar Nov 11 '17 06:11 gonzalezchris

@gonzalezchris my solution was to use https://github.com/adamjmcgrath/react-native-simple-auth instead :)

Notice however it also has an open issue:

https://github.com/adamjmcgrath/react-native-simple-auth/issues/83

but this one at least has a workaround.

tamirla avatar Nov 11 '17 09:11 tamirla

@gonzalezchris to be more specific - I used simple-auth just for authentication, and used rest api for all other operations.

tamirla avatar Nov 11 '17 10:11 tamirla