cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Google App Engine and Java SDK GetTemporaryLink Error

Explorer | Level 3

I use Dropbox to save my application's user uploaded files. The upload part is running well. But When I try to get temporary link to my user's (not Dropbox user) files. I can't get the temporary link, the App is running at Google App Engine. Anyone can give a hint what should I do to avoid the error?

 

Thanks.

12 Replies 12
Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Dropboxer
Dropboxer
Hi @iwansyahp, and welcome to our community! 

Are you developing or using your own application? Are you using our API in any way? 

I’m not familiar with Google App Engine, but if your query involves our API, then perhaps we can move your question into our API support section here. 

Let me know.
Cheers! 

Sanchez
Community Moderator @ Dropbox
https://dropbox.com/support


Heart Did this post help you? If so, please give it a Like below.
Still stuck? Ask me a question!
Tips & Tricks Find new ways to stay in flow or share your tips on how you work smarter with Dropbox.

Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Dropboxer
Dropboxer

[Cross-linking for reference: https://github.com/dropbox/dropbox-sdk-java/issues/180 ]

 

It looks like you also posted this on GitHub. I answered there, but feel free to follow up in whichever location is more convenient for you.

Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Explorer | Level 3
I use Dropbox to save my application data, PDFs and ZIPs. To download my application data in Dropbox I use Temporary Link. The problem is I couldn't get the temporary link after >10 API request.
Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Dropboxer
Dropboxer
What error are you getting specifically? Please share the full output.
Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Explorer | Level 3
I couldn't get the error message, but based my condition checker code, It is look like output of the client.files().getTemporaryLink is "" (empty string) or null.

BTW, I use Java for my App and Dropbox-core-sdk (Java version)
Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Dropboxer
Dropboxer
I'm afraid I don't follow. The method would either return a result or raise an exception. Please double check the actual result.

Also, can you share the relevant code and steps to reproduce the issue?
Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Explorer | Level 3

This is my actual code.

public String unduhBerkas(String path)
            throws GetTemporaryLinkErrorException, DbxException{
       
        DbxRequestConfig config = DbxRequestConfig.newBuilder("My_App/1.0")
                 .withHttpRequestor(new GoogleAppEngineRequestor())
                 .withAutoRetryEnabled(100) // maksimal cobalagi jika gagal membuat request
                 .build();
       
        DbxClientV2 client = new DbxClientV2(config, ACCESS_TOKEN);


            GetTemporaryLinkResult temporaryLink = client.files().getTemporaryLink(path);
            this.link = temporaryLink.getLink();


            if (this.link.equals("")){
                Date date = new Date();
                // ambil 4 jam dari sekarang
                Date timeLinkExpiresAt  = addMinutesToDate(240, date);
                SharedLinkSettings sharedLinkSettings = SharedLinkSettings.newBuilder()
                        .withExpires(timeLinkExpiresAt)
                        .build();
                SharedLinkMetadata sharedLink = client.sharing().createSharedLinkWithSettings(path, sharedLinkSettings);
                this.link = sharedLink.getUrl();
                // ganti ujung URL dari dl=0 menjadi dl=1 agar bisa didownload
                if (this.link.endsWith("0")){
                    this.link = this.link.substring(0, this.link.length()-1) + "1";
                }
            }
        
        return link;
    }

Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Dropboxer
Dropboxer
I don't see any obvious issues with that. Can you add some logging or connect a debugger to check the actual return value from getTemporaryLink, or any raised exception?
Highlighted

Re: Google App Engine and Java SDK GetTemporaryLink Error

Explorer | Level 3

This is the response I got, Another problem I found is response of API is inconsistent for same files (folders), Sometime I got 200, and sometimes 409 HTTPS Status Codes.

 

This is the screenshot of request timeline.

Dropbox API Error LoggingDropbox API Error Logging

Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?