How do I make an API request through Node.JS?
In Zoho creator, I created a function that uses nodeJS. In the function, I'm making an API call to an outside URL using a fetch request. The problem is that whenever I run it, it says that "fetch" is not a function at module.exports. I've also tried it with an axios request but that doesn't work either. I see that there's a node_modules folder so I'm trying to put the axios module inside but it only allows me to upload files and not entire folders. How do I go about making an API call in NodeJS (in Zoho creator)?
- module.exports = async function (context, basicIO )
- {
- const baseURL = basicIO.getParameter("URL");
- axios(baseURL)
- .then(resp => resp.json())
- .then(data =>
- basicIO.write(data)
- );
- }
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.