# Google Sheets API returns "401 - Unauthorized error"

**URL:** <https://community.parabola.io/t/google-sheets-api-returns-401-unauthorized-error/2769>\
**Category:** Ask a question\
**Created:** [July 23, 2023, 6:57pm UTC](https://community.parabola.io/t/google-sheets-api-returns-401-unauthorized-error/2769 "2023-07-23T18:57:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Natany\_Caxeta](https://avatars.discourse-cdn.com/v4/letter/n/f6c823/32.png) [@Natany\_Caxeta](https://community.parabola.io/u/Natany_Caxeta)\
**Post date:** [July 23, 2023, 6:57pm UTC](https://community.parabola.io/t/google-sheets-api-returns-401-unauthorized-error/2769/1 "2023-07-23T18:57:57Z")

</div>

I’m trying to append rows to a Google Sheet using the native API, I have correctly configured the OAuth 2.0, It works correctly with static input but when I try to make it dynamic It’s not working returning the error message “401 - Unauthorized error”.

```auto
{
  "error": {
    "code": 401,
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "domain": "googleapis.com",
        "metadata": {
          "method": "google.apps.sheets.v4.SpreadsheetsService.AppendValues",
          "service": "sheets.googleapis.com"
        },
        "reason": "CREDENTIALS_MISSING"
      }
    ],
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "status": "UNAUTHENTICATED"
  }
}

```

 ![Screenshot 2023-07-23 at 11.46.02 PM](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/8/85fa735fdd2562e10f9bd194f8a2cfe520b1b8af.png)
