Can't upload file to Zoho Docs using API

Can't upload file to Zoho Docs using API

    Hi

    I am using the free version of Zoho Docs and trying to upload a file into the root folder using PHP and the Docs API.

    My source code is as below:

    1. <?php
    2. $cipher = 'rsa_aes_128_sha';
    3. $AUTHTOKEN=" .... ";
    4. $path=" ... ";
    5. $filename=" ... ";

    6. $url = "https://apidocs.zoho.com/files/v1/upload?authtoken=".$AUTHTOKEN."&scope=docsapi";

    7. $fields = array(
    8.             'filename' => $filename,
    9.             'content' => file_get_contents($path."/".$filename)
    10.         );

    11. $ch = curl_init();

    12. $query = http_build_query($fields);

    13. curl_setopt($ch, CURLOPT_POST, TRUE);
    14. curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
    15. curl_setopt($ch, CURLOPT_URL, $url);
    16. curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, $cipher);
    17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

    18. $result .= curl_exec($ch);
    19. echo $result;
    20. curl_close($ch);
    21. ?>

    The result is sometimes a properly formed response which says 'Invalid URL' and sometimes a bizarre string that just says:
    1. <!--$Id$ -->

    The URL format appears to match that shown in the API specification. There are some other possible parameters, but these are clearly stated to be optional.

    I have checked that the filename and path are correct, the file has proper permissions and the file contents are being read okay, and query string being constructed properly. The file size is well under the maximum 100M. Other Docs API functions work okay with the same AuthToken.

    What might be going wrong with the file upload?

        Zoho Campaigns Resources


          • Desk Community Learning Series


          • Digest


          • Functions


          • Meetups


          • Kbase


          • Resources


          • Glossary


          • Desk Marketplace


          • MVP Corner


          • Word of the Day


          • Ask the Experts


            • Sticky Posts

            • [Announcement] Insert image from URL changes in Zoho Writer

              Hi Zoho Writer users! We'd like to let you know that we've changed the behavior of the Insert image from URL option in Zoho Writer for security reasons. Earlier behavior Once you inserted an image URL in a Writer document, the image would be fetched from
            • Deprecation of certain URL patterns for published Zoho Writer documents

              Hi Zoho Writer users! We'd like to let you know that we have deprecated certain URL patterns for published and embedded documents in Zoho Writer due to security reasons. If the published or embedded documents are in any of these URL patterns, then their
            • Introducing plagiarism checker in Zoho Writer

              Zia, Zoho Writer's AI-driven writing assistant, now highlights plagiarized and duplicated content in addition to offering contextual grammar and writing suggestions to help you write clearly and concisely in English. Zoho Writer's plagiarism reports Here
            • [Important announcement] Impact of Google's new email guidelines for Zoho Writer automation users

              Hi users, Google has recently announced new guidelines for sending emails to Gmail and other Google-hosted domains. These guidelines will be effective starting Feb. 1, 2024, and can impact the delivery of emails sent from Zoho Writer. Your organization
            • Transitioning from MS Word to Writer: A complete walkthrough

              Hello everyone! We understand moving to a new word processing tool can be difficult, especially if it means switching from a legacy software like MS Word. That's why we've organized an exclusive webinar where we talk you through ways to make your switch from MS Word to Writer as easy as possible. In this webinar, you'll learn: - Why Writer is a simple yet powerful alternative to MS Word. - How to locate your favorite MS Word features and functions in Writer.  - How to migrate your Word documents

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



                                  ご検討中の方

                                    • Recent Topics

                                    • Credit Note for Shipped and Fatoora pushed invoices

                                      We have shipped a Sales Order and created an Invoice. The Invoice is also pushed to Fatoora Now we need to create a credit note for the invoice When we try it, it says we need to create a Sales Return in the Zoho Books, we have already created a Sales
                                    • Cliq iOS can't see shared screen

                                      Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                    • Custom Related List Inside Zoho Books

                                      Hello, We can create the Related list inside the zoho books by the deluge code, I am sharing the reference code Please have a look may be it will help you. //..........Get Org Details organizationID = organization.get("organization_id"); Recordid = cm_g_a_data.get("module_record_id");
                                    • Features, Feedback and Votes

                                      We’re launching the Feedback Forum for our customers. This is 'THE' place where you can add everything you’d like to see in Zoho Books. If you don't find the specific feature you need, simply add it so others can also vote for it. While we cannot promise
                                    • add zoho account

                                      How to add a zoho mail to previous zoho account? I have two
                                    • There Might Be A Glitch in Determining If A String Represents A URL

                                      I suspect there might be a glitch in determining if a string represents a URL or not. For example, I cannot embed the following URL. Perhaps the exclamation mark or parentheses are the culprit? https://en.wikipedia.org/wiki/How_the_Grinch_Stole_Chri
                                    • Customer Management: #4 Enhance Customer Journey

                                      When Neha started DefineOps, a growing IT support and consulting firm, most of her work was straightforward. A client would sign up for a free version, decide whether the service works for them, and then either continue or discontinue. Billing was simple,
                                    • Pipeline.Company Name field shows up as numbers! [Bigin Developer Console > Component > URL]

                                      Hi there, I am setting up to invoke URL to send infromation zoho bigin > zoho forms with company name pre-fill in the form. however when I use : ${Pipelines.Company Name} field it shows up as a string of number instead of words. Help.
                                    • Marketing Tip #1: Optimize item titles for SEO

                                      Your item title is the first thing both Google and shoppers notice. Instead of a generic “Leather Bag,” go for something detailed like “Handcrafted Leather Laptop Bag – Durable & Stylish.” This helps your items rank better in search results and instantly
                                    • Territory Assignment Issues (Lead to Account + Contact)

                                      1. Lead → Account & Contact Territory Assignment on Conversion A Lead is automatically assigned one or more territories using a workflow and Lead Assignment Rules. This works as expected, and we are able to assign multiple territories to a Lead automatically.
                                    • Marketer's Space: Proven tips to improve open rates – Part II

                                      Hello Marketers! Welcome back to another post in Marketer's Space! We're continuing from where we left off a fortnight ago. We ended the previous post discussing the subject line, and we'll continue from there. Let's dive right in. Pre-header Pre-header
                                    • SQL Table slowed to a crawl

                                      Hi all - I seem to have noticed an update. Now whenever I am typing in the script field for the SQL tables there is a huge delay and it is all very slow. This has never been the case for me in over 5 years of using Analytics - I really hope it's fixed
                                    • Deluge Events/search API works in user environment but not in sandbox – why?

                                      I am creating an Extension for Zoho CRM using Zoho Sigma Platform I’m using the following Deluge code to search Events in Zoho CRM based on Start_DateTime: criteria = "(Start_DateTime:greater_than:2025-12-20T00:00:00+00:00)"; url = "crm/v8/Events/search?criteria="
                                    • Ensure Consistent Service Delivery with Comprehensive Job Sheets

                                      We are elated to announce that one of the most requested features is now live: Job Sheets. They are customizable, reusable forms that serve as a checklist for the services that technicians need to carry out and as a tool for data collection. While on
                                    • What are Zoho Meeting capabilities included in Zoho Workplace Standard?

                                      I am evaluating using Zoho Meeting for my organization, but it is not clear what Zoho Meeting capabilities are already included in Zoho Workplace Standard. - Are meeting recordings included in Workplace Standard? - Can we invite external meeting participants
                                    • Create static subforms in Zoho CRM: streamline data entry with pre-defined values

                                      Last modified on (9 July, 2025): This feature was available in early access and is currently being rolled out to customers in phases. Currently available for users in the the AU, CA, and SA DCs. It will be enabled for the remaining DCs in the next couple
                                    • How can I get the participant list of a reoccurring meeting afterwards?

                                      I'm trying to use the Meeting Participant Report from the API docs but when I call it on a reoccurring meeting it returns that there are no participants because it thinks I'm talking about the meeting in the future. Is there a way to use webhooks or some
                                    • Function #50: Send Mass emails to your customers

                                      Hello everyone, and welcome back to our series! We have reached a milestone of 50 Functions, which means that we have automated 50 different tasks in Zoho Books. Every Friday, we have shared a nifty function aimed at either automating a task or streamlining
                                    • Full Hebrew Language Support for Client-Side Zoho Assist Interface

                                      Dear Zoho Assist Team, We would like to request an enhancement to Zoho Assist's client-side interface to support full Hebrew language customization, including all popups, notifications, and session-related messages. Current Limitation The Join page allows
                                    • Add Hebrew & RTL Support to Feedback Widget

                                      Hello Zoho Desk Team, How are you? We are using Zoho Desk and would like to utilize the Feedback Widget. While Zoho Desk itself supports Hebrew and RTL, the Feedback Widget unfortunately does not. We kindly request that Hebrew and full RTL support be
                                    • Merge Tickets Directly from Contact Page in Zoho Desk

                                      Dear Zoho Desk Support Team, We are writing to request a new feature that would allow users to easily merge tickets directly from the contact page in Zoho Desk. Currently, the only option to merge tickets is from the Tickets list view page, which can
                                    • Different languages for users

                                      Hello, Do you plan to enable individual users to select their languages for interface? Currently language can be changed for everyone - it looks like a settings for a whole portal, which is not good when you are working internationally. Best regards,
                                    • Kaizen #222 - Client Script Support for Notes Related List

                                      Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
                                    • 2025年 Zoho コミュニティ 活動の振り返り 🎉

                                      ユーザーの皆さん、こんにちは!コミュニティチームの中野です。 2025年も多くの学びと出会いがあったZoho コミュニティ。 本記事では今年の活動を振り返りながら、フォーラムの投稿・参加者の皆さん・イベントのハイライトをご紹介していきます。 目次 フォーラム:注目の投稿 フォーラム:多くの貢献をしてくださった方々 ユーザー交流会振り返り ワークアウト振り返り その他のトピックス 1. フォーラム:注目の投稿 本フォーラムでは様々な議論と知識の共有が行われました。 ユーザーの皆さんが日々の業務で直面する課題を投稿し、経験豊富なユーザーさん達が実践的な解決策を提供してくださいました。
                                    • Customer Management: #3 Giving Customers Control & Privilege

                                      Rio, the founder of RenoTech Solutions, a fast-growing digital service company, found itself juggling a dozen different services for its clients. They handled one-time setup fees, recurring monthly invoices, and custom milestone-based billing for projects.
                                    • Can I use a Standalone CRM Function as the Callback URL For Async Export Data API?

                                      I am creating an export job using this API https://www.zoho.com/analytics/api/v2/bulk-api/export-data-async/create-export/view-id.html There is a "callbackUrl" key in the CONFIG object. I tried copying the URL for a standalone function in CRM which can
                                    • Books Api: listing expenses created after certain dates

                                      Is there any parameter I can add to the List Expenses endpoint that will let me look up expenses by when they were created?
                                    • Add RTL (Right-to-Left) Text Direction Support Across All Zoho Learn Editing Interfaces

                                      Hi Zoho Learn Team, Hope you're doing well. We would like to request an important enhancement to Zoho Learn regarding support for right-to-left (RTL) languages such as Hebrew and Arabic. 🔹 Current Issue While the Knowledge Base Article editor provides
                                    • Add Hebrew Support for Meeting Transcripts Provided by ZIA in Zoho Cliq

                                      Hi Zoho Cliq Team, Hope you're doing well. We would like to request the addition of Hebrew language support for the Meeting Transcript and Summary feature in Zoho Cliq. Currently the transcript and summary feature is available for recorded meetings and
                                    • Remote Control Functionality During Screen Sharing in Zoho Cliq

                                      Hello Zoho Cliq Team, We would like to request the addition of remote control functionality during screen sharing sessions in Zoho Cliq. Currently, while screen sharing in Cliq is very useful, it lacks the ability for another participant to take control
                                    • Real-Time Screen Annotation During Zoho Cliq Screen Sharing

                                      Hi Zoho Support Team, Hope you're doing well. We’d like to request the addition of real-time screen annotation tools during screen sharing sessions in Zoho Cliq video calls. 🔍 What We're Looking For: The ability for the presenter—and optionally, other
                                    • Centralized Organization Information Management in Zoho One

                                      Dear Zoho One Support, I'm writing to propose a feature that would significantly improve the user experience and streamline data management within Zoho One. Current Challenge: Currently, managing organization information across various Zoho One apps requires
                                    • Enhance Zoho One Conditional Assignment to Fully Reassign App Settings When Changing Departments

                                      Hi Zoho Team, We’d like to submit a feature request regarding the current behavior of Zoho One’s conditional assignment logic when moving a user between departments. 🔧 Current Limitation As it stands, Zoho One’s conditional assignment does not remove
                                    • Ability to Filter Alias Mailboxes in Zoho Recruit

                                      Dear Zoho Recruit Team, I hope you are doing well. We would like to request a feature enhancement regarding the handling of alias mailboxes in Zoho Recruit. Currently, when we connect an alias mailbox (e.g., jobs@domain.com) from our Zoho One account
                                    • Automatic Department and Employee Sync Between Zoho One and Zoho People

                                      Dear Zoho Support, I'm writing to propose a valuable feature request that would streamline data management and improve user experience within the Zoho ecosystem: automatic synchronization between departments and employees in Zoho One and Zoho People.
                                    • Add Attachment Support to Zoho Flow Mailhook / Email Trigger Module

                                      Dear Zoho Support Team, We hope you are well. We would like to kindly request a feature enhancement for the Mailhook module in Zoho Flow. Currently, the email trigger in Zoho Flow provides access to the message body, subject, from address, and to address,
                                    • Prefered Bin Missing in android APP

                                      Andoroid app dosent show preferred bin in the picklist. The workaround support reccomend is to use the computre to create the picklist. it shuld be information to be shown aas basic for the pciker.
                                    • Open Sans Font in Zoho Books is not Open Sans.

                                      Font choice in customising PDF Templates is very limited, we cannot upload custom fonts, and to make things worse, the font names are not accurate. I selected Open Sans, and thought the system was bugging, but no, Open Sans is not Open Sans. The real
                                    • Function #1: Convert an accepted Estimate to Sales Order automatically in Zoho Books

                                      As you’re aware, Zoho Books provides a default option to have the estimates automatically converted to invoices once your customer accepts them. Many of you wanted a similar option for sales orders, so here’s a workflow that converts accepted estimates
                                    • Write-Off multiple invoices and tax calculation

                                      Good evening, I have many invoices which are long overdue and I do not expect them to be paid. I believe I should write them off. I did some tests and I have some questions:  - I cannot find a way to write off several invoices together. How can I do that,
                                    • Next Page