0
votes

i have created a google service account, created a keyfile (key.json) and now I want to create a googlesheet using postman

https://sheets.googleapis.com/v4/spreadsheets?scope=https://www.googleapis.com/auth/spreadsheets&private-key-file=c:\temp\key.json

But I keep getting a 401 error - missing required credential

{
    "error": {
        "code": 401,
        "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" } }

what's the syntax to pass the key file in the url/header or body ? thanks !

1
Hi, the error message you provided says you need a 0Auth 2 token. Have a look at the authorization tab on your request. In the type drop down you can select 0Auth 2. You can also check the postman documentation. - PixelPlex
What are you trying to do? Why are you using postman? I can offer you a good assistance if you explain me the general purpose you have. - fullfine

1 Answers

0
votes

enter image description here

just goto authorization header and add the key and value as api key and select add in as "query parameter"

You can also manually add key and value as query parameter

enter image description here

Both does the exact same thing