Upload Json File to Zoho Docs with C#

Upload Json File to Zoho Docs with C#

Dear,
For one of our contractors we have to upload json files to their zoho account.
We have tried different ways to do this, directly with reading the file contents or in trying to directly insert Json string.
But none of these worked.
We always received the respone message : EMPTY_OR_NO_FILE_SPECIFIED
Could someone help on this ? 
Here is one of the latest tried code : 
public static void PostAsync(int sourceApiId)
        {
            string url = "https://apidocs.zoho.com/files/v1/upload?filename=Stock_snapshot20210210.json&fid=lz6x5c7bb900ad31343eeb9fe1a76c63d2a52&scope=docsapi";
            byte[] data = Encoding.UTF8.GetBytes(jsonString);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = "POST";
            request.ContentType = "application/json"; 
            request.Headers.Add("Authorization", "Zoho-oauthtoken " + token);
            request.ContentLength = data.Length;

            using (Stream stream = request.GetRequestStream())
            {
                stream.Write(data, 0, data.Length);
            }
            try
            {
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                {
                    string responseContent = reader.ReadToEnd();
                    JObject adResponse = JsonConvert.DeserializeObject<JObject>(responseContent);
                    Console.WriteLine(adResponse);
                    Console.WriteLine(request.Address);
                    Console.WriteLine(request.Headers);
                }
            }
            catch (WebException webException)
            {
                if (webException.Response != null)
                {
                    using (StreamReader reader = new StreamReader(webException.Response.GetResponseStream()))
                    {
                        string responseContent = reader.ReadToEnd();
                        Console.WriteLine(JsonConvert.DeserializeObject<JObject>(responseContent));
                    }
                }
            }
            Console.ReadLine();
        }






                          Zoho Desk Resources

                          • Desk Community Learning Series


                          • Digest


                          • Functions


                          • Meetups


                          • Kbase


                          • Resources


                          • Glossary


                          • Desk Marketplace


                          • MVP Corner


                          • Word of the Day



                              Zoho Marketing Automation

                                      • Sticky Posts

                                      • Zoho Docs EOL extended to March 15, 2023. Migrate to WorkDrive now!

                                        Update: Zoho Docs access will be blocked for all users. Read this official post to know more. Most Zoho Docs individual and org users (including Workplace and Zoho One users) have already migrated their data and users to Zoho WorkDrive in response to
                                      • Live Webinar - Drive your team towards tighter collaboration

                                        Any project, big or small, involves a lot of planning, strategizing, scheduling, and budgeting. However, how your team executes the project really makes it a success. That's why teams need to work closer, stay dynamic, and be ready when they're needed.    However skilful your team might be, a collaboration platform can make them even more efficient and productive.    With organizations expanding globally, it's not only a challenge for teams to work together, but all to stay on the same page.    To
                                      • Live Webinar: Collaboration Made Simple with Our Brand New Tool

                                        Creating successful work groups when a team is geographically dispersed can be quite challenging. The process of keeping work and tasks in order becomes difficult and collaboration between team members can go haywire.  As a result, companies have shifted the way in which teams traditionally manage and organize their work. More organizations now want an exclusive, convenient place to work together, one that’s accessible by both internal and external collaborators.  That is why we have developed a
                                      • Live Webinar - Go 'Pro Team' With Our New Productivity Tool

                                        Is your team forced to keep switching between apps to get work done? Does it take everyone longer to complete their tasks?    Join us for a webinar on Thursday, May 17, 2018  to learn about our new product that'll transform the way you work and collaborate with teams across your organization - whether they are in the next room or even miles away.  Teams are dynamic and they require tools that are flexible enough to cope with the ever-changing environment. But working with your colleagues doesn't
                                      • Live Webinar - Make the Most of your Team Collaboration

                                        Do you have a collaborative team that's constantly looking for better ways to optimize productivity, connect with each other, and have better tools to share files? Well, look no further.   The Zoho Docs team has something big in store for you and your team. Join us on  Tuesday, April 17, 2018  to learn how to keep all your team files in one place, and turn you and your colleagues into productivity superstars! You'll also get a sneak peek at a new product that will help you:  Organize your team's


                                      Manage your brands on social media



                                              Zoho TeamInbox Resources

                                                Zoho DataPrep Resources



                                                  Zoho CRM Plus Resources

                                                    Zoho Books Resources


                                                      Zoho Subscriptions Resources

                                                        Zoho Projects Resources


                                                          Zoho Sprints Resources


                                                            Qntrl 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


                                                                          Design. Discuss. Deliver.

                                                                          Create visually engaging stories with Zoho Show.

                                                                          Get Started Now