Overview
HI!
Sometimes ago I tried making an http request from Google Sheets but I failed to do so now I am trying to do it again but getting some unexpected results.
What I did
I have created a Google Sheets and as per this Site I had gathered all the information like spreadsheetId. And I had made my scene tree as follow
Node
->HTTPRequest
->Button
and connected pressed
and request_completed
signals of Button
and of HTTPRequest
respectively to the root.
My code is as follow
extends Node
const spreadsheetId := "<My sreadsheetId>"
const URL := "https://sheets.googleapis.com/v4/spreadsheets/%s/values/Sheet1!A1:D5" %spreadsheetId
func _on_HTTPRequest_request_completed(result, response_code, headers, body):
print(body)
var json = JSON.parse(body.get_string_from_utf8())
print(json.result)
func _on_Button_pressed():
$HTTPRequest.request(URL, [], false, HTTPClient.METHOD_GET)
What I got as result
I had used this method and what I found in my debugger is as follows:-
[PoolByteArray]
{error:{code:403, message:The request is missing a valid API key., status:PERMISSION_DENIED}}
Issue
I don't know what is going on and what should I do. Please guide me! I had done a lot of hard work to format this question
Thanks in advance!