Wrong URL ????

Wrong URL ????

hello,

I have built the interface to the "Calendar".

See attachment 1.

The updating of the token when the time has expired is also successfully implemented. (will be automated later in the query)

Only here I have a problem.
https://www.zoho.com/calendar/help/api/get-calendar-list.html

I have attached my PHP code once as a TXT attachment.
As well as its response as an image. Attachment 2:

"Invalid URL

Unable to process your request as the URL /calendar/api/v1/calendars?category=all&showhiddencal=true is invalid."


What am I doing wrong or is the documentation no longer correct?

Many thanks for your help.

  1. <?php

    function fetch_and_renew_token() {
        $client_id = NMT::sqlObject("SELECT `val` FROM `nmt-cfg` WHERE `key` = 'zoho_client_id'; ")->val;
        $client_secret = NMT::sqlObject("SELECT `val` FROM `nmt-cfg` WHERE `key` = 'zoho_client_secret'; ")->val;
        $refresh_token = NMT::sqlObject("SELECT `val` FROM `nmt-cfg` WHERE `key` = 'zoho_refresh_token'; ")->val;

        if (!empty($client_id) && !empty($client_secret) && !empty($refresh_token)) {
            $url = 'https://accounts.zoho.eu/oauth/v2/token';
            $data = [
                'refresh_token' => $refresh_token,
                'client_id' => $client_id,
                'client_secret' => $client_secret,
                'grant_type' => 'refresh_token'
            ];

            $response = custom_curl_request($url, $data);

            if (isset($response['access_token'])) {
                $access_token = $response['access_token'];
                $expires_in = $response['expires_in'];
                $api_domain = $response['api_domain'];
                $expires_at = time() + $expires_in + 7200; // +2 Stunden

                NMT::sqlDo("INSERT INTO `nmt-cfg` (`key`, `val`) VALUES ('zoho_access_token', '$access_token') ON DUPLICATE KEY UPDATE `val` = '$access_token';");
                NMT::sqlDo("INSERT INTO `nmt-cfg` (`key`, `val`) VALUES ('zoho_token_expires_at', '$expires_at') ON DUPLICATE KEY UPDATE `val` = '$expires_at';");
                NMT::sqlDo("INSERT INTO `nmt-cfg` (`key`, `val`) VALUES ('zoho_api_domain', '$api_domain') ON DUPLICATE KEY UPDATE `val` = '$api_domain';");

                return $access_token;
            } else {
                echo '<div style="color: red;">Fehler bei der Token-Erneuerung.</div>';
                echo '<pre>' . print_r($response, true) . '</pre>';
                return null;
            }
        } else {
            echo '<div style="color: red;">Fehler: Client ID, Client Secret oder Refresh Token fehlen.</div>';
            return null;
        }
    }

    function custom_curl_request($url, $data = [], $type = 'POST', $headers = []) {
        $curlOpts = [
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => TRUE,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2TLS,
            CURLOPT_CUSTOMREQUEST => $type,
            CURLOPT_SSL_VERIFYPEER => FALSE,
        ];

        if ($type === 'POST' && !empty($data)) {
            $curlOpts[CURLOPT_POSTFIELDS] = http_build_query($data);
        }

        if (!empty($headers)) {
            $curlOpts[CURLOPT_HTTPHEADER] = $headers;
        }

        $request = curl_init();
        curl_setopt_array($request, $curlOpts);
        $response = curl_exec($request);
        $curl_error = curl_error($request);
        $http_code = curl_getinfo($request, CURLINFO_HTTP_CODE);
        curl_close($request);

        if ($curl_error) {
            echo '<div style="color: red;">Curl Error: ' . htmlspecialchars($curl_error) . '</div>';
        }

        echo '<div>HTTP Code: ' . htmlspecialchars($http_code) . '</div>';
        echo '<div>Request URL: ' . htmlspecialchars($url) . '</div>';
        echo '<div>Request Headers: ' . htmlspecialchars(print_r($headers, true)) . '</div>';
        
        if ($http_code >= 400 && $http_code < 600) {
            echo '<div>Raw Response: ' . $response . '</div>';
        } else {
            echo '<div>Raw Response: ' . htmlspecialchars($response) . '</div>';
        }

        return json_decode($response, TRUE);
    }

    function fetch_calendars() {
        $access_token = NMT::sqlObject("SELECT `val` FROM `nmt-cfg` WHERE `key` = 'zoho_access_token'; ")->val;
        $api_domain = NMT::sqlObject("SELECT `val` FROM `nmt-cfg` WHERE `key` = 'zoho_api_domain'; ")->val;

        if (!empty($access_token) && !empty($api_domain)) {
            echo '<div>Verwendeter Access Token: ' . htmlspecialchars($access_token) . '</div>';
            echo '<div>Verwendete API Domain: ' . htmlspecialchars($api_domain) . '</div>';

            $url = $api_domain . '/calendar/api/v1/calendars?category=all&showhiddencal=true';
            $headers = [
                "Authorization: Bearer $access_token"
            ];

            $curl_command = "curl -X GET \"$url\" -H \"Authorization: Bearer $access_token\"";
            echo '<div>Curl Command: ' . htmlspecialchars($curl_command) . '</div>';

            $response = custom_curl_request($url, [], 'GET', $headers);

            if (isset($response['calendars'])) {
                echo '<div>Kalender erfolgreich abgerufen:</div>';
                echo '<pre>' . print_r($response['calendars'], true) . '</pre>';
            } else {
                echo '<div style="color: red;">Fehler beim Abrufen der Kalender.</div>';
                echo '<pre>' . print_r($response, true) . '</pre>';
            }
        } else {
            echo '<div style="color: red;">Fehler: Access Token oder API Domain fehlt.</div>';
        }
    }

    if (isset($_POST['fetch_calendars'])) {
        fetch_calendars();
    }

    if (isset($_POST['fetch_token'])) {
        fetch_and_renew_token();
    }
    ?>

    <form method="post" action="">
        <input type="submit" name="fetch_token" value="Fetch-Token" />
        <input type="submit" name="fetch_calendars" value="Kalender abfragen" />
    </form>
    • Topic Participants

    • test

    • Sticky Posts

    • Zoho Calendar 2024: A Year in Review

      Hello, community members! Happy new year from all of us here at Zoho Calendar. As we turn the page to a new year, we extend our heartfelt gratitude to every member of our Zoho Calendar community for your continued support and enthusiasm. Your feedback
    • The year that was at Zoho Calendar 2023- Part 1

      Hello, amazing community members! Happy new year from all of us here at Zoho Calendar. As we begin the new year, we'd like to thank each and everyone of our community members for your unwavering support and love that you have shown for Zoho Calendar.
    • What's new in Zoho Calendar!

      Hello all, Greeting from Zoho Calendar! Hope you are all doing well! We at Zoho Calendar are constantly striving to improve our Calendar to enhance your overall calendaring experience thanks to your insightful suggestions and feedback. In the last few
    • Enhancements to make Zoho Calendar more accessible and handy!

      Hello, Community! Hope you're all doing well! Zoho Calendar have come across a major revamp a year back. Since then the feedback and suggestions given by you made us to improve and enhance Calendar, to make it more accessible and user friendly. We've
    • Important announcement: Deprecation of Zoho Calendar's old interface

      Hello All! Thank you all for the amazing welcome to the release of the new Calendar. Here are some comments about the new interface that motivated us:  Many of our users who were using the older version for a long period, loved the new Calendar, as it

    Nederlandse Hulpbronnen


      • Recent Topics

      • Button to add product to cart

        Is there a way to have a button on a page, that when clicked, will add Qty 1 of a product to the cart?
      • Est-il possible d'annuler l'envoi d'un mail automatique ?

        Bonjour, Lorsque je refuse un candidat, il reçois un mail dans les 24h pour l'informer que sa candidature n'est pas retenue. J'ai rejeté un candidat par erreur. Savez-vous s'il possible d'annuler l'envoi de ce mail ? Merci d'avance pour votre aide.
      • Can't change form's original name in URL

        Hi all, I have been duplicating + editing forms for jobs regarding the same department to maintain formatting + styling. The issue I've not run into is because I've duplicated it from an existing form, the URL doesn't seem to want to update with the new
      • New in Cadences: Option to Resume or Restart follow-ups when re-enrolling records into a Cadence, and specify custom un-enrollment criteria

        Managing follow-ups effectively involves understanding the appropriate timing for reaching out, as well as knowing when to take a break and resume later, or deciding if it's necessary to start the follow-up process anew. With two significant enhancements
      • embed a form in an email

        Hello, how to embed a form in an email that populates Zoho CRM cases? I would like to send emails to a selected audience offering something. In the same email the recipients - if interested - instead of replying to can fill in a Zoho CRM form that creates
      • Zoho Bookings - Reserve with Google

        Does Zoho Bookings plan to to integrate with Reserve with Google?
      • How to add Zoho demo site page designs to my Zoho Sites website

        Hi, I would like to add the design from the following demo URLs into my current Zoho website. I have already created two new pages on my site, named “Menu2” and “Menu3.” For the “Menu2” page, I want to use the design from this demo: https://naturestjuice-demo.zohosites.com/menu
      • Digest Août - Un résumé de ce qui s'est passé le mois dernier sur Community

        Bonjour chère communauté ! Voici le résumé tant attendu de tout ce qui a marqué Zoho le mois dernier : contenus utiles, échanges inspirants et moments forts. 🎉 Découvrez Zoho Backstage 3.0 : une version repensée pour offrir encore plus de flexibilité,
      • Global Sets for Multi-Select pick lists

        When is this feature coming to Zoho CRM? It would be very useful now we have got used to having it for the normal pick lists.
      • Text snippet

        There is a nice feature in Zoho Desk called Text Snippet. It allows you to insert a bit of text anywhere in a reply that you are typing. That would be nice to have that option in Zoho CRM as well when we compose an email. Moderation Update: We agree that
      • Kaizen #206 - Answering your Questions | Displaying Related Purchase Orders from Zoho Books in CRM Deals using Queries

        Hello everyone! We're back with another post in the Kaizen series. We're grateful for the feedback we received from all of you! One of the questions we received was "I would like to see the list of Purchase Orders in Zoho Books for a Deal in CRM." We
      • Add Analytics function for Title case (capitalising each word in a string)

        At present, you can only capitalise each word in a string in Analytics during data import. It would be really useful to be able to do this with a formula column, but there is no Title Case function.
      • How to conditionally embed an own internal widget with parameters in an html snippet?

        Hello everyone, I'm trying to create a dynamic view in a page using an HTML snippet. The goal is to display different content based on a URL parameter (input.step). I have successfully managed to conditionally display different forms using the following
      • Introducing AI-powered Assessments & Zoho's native LLM, Zia

        We’ve shipped a cleaner, faster way to create assessments in Zoho Recruit. 🚀 Instead of manually building question banks or copying old templates, you can now generate ready-to-use assessments in just a few clicks, all tailored to the role you’re hiring
      • Sync more than one Workdrive

        Hello Please I'm facing some difficulties since some days. In my company we have many zoho accounts in different organisations. And I have to find a way to sync all these Workdrives. I spend many hours to search it on zoho Workdrive but no solution. Could someone help me ? Any idea how I can achieve it ? Thanks in advance. Regards
      • Zoho writer unable to merge documents to PDF with basic fonts in Hebrew or fonts from my computer

        I created several forms that will be merged into PDF files through Zoho Writer and I am unable to receive the PDF in the basic fonts of the Hebrew language or in the fonts I have on my computer. The writer exports to PDF an exchange font that looks very
      • Base Currency Adjustment Reversal

        Two questions surrounding the base currency adjustments (BCA). I recently ported over from QB so I need to enter the base currency adjustments. In QB, it will calculate the BCA for you at the end of the year and then reverse it at the top of the following year. Makes sense. Does Zohobooks not do this as well? I created a BCA for Dec 31, 2016 but no reversing entry was made Jan 1, 2017. Am I supposed to manually do a reversal? I'm not even allowed to post journals directly to the 'exchange gain loss'
      • Please implement UAE Central Bank FX rates

        Hello, as I understand from your knowledge base, any UAE business account created from September 15, 2018 does not have foreign exchange rates fetched automatically. This is a serious inconvenience and I am not sure why ZOHO has not looked into the ways
      • Unable to enable tax checkboxes

        Hi Zoho Commerce Support, I'm writing to report an issue I'm having with the tax settings in my Zoho Commerce store. I've created several tax rates under Settings > Taxes, but all of them appear with the checkbox disabled. When I try to enable a checkbox,
      • Search Records returning different values than actually present

        Hey! I have this following line in my deluge script: accountSearch = zoho.crm.searchRecords("Accounts","(RS_Enroll_ID:equals:" + rsid + ")",1,200,{"cvid":864868001088693817}); info "Account search size: " + accountSearch.size(); listOfAccounts = zoho.crm.searchRecords("Accounts","(RS_Enroll_ID:equals:"
      • Making digital signatures accessible to all: Introducing accessibility controls in Zoho Sign

        Hi there! At Zoho Sign, we are committed to building an inclusive digital experience for all our users. As part of our ongoing efforts to align with Web Content Accessibility Guidelines (WCAG), we’re updating the application with support that will go
      • Super Admin Access to All Courses and Spaces in Zoho Learn

        Dear Zoho Learn Team, We hope this message finds you well. We are using Zoho Learn extensively for internal and agent training. While managing our courses and spaces, we encountered a significant limitation regarding admin access and course management.
      • Print checks for owner's draw

        Hi.  Can I use Zoho check printing for draws to Owner's Equity?  This may be a specific case of the missing Pay expenses via Check feature.  If it's not available, are there plans to add this feature?
      • [New Release 2024] Create and embed custom capabilities across CRM with Kiosk Studio, our latest no-code tool

        [Update | New series] We've started publishing a series of posts on Kiosk Studio. It's called Kiosk Studio Sessions and you can check out the first one here! [Update | 15 Oct} Session #2 is live! This one will look at how to create a kiosk for your call
      • Revenue Management: #10 Common Mistakes while Recognizing Revenue

        We are at the end of the series on Revenue Management, covering how different businesses recognise revenue. Even with clear standards like ASC 606 and IFRS 15 in practice, businesses often struggle with the nuances of revenue recognition. Especially growing
      • Windows Desktop App - request to add minimization/startup options

        Support Team, Can you submit the following request to your development team? Here is what would be optimal in my opinion from UX perspective: 1) In the "Application Menu", add a menu item to Exit the app, as well as an alt-key shortcut for these menus
      • integarting attachments from crm to creator

        when i tried to integrate pdf attachments from crm to creator via deluge i am getting this error {"code":2945,"description":"UPLOAD_RULE_NOT_CONFIGURED"} the code i used is attachments = zoho.crm.getRelatedRecords("Attachments","Sales_Orders",203489100020279XXX8);
      • Search Option

        🚫 Current Limitation: As of now (September 2025), Zoho FSM lacks a global search functionality, which makes it difficult to quickly: Find specific Work Orders by number or keyword Search for customer records or contact info Locate assets, jobs, or service
      • Mobile Chat Window - Full Screen

        Hello, The mobile chat window takes up the full screen, which is highly confusing for most customers! Using a desktop machine, I see the same happens when reducing the browser width to 800px or below. This suggests that it responsive web design, causing the switch to full screen. Can we fix this very annoying behaviour ourselves using a custom css file? If so, can you please let me know how? Thanks
      • Is it possible to customize ZC Themes?

        I understand you can choose a layout and customize Brand Color, App Header, Menu, and Sub-Menu components, but can you override some of the default theme settings with CSS or a config file? For example, - Table highlight color - Listview auto filter highlight
      • Is it possible to create Custom function-based Lookup field in Zoho CRM

        Is it possible to create a custom function-based lookup field in Zoho CRM? If so, how? Use case: Need to fetch users from Zoho Projects into a dropdown field in Zoho CRM.
      • @mention in comments no notification

        Hi, hope someone can help. When we @mention someone in the comments in Zoho Creator, how is that user notifed as we don't get anything on email or in the app notifications. 
      • Add "Running Balance" column to Account Transaction Reports

        Hello, Currently Zoho Account Transaction Reports give you the opening balance, then lists the transactions, then provides the closing balance.  It would be great if you could add a column on the far right that shows the "Running Balance" on the account after each transaction.  There are many times when analyzing or tie-ing out transactions that this would be very helpful.  I currently have to frequently run a tape on my adding machine to get balance totals after a specific transaction on the list.
      • Unified customer portal login

        As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
      • WhatsApp Channels in Zoho Campaigns

        Now that Meta has opened WhatsApp Channels globally, will you add it to Zoho Campaigns? It's another top channel for marketing communications as email and SMS. Thanks.
      • error : Object code : 6500

        b3 = map(); b3.put("name", "Test Project Name"); updateprojects2 = invokeurl [ url :"https://projectsapi.zoho.eu/restapi/portal/era0130/projects/169495000000928007/" type :PUT parameters: b3 connection:"in2" ]; info b3 ; info updateprojects2; ------------
      • How to book GST paid in zoho books

        hi, i am a new user to Zoho books and not able to book GST paid in books, kindly suggest how i can book it in books. thanks, siddharth
      • I got unknown charge from Zoho

        Good day, I need help disputing a charge I don't know from, zoho. I have ZohoMail and ZeptoMail. I purchase credits for ZeptoMail, and for ZohoMail I am not subcribed.
      • How can I see content of system generated mails from zBooks?

        System generated mails for offers or invices appear in the mail tab of the designated customer. How can I view the content? It also doesn't appear in zMail sent folder.
      • Function 56: Automatically enable the option for customers to pay via bank account

        Hello everyone and welcome back to our series! One of the key features of Zoho Books is its integration with multiple payment gateways, allowing you to receive online payments for your invoices. This ensures faster payments, automates payment tracking
      • Next Page