getting improper statement error when using invokeUrl

getting improper statement error when using invokeUrl

greetings

i created a custom connection with zoho expense and i wanted to start manipulating records in expense using the connection and the invokeUrl method..
my function looks like this:

  1. void createExpense()
  2. {
  3. data = Map();
  4. data.put("date","2022-12-01");
  5. data.put("account_id","3599281000000000445");
  6. data.put("amount",1000);
  7. data.put("paid_through_account_id","3599281000000000361");
  8. data.put("description","Salary payment for employee Test Employee");
  9.   response = invokeUrl
  10.   [
  11.   url : https://expense.zoho.com/api/v1/expenses
  12.   type : POST
  13.   parameters : data
  14. headers: "Content-type:application/json"
  15.   connection : "test_expense_connection"
  16.   ]
  17. }

but when i try to save my function before running it i keep getting the improper statement error on line 9 where i'm using the invokeUrl. what am i doing wrong? what's causing this?

Thanks

    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 コンテンツ




                              ご検討中の方