最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

security - Is there a way to generate the authorization url for the importdata function to run? - Stack Overflow

programmeradmin4浏览0评论

I have a script set up to generate a spreadsheet we use when a new file is created in a particular folder. It uses the importdata() function in google sheets.

Recently google sheets updated their permissions (I was wondering when this was going to happen) to disallow the importdata() function until it's authorized (the importdata function we use has URL parameters). The problem is that the initial use of the spreadsheet is frequently via the mobile app and the authorization button doesn't show for the mobile user to authorize the app.

To be clear:

  1. this button that is displayed on the desktop only and my issue is that the first use is often via mobile.
  2. It is authorizing the Spreadsheet to send/receive data and NOT the underlying apps script. Even if the underlying apps script has the ability to send/receive, the spreadsheet will not allow the importdata() function to work (particularly if it has URL parameters)

The URL that this authorization button posts to is: /{spreadsheetID}/externaldata/allowexternalurlaccess?token={token}&includes_info_params=true&usp=drive_fs&cros_files=false

I have tried generating this URL in apps script for the user to click on but it needs to be a post and not a get request. A get request to the URL returns a 404 error.

This issue should be easily duplicated by opening a new google sheet and adding the importdata() function to a cell with a URL with URL parameters.

发布评论

评论列表(0)

  1. 暂无评论