I'm really confused how to write to an excel sheet, that is public. So far I have downloaded Alamofire and GoogleAPIClientForREST cocoapods. So I was wondering, if I want to write to the sheet do I first need to implement a google sign in or can I just send data over using Alamofire. I am super lost so If someone can help me that would be great.
Google sheet: https://docs.google.com/spreadsheets/d/1zJR0uk6Pb6BuxJihFyxwe4ipQdBY4E9FFR74geBj8p0/edit#gid=0
func makeAndSendRequest() {
let baseUrl = "https://sheets.googleapis.com/v4/spreadsheets"
let spreadsheetId = "1zJR0uk6Pb6BuxJihFyxwe4ipQdBY4E9FFR74geBj8p0"
let params = ["valueInputOption": "RAW"]
let range = "Studen!A3:B3"
//need to add params
let url = baseUrl + "/" + spreadsheetId + "/values/" + range + "/valueInputOption=RAW/"
let fullUrl = URL(string: url)!
//my values
let requestParams = [
"values": [
1,
2
]
]
//my auth is after Bearer so "Bearer 901390"
let header = ["Authorization":"Bearer "]
let requestURL = "https://sheets.googleapis.com/v4/spreadsheets/\(spreadsheetId)/values/\(range)?valueInputOption=RAW"
let req = Alamofire.request(requestURL, method: .put, parameters: requestParams, encoding: JSONEncoding.default,headers: header)
req.responseJSON { response in debugPrint(response) }
}