Skip to main content

How To Automatically Upload a Zoho File Attachment to Dropbox from Zoho Creator using Dropbox API v2 and Zoho postUrl

I'm an idiot, so this took about 6 hours for me to figure out, but apparently many people have not been able to figure this out, and I could not find a complete and working solution online anywhere.

If you want to be able to upload a file to Dropbox from Zoho Creator, you have to create a custom function like below (here I called the function "Dropbox", under namespace "Create"). In the function, the ID is being passed to it from the underlying form entry.

void Create.Dropbox(int id)
{
url = "https://api.dropboxapi.com/2/files/save_url";
headers = {"Authorization":"Bearer XXXXX","Content-Type":"application/json"};
data = {"path":"/FFFF/TTTT.XXX","url":"YYYY"};
datastring = data.toString();
response = postUrl(url,datastring,headers,false);
}


... where XXXXX is your secret Dropbox Token, and YYYY is the url of the file you are uploading, and FFFF is the Dropbox folder to which the file is being uploaded, TTTT is the desired filename, and XXX is the desired extension.

This uses v2 of the Dropbox API. You can get your Dropbox token and use the very helpful Dropbox API  Explorer here:

https://dropbox.github.io/dropbox-api-v2-explorer/#files_save_url

The key thing that was difficult to figure out and is not well documented is that the function toString() is necessary because Dropbox is expecting JSON and although the variable "data" above looks like JSON, it is not.

Comments

Popular posts from this blog

Mastering Medicare Cheat Sheet

Amy Schiffman and I have created an awesome 1-page Medicare Cheat Sheet. You can get it for free by joining the Mastering Medicare subscriber list . Here's a sneak peak

Dr. Alex Mohseni invited to speak at Brault’s Healthcare Leadership Forum about the future of Emergency Medicine services and how ED groups can adapt using telemedicine.

  Dr. Mohseni presented on the topic of how Emergency Medicine groups could expand their scope of practice to the virtual space to and how to do so in a financially viable way.

MasteringMedicare Episode 14: Hospice and Secrets of the Hospice Industry published!

In this Mastering Medicare episode we do a deep dive into Hospice with our guest, Cathy Gurson.  She teaches us everything we ever wanted to know about Hospice. Here are some of the topics we cover: How do people get referred to hospice Hospice is covered 100% by Medicare part A What does hospice cover How to get Part B medical care covered while under hospice Hospice reimbursement model Hospice per diem Three levels of hospice care Pier diem changes at the higher levels of care For profit vs non-profit hospice Hospice certificate of need requirements What questions you should ask about when interviewing a hospice CHAP certification for hospice Transitioning - what does transitioning mean in the context of hospice? How to know when a hospice patient is dying Does hospice pay for food and nutrition Tube feeding hospice patients Measuring mean arm circumference (MAC) as a measure of nutritional decline Who is making the hospice recertification? Hospice patient’s relationships with their