Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

tyler d.4's avatar
tyler d.4
New member | Level 1
10 years ago

Connection timed out - connect(2) for "api.dropbox.com" port 443

Dear gentlemen:

I got some troubles in using the Core API in Ruby.
All codes are written according to this document: https://www.dropbox.com/developers/core/start/ruby
as below:

def new_from_dropbox
  @uploads = Upload.order('created_at DESC')
  @upload = Upload.new
  # Install this the SDK with "gem install dropbox-sdk"
  require 'dropbox_sdk'
  # Get your app key and secret from the Dropbox developer website
  app_key = '***'
  app_secret = '***'
  flow = DropboxOAuth2FlowNoRedirect.new(app_key, app_secret)
  @authorize_url = flow.start()
end

def dropbox_confirm
  require 'dropbox_sdk'
  app_key = '***'
  app_secret = '***'
  flow = DropboxOAuth2FlowNoRedirect.new(app_key, app_secret)
  access_token = flow.finish(code_param[:code].strip)
  puts "================================"
  puts access_token.inspect
  client = DropboxClient.new(access_token)
  puts "linked account:", client.account_info().inspect
  root_metadata = client.metadata('/')
  puts "metadata:", root_metadata.inspect
end

private
def code_param
  params.require(:upload).permit(:code)
end

When i input the authorization code and the function dropbox_confirm try to get access_token by

access_token = flow.finish(code_param[:code].strip)

It returned an error:

Connection timed out - connect(2) for "api.dropbox.com" port 443

Anyone can help me? please.
I found some relative questions here: https://www.pythonanywhere.com/forums/topic/1806/
But that is for python.

Regards.

1 Reply

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    It looks like there was a network issue connecting to the Dropbox API. Are you still getting the error? If so, there's likely a problem with the network connection on that machine preventing you from connecting to api.dropbox.com. Do you know if there's any security software, firewall, etc. that may be doing so? You can try connecting directly to api.dropbox.com to see where the problem might be, e.g., via:

    $ curl api.dropbox.com
    

About Dropbox API Support & Feedback

Node avatar for 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!