How do I make an API request through Node.JS?

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)?

  1. module.exports = async function (context, basicIO )
  2. {
  3. const baseURL = basicIO.getParameter("URL");
  4. axios(baseURL)
  5.     .then(resp => resp.json())
  6.     .then(data => 
  7.     basicIO.write(data)
  8.     );
  9. }

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方