Vinit Poojary
Vinit Poojary

Reputation: 179

Unable to create in google spreadsheets

I was trying google APIs to create a new sheet but I am unable to achieve the goal

the error I am getting is

Invalid spreadsheet. spreadsheet: This user did not create this id.

so I thought I am doing something wrong did some research I got this link (https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/create) and tried it here (Try it! button) it gives the same error

{
  "error": {
    "code": 400,
    "message": "Invalid spreadsheet.spreadsheetId: This user did not create this id.",
    "status": "INVALID_ARGUMENT"
  }
}

What am I doing wrong?

Upvotes: 0

Views: 159

Answers (1)

Frenchcooc
Frenchcooc

Reputation: 1080

Just performing the following request will create a spreadsheet:

POST https://sheets.googleapis.com/v4/spreadsheets

No need to pass something in the body. The documentation is a bit confusing on that point as it says you should send an instance of Spreadsheet in the request body. But you don't have to.

Upvotes: 2

Related Questions