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
      • Recent Topics

      • API to post drafts for social media

        I we want to post draft posts to our zoho social account and then approve and schedule them within Zoho social. is this possible with for example: https://apis.zoho.com/social/v2/post TIA Jon
      • Canvas View in Zoho Recruit

        Is it possible or would it be possible to have the new 'Canvas View' in Zoho Recruit?
      • What impactful sales coaching techniques have you used to boost your team's performance?

        I'm curious about the real-world impact of sales coaching on team performance. What specific techniques or strategies have you found most effective in driving consistent improvement and growth in your sales team? Any success stories or lessons learned
      • Adding Taxes to paid consultations in Zoho Bookings

        I created a 'paid' consultation under Zoho Booking and integrated it with payment gateways for online/instant payment before a booking is done. How can I add 'taxes' to the price of consultation? I can add taxes to other Zoho apps (liks Books, Checkout,
      • Zoho Finance Suite - Customer Custom Tabs - Dynamic Link

        Hi Finance Suite team, When creating a Custom Tab for a Client Portal, there is no option to add dynamic parameters. This would be very helpful for adding Zoho Analytics dashboards which can be dynamically filtered through the URL to only show information
      • Possible to bold or indent text in the description field?

        As part of one item, I often have a detailed description that would be much easier to read if there was the ability to have a bulleted list or bold text and the like. Is this possible? My last invoicing software allowed markup in the field so, for example, an asterisk meant a bullet. I haven't been able to find any documentation related to this.  Any information would be appreciated. Thank you.
      • How can I setup Zoho MCP with Chat GPT

        I can set up custom connections with Chat GPT but I cat an error when I try to set it up. The error is: "This MCP server can't be used by ChatGPT to search information because it doesn't implement our specification: search action not found" Thoughts?
      • Formatting of Balance Sheet and Profit & Loss Reports

        The default format of the Balance Sheet and P&L Reports are based on the Account Types and then the individual accounts within the Chart of Accounts. These are then ordered alphabetically under these sub-headings and one is unable to re-order these or
      • UK MTD reports concerning turnover and cerash accounting

        Hi I am a sole trader, and I have just started with Zoho Books in order to comply with the new HMRC requirements. I use 'cash basis' - which I understand to mean that income is when the cash comes in (not the invoice date) and expenses are when they are
      • Retainer Invoice.

        Why ZOHO not have facilities to deduct partially advance payment from an invoice.
      • IMAP Server not responding.

        Trying to connect a phone via IMAP and getting "imap.zoho.com not responding." Is the server down, for maintenance or otherwise? I've tried this on two different devices and got the same error on both.
      • Share saved filters between others

        Hi, I am in charge to setup all zoho system in our company. I am preparing saved filters for everybody, but the only one can see its me. How can others see it? Thanks
      • Kanban view on Zoho CRM mobile app!

        What is Kanban? The name doesn't sound English, right? Yes, Kanban is a Japanese word which means 'Card you can see'. As per the meaning, Kanban in CRM is a type of list view in which the records will be displayed in cards and categorized under the given
      • Presenting ABM for Zoho CRM: Expand and retain your customers with precision

        Picture this scenario: You're a growing SaaS company ready to launch a powerful business suite, and are looking to gain traction and momentum. But as a business with a tight budget, you know acquiring new customers is slow, expensive, and often delivers
      • No practical examples of how survey data is analyzed

        There are no examples of analysis with analytics of zoho survey data. Only survey meta data is analyzed, such as number of completes, not actual analysis of responses, such as the % in each gender, cross-tabulations of survey responses. One strange characteristic
      • Zoho Creator as LMS and Membership Solution

        My client is interested in using Zoho One apps to deploy their membership academy offer. Zoho Creator was an option that came up in my research: Here are the components of the program/offer: 1. Membership portal - individual login credentials for each
      • Adding Chargebee as a Data Connector

        Is it possible to get Chargebee added as a Zoho Analytics data connector?
      • Webform & spam

        Hi, We set up 2 webform on our website, fowarding the content to Zoho CRM. Since it has been opened up, we are getting lot of spam message (for now about 20 a day). To lower the  amount of false new leads we added the captcha field and new enquieries are send to the Approval Leads list. However we still get some spam. Is there any "anti spam" mechanism built in Zoho CRM, or how is the best way to avoid these kind of spam ? Thanks
      • Dropbox to Workdrive

        Namaste, Trust you all are doing well. Wanted to check how this can be done with Zoho flow. I typically receive dropbox links from my clients. Is there a way where I can provide the link to Zoho flow and it downloads the files from dropbox link to a work
      • Deals by Stages Funnel not showing in correct order

        Using the Stage-Probability Mapping for the Deals module we have created a steps our deals will pass through, RFQ, Closed/Lost, Declined/No-Go, Pricing, Submitted, Negotiations, Won. However when I view the Deal By Stages Funnel it does not show in the
      • Turning off the new UI

        Tried the new 'enhanced' UI and actively dislike it. Anyone know how to revert back?
      • Confirmation prompt before a custom button action is triggered

        Have you ever created a custom button and just hoped that you/your users are prompted first to confirm the action? Well, Zoho knows this concept. For example, in blueprint, whenever we want to advance to the next state by clicking the transition, it is
      • How to create auto populate field based on custom module in Zoho CRM?

        Hello, i'm still new to Zoho CRM and work as administrator in my company. Currently, I'm configuring layout for Quotes Module. So, the idea is, I've created a read-only field in Quotes called "Spec". I want this field automatically filled with Specification
      • Rich Text For Notes in Zoho CRM

        Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
      • Change Last Name to not required in Leads

        I would like to upload 500 target companies as leads but I don't yet have contact people for them. Can you enable the option for me to turn this requirement off to need a Second Name? Moderation update (10-Jun-23): As we explore potential solutions for
      • Office 365 and CRM mail integration: permission required

        Has anyone run into this weird problem? My email server is Office 365. When I try to configure Zoho CRM to use this server, a Microsoft popup window opens requesting user and password. After entering that, I get a message in the Microsoft window saying
      • Tables improvement ideas / features

        Heya, I've been using Zoho Tables for a few months now and wanted to post some features that I think will be greatly beneficial for the tool: 1. Ability to delete a record in automation or move a record in automation. - Usecase: I move a record from one
      • Deluge - Can't get phone number SalesIQ

        Hey folks, I’m building a custom plug for SalesIQ that’s supposed to register leads into Zoho CRM. The SalesIQ chat is being implemented on WhatsApp, and in my plug I’m using this line: mobile_clean = session.get("phone").get("value"); From what I understand,
      • Zoho Desk - Community

        As a regular user of Zoho Cares Community I would really love to see the publish date of articles. For example, when I look at Announcements, it would be very beneficial to see which ones were posted recently, over those which have just and a recent comment.
      • access to quartz for my customers

        Hi how can I have access to the application quartz you use for us to send you screen rocording, this feature would be immensely useful for our customers support https://quartz.zoho.com/
      • Issue with Inline Images in Email Reply via Zoho Desk API

        Hi, I am attempting to send inline images in an email reply using the Zoho Desk API, but the images are not being displayed inline for the recipient. I have followed this documentation: https://desk.zoho.com/DeskAPIDocument#Uploads https://desk.zoho.com/DeskAPIDocument#Threads#Threads_SendEmailReply
      • How to search a value stored in a subform?

        Hello, We store serial numbers in subforms but now we would like to be able to search the values to be able to easily find the record with the serial number. I saw that it's not possible to search such values through global search but is it possible to do it an other way? Thank you,
      • Field Dependency Not Working on Detail Page in Zoho Desk

        Hi Support Team, I’ve created field dependencies between two fields in Zoho Desk, and they are working correctly on the Create and Edit layouts. However, on the Detail page, the fields are not displaying according to the dependencies I’ve set — they appear
      • How do the keyword critera work?

        Hi, I'm working on automated assignment of tickets based on keywords. How does this feature work? Where does this criteria look for keywords - email address, subject, email body? Can you please clarify this as I want to avoid overlapping with criteria
      • Error: Unsupported content type: text/html;charset=UTF-8 after tryeing to get the token for n8n automation

        I am working on ZOHO Desk automation and need to get the ZOHO auth token for n8n I have created the app in ZOHO Desk API, got client id and client secret. Added all data required to get a token in n8n. After I sign in with my ZOHO credentials in ZOHO
      • Improving Collaboration Features in Zoho Portal

        Hello Zoho Community, I’ve recently started exploring Zoho services and I’m really impressed with the wide range of features. However, I feel there is still room for improvement in the collaboration area. For example, it would be really helpful if we
      • Automated Shopify Emails Not Being Delivered

        I have an ecommerce store with Shopify. I recently set up my email to be served through Zoho. Since doing this, customers are not receiving some of our automated emails from Shopify itself. Our initial email that confirms their purchase goes through but our Shipping Notification that is automatically sent out upon fulfillment is not going through. Sometimes we get a notice that it's been classified as spam, sometimes nothing. I can send/receive email via Outlook on my desktop and I can send/receive
      • I can't log in to my account on Thunderbird

        I've just had to rebuild my PC (calamitous mess from Microsoft with Win10/Win 11 'upgrade' - they confirmed I had to start with a new build). I have used Zoho mail for years via Mozilla Thunderbird, but now I've had to download the latest version of TBird,
      • Send a campaign to one recipient.

        Very often I speak to a customer and they say they didn't see my email (maybe it went in Junk, maybe they deleted it). Anyway, I just want to go into the Campaign and send it to one person. You already have a feature very close to this - when sending a Test. While developing a campaign, I can send tests to anyone. Why can't we have this AFTER  the campaign has been sent? I know, there's a caveat, and that's in the use of merge tags. Most of the time I only use FNAME, but maybe you could check if
      • Try FSM again for our business

        We already have our customers individual equipment in CRM with serial numbers, install dates, warranty length and importantly next service which is generally 2 years. a month before the service date is due we get get a report and send out service reminders.
      • Next Page