QR code to update spreadsheet

2019-09-18 09:44发布

问题:

I'm trying to update a spreadsheet using a QR code to mark attendance and I'm stuck halfway. I started with a Google Sheets script update method where a form posts into a spreadsheet. So far that's working fine:

// fire off the request to the form
request = $.ajax({
    url: "https://script.google.com/macros/s/[ID]/exec",
    type: "post",
    data: serializedData
});

Since the script allows for GET requests as well, I'm trying to use cURL to send the data in the form of a URL which I can encode as a QR, which looks similar to this other answer:

curl "https://script.../exec?FirstName=John&LastName=Fields"

However, I get a 302 response saying that the page has moved temporarily to https://script.googleusercontent.com/macros/echo?user_content_key=...

Trying to curl the data to this script.googleusercontent.com URL with the --data argument produces a webpage with a "Sorry, unable to open the file at this time."

Has anyone successfully produced a curlable URL?

By the way, I'm also looking at AJAX post to google spreadsheet which references Hawksey too. If I can find something from there that works, I'll update.