0

I want to store my json object to google drive. And google authentication is working fine. But when I am calling google drive api, it returns 401 error.

Error Screenshot

I set authentication, content-type, and content-length to api headers. Not sure why this happen.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449

1 Answers1

0

401: Invalid Credentials Invalid authorization header. The access token you're using is either expired or invalid.

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "authError",
        "message": "Invalid Credentials",
        "locationType": "header",
        "location": "Authorization",
      }
    ],
    "code": 401,
    "message": "Invalid Credentials"
  }
}

Suggested action: Refresh the access token using the long-lived refresh token. If this fails, direct the user through the OAuth flow, as described in Authorizing Your App with Google Drive.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449