We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
ABDUL Salam
12 months 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...
Здравко
Legendary | 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.
ABDUL Salam
12 months agoExplorer | Level 3
Здравко It was a typo mistake (second case) I have fixed it.
- Здравко12 months agoLegendary | Level 20
Hm..🤔 I just checked it and everything seems valid. In first case I received:
{ ".tag": "complete", "name": "#1135_GOLF-P-WE-AU-BLACK.eps", "path_lower": "/2023/november/#1135/golf-p-we-au-black/#1135_golf-p-we-au-black.eps", "path_display": "/2023/November/#1135/GOLF-P-WE-AU-BLACK/#1135_GOLF-P-WE-AU-BLACK.eps", "id": "id:ElL7W-JPrdMAAAAAAABbFw", "client_modified": "2023-11-28T09:48:28Z", "server_modified": "2023-11-28T09:48:29Z", "rev": "60b335227a2e322ab554a", "size": 82890, "is_downloadable": true, "content_hash": "e84f56b1b7802b8cc4be23d765222a27b7286852f672a077c918f82b9cbae0e7" }
Of course, It appears as expected:
The same when talking for the second case (after your typo correction):
{ ".tag": "complete", "name": "#1134_GOLF-P-WE-AU-BLACK.eps", "path_lower": "/2023/november/#1134/golf-p-we-au-black/#1134_golf-p-we-au-black.eps", "path_display": "/2023/November/#1134/GOLF-P-WE-AU-BLACK/#1134_GOLF-P-WE-AU-BLACK.eps", "id": "id:ElL7W-JPrdMAAAAAAABbEg", "client_modified": "2023-11-28T09:42:34Z", "server_modified": "2023-11-28T09:42:35Z", "rev": "60b333d0821f622ab554a", "size": 251734, "is_downloadable": true, "content_hash": "80b133e0c090344bf04204c78b396fac3ef591122cd343ffd1722b7db8c82ab0" }
To be able see "what is actually going through the wire" you need to inspect the actual queries (not just your logs). It's easy using netcat runing on your local machine and directing your queries there (replacing https://api.dropboxapi.com with http://XXX.XXX.XXX.XXX:8080). Here "XXX.XXX.XXX.XXX" is you public IP address and 8080 appropriate port to listen on. I suppose you know how to redirect such a query. In such a way you can see exactly what's going out of your code and what's wrong (not just supposings).
Good luck.
- Greg-DB12 months agoDropbox Staff
ABDUL Salam Like Здравко, I just tried this using the values you provided and it also worked without issue for me. If you're still seeing this issue, please check the exact values you're sending as they mentioned, and if there's an issue on the Dropbox API side, share a sample we can use to reproduce it. Thanks!
- ABDUL Salam12 months agoExplorer | Level 3
Listening on 0.0.0.0 8080 Connection received on DN-12 57 POST /2/files/save_url HTTP/1.1 Host: MY_IP:8080 Accept: */* Authorization: Bearer sl.<tokenhere> Content-Type: application/json Content-Length: 174 {"path":"/2023/November/#1138/GOLF-P-WE-AU-BLACK/#1138_GOLF-P-WE-AU-BLACK.eps","url":"https://cdn.customily.com/ExportFile/pf-dev-3/a79b3bc0-80a1-4e48-aae7-eab0edd4b54d.eps"}
this is what I got after running netcat on my local machine and redirecting queries to my local system.
- Greg-DB12 months agoDropbox Staff
ABDUL Salam Thanks for sharing that. I just tried plugging in those exact values, and the file saved successfully for me. Are you still seeing this issue if you try those exact values?
- ABDUL Salam12 months agoExplorer | Level 3
The issue arises when I execute my script as a cron task on my hosting platform. This script performs the following tasks:
- Retrieves orders from an ecommerce store.
- Processes the received data to refine its format.
- Searches for a specific URL attribute within each order and stores it in an array if found.
- Subsequently, it initiates a call to the Dropbox API to acquire an access_token. This token is obtained using a previously stored refresh token. Following this, it invokes the '/save_url' endpoint.
- All operational information is logged in a dedicated file, signifying the successful completion of each step. However, upon calling the '/save_url' endpoint, an 'async_job_id' is returned.
- Using this 'async_job_id' for verification purposes consistently results in an 'invalid URL' error. Interestingly, the same URL functions correctly when hardcoded in /save_url request parameter.
- Здравко12 months agoLegendary | Level 20
The same like in Greg's experiment, everything works as expected.
ABDUL Salam wrote:... It was working fine early on locally bu as soon as I have deployed my script and check the logs after execution then this endpoint returns me a async_job_id which I use to check job status from https://api.dropboxapi.com/2/files/save_url/check_job_status and I get ...
ABDUL Salam, In this context, do you redirect your call from local machine or from the place where you are trying to deploy your script (where it fails actually)? If you do it locally only,... 🙂
- Здравко12 months agoLegendary | Level 20
ABDUL Salam wrote:... Interestingly, the same URL functions correctly when hardcoded in /save_url request parameter.
Do it in the same way when the request fails, not like when succeeds!
- ABDUL Salam12 months agoExplorer | Level 3
Greg-DB Is there any way we can check what URL/OR params were passed to the job so that from its async_job_id we can see it in response? This currently generically gives a failed tag with invalid_url.
https://api.dropboxapi.com/2/files/save_url/check_job_status{".tag": "failed","failed": {".tag": "invalid_url"}} - Greg-DB12 months agoDropbox Staff
ABDUL Salam The Dropbox API does not offer a way to echo back the parameters/URL sent to /2/files/save_url.
As Здравко asked though, were you inspecting this in the actual environment where this is failing?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 3 hours agoIf 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 or Facebook.
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!