How to get the access token to use in sheets REST API?

Hi Team,

I'm trying to use spreadsheets REST API (https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create )  to create and write some data to a spreadsheet. The REST API requires an access token in the headers. How do I get the access token?

```

curl --request POST \
'https://sheets.googleapis.com/v4/spreadsheets?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{}' \
--compressed

```

Thanks,

Arun

1 1 5,319
1 REPLY 1

Hi Arun,

At the bottom of the API reference page that you talk about (https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create ) there is a link to the "Authorization guide" which provides the information you are looking for.

Top Labels in this Space
Top Solution Authors