Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UrlFetchApp is not defined

I am calling UrlFetchApp.fetch("www.google.com")

from my chrome javascript code and I am getting:

Uncaught ReferenceError: UrlFetchApp is not defined

Anyone know why it is not defined? I thought it was built in.

like image 591
Paul Sun Avatar asked Oct 20 '14 03:10

Paul Sun


People also ask

What is UrlFetchApp?

UrlFetchApp. Fetch resources and communicate with other hosts over the Internet. This service allows scripts to communicate with other applications or access other resources on the web by fetching URLs. A script can use the URL Fetch service to issue HTTP and HTTPS requests and receive responses.

What is a URL fetch call?

URL Fetch. This service allows scripts to access other resources on the web by fetching URLs. A script can use the UrlFetch service to issue HTTP and HTTPS requests and receive responses. The UrlFetch service uses Google's network infrastructure for efficiency and scaling purposes.


1 Answers

URL Fetch Service and its UrlFetchApp class are part of Google Apps Script - a javascript-based server-side scripting language that allows you to extend Google Apps products like Docs, Sheets and Forms with custom functionality.

UrlFetchApp class is NOT available in client-side javascript, which is what it looks like you are trying to do. You can only use it in server-side Google Apps Script .gs files.

like image 171
azawaza Avatar answered Oct 13 '22 14:10

azawaza