Welcome to the new Box Support website. Check out all the details here on what’s changed.

connect to box is failing using REST protocol but the same works using HTTP protocol

Answered
New post

Comments

10 comments

  • iancrew

    Did this just start happening today? There were some issues (supposedly since resolved) with the APIs earlier today--see http://status.box.com

    0
    Comment actions Permalink
  • Sudipta_Scotia

    I do not believe this is a BOX issue as I have one more application(hosted in my personal machine) using the exact codes( connect to box using HTTP and REST) and that one seems to be working. The one having problem is hosted in cloud . I kind of sense that this might be a network/firewall issue of the cloud server. 

    0
    Comment actions Permalink
  • iancrew

    Well, starting from the basics, can you open a telnet connection to api.box.com on port 443 (i.e. 'telnet api.box.com 443') from the machine running your code? If not, it's almost definitely a firewall or connectivity issue of some sort.

    0
    Comment actions Permalink
  • Sudipta_Scotia

    This is the reply I got back from our network admin.

    --telnet wont be possible as we go outside using a proxy
    --I can do curl and access the api.box URL
    --the curl command allows to set a proxy.

     

    After he ran the curl command , we got response back:

     

    [root@lvappi01351 ~]# export https_proxy=gateway.bns:443
    [root@lvappi01351 ~]# curl https://api.box.com


    301 Moved Permanently

    Moved Permanently


    The document has moved https://developers.box.com/">here.

    >

    [root@lvappi01351 ~]#

     

     

     

    0
    Comment actions Permalink
  • iancrew

    Sounds to me like the proxy is almost definitely the issue. Are all the hosts/ports listed at https://community.box.com/t5/How-to-Guides-for-Account/Configuring-A-Firewall-For-Box-Applications/ta-p/12 properly set up and proxied?

    0
    Comment actions Permalink
  • Sudipta_Scotia

    we will be performing a network trace to find out where does the call fail. Only confusing part is that when we are using HTTP protocol , then connection is successful. Using REST protocol is causing the problem.

    0
    Comment actions Permalink
  • iancrew

    Well, all RESTful API calls go to Box over HTTPS.  My guess is that there's something about your firewall/proxy setup that is blocking the connection from the machine you're running your code to the HTTPS ports on the right machine at Box.  If opening things up to the list of hosts that  I linked to earlier in this thread doesn't work, I'd contact Box support directly (via Contact Box Support) to see if they have any more specific guidance about what needs to be opened/proxied to allow the API calls to work.

    0
    Comment actions Permalink
  • Sudipta_Scotia

    The root cause of our problem was the source code from our vendor(Pega). It seems the because of the bug any rest call made from the app using proxy( we have set up a proxy setting on our app server and all the calls should use the proxy configuration) , was bypassing the proxy settings. after the source was updated , all the rest calls are now going through proxy and are successful.

    0
    Comment actions Permalink
  • iancrew

    Great! Glad to hear you figured it out!

    Ian

    0
    Comment actions Permalink
  • Ovadir2

    Can you send the documentation of the REST box?

    0
    Comment actions Permalink

Please sign in to leave a comment.