Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
ABDUL Salam
3 years agoExplorer | Level 3
I am getting invalid_url again and again with /save_url, https://api.dropboxapi.com/2/files/save_url
Hi, I have an app that uses https://api.dropboxapi.com/2/files/save_url/save_url endpoint to save urls from my ecommerce store to my dropbox. It was working fine early on locally bu as soon as I ha...
ABDUL Salam
3 years agoExplorer | Level 3
Hi Здравко
Firstly would like to appreciate your suggestion related to coding practices.
Basically, this body with slashes is the output
json_encode($payload);that I have sent in my curl request.
Also, the main issue is if I manually run my script from the terminal locally using php script.php
It works perfectly with the same code.
But when I schedule it as a cron job on my server this script does not run as it runs locally, it does complete code flow and return me async_job_id in response but when I check using this async_job_id it always gives me this
{
".tag": "failed",
"failed": {
".tag": "invalid_url"
}
}I wonder what could be the reason.
Greg-DB
Dropbox Community Moderator
3 years agoABDUL Salam As Здравко said, the backslashes you have in the output you shared here are not expected or accepted in the URL, so make sure those aren't in the actual data you're sending to the API.
As for why this works locally but not on your server, does your server have a different version of any libraries you're using? Or are you perhaps using a different URL value on the server?
- ABDUL Salam3 years agoExplorer | Level 3
in curl, I passed the payload as a json_encoded body which adds these slashes, but I have also hardcoded an HTTPS URL in the payload as
$payload= ["path" => "myPathHere",
"url" => "https://abc.com/"]
and then json encoded that in curl and it worked, but it's not working with dynamic url's
such as$payload= [
"path" => "myPathHere",
"url" => $url, //my dynamic URL comes here]
still figuring it out on my side why it's happening.- ABDUL Salam3 years agoExplorer | Level 3payload:{"path":"/2023/November/#1135/GOLF-P-WE-AU-BLACK/#1135_GOLF-P-WE-AU-BLACK.eps","url":"https://cdn.customily.com/ExportFile/pf-dev-3/cfa42d7e-4418-47af-b120-83e9ca35b1c1.eps"}uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "ruN7OyTfOucAAAAAAAAAAQ"} 200payload:{"path":"/2023/November/#1134/GOLF-P-WE-AU-BLACK/#1134_GOLF-P-WE-AU-BLACK.eps","url":"https://cdn.customily.com/ExportFile/pf-dev-3/a4da1953-2618-4e17-8f60-4c81e776f0a0.eps"}uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "Tz3sCHoe4-EAAAAAAAAAAQ"} 200
these are logs of my cron job
and against these async_job_id's I am gettingalthough my URL in body seem valid{".tag": "failed","failed": {".tag": "invalid_url"}}- Здравко3 years agoLegendary | Level 20
ABDUL Salam, to be honest, I don't know why did you received exactly that error, but your path is definitely invalid (in the second case). In Dropbox whatever path you use must NOT end in slash and when we're talking for file path, it should include filename too - something missing in your case. Fix it.
Good luck.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!