Dear All,
I am able to connect Box APIs using PostMan by dev token generated through portal. However, when I try to do the same thing using Box Java SDK, I am getting "Couldn't connect to the Box API due to a network error" for api.box.com and upload.box.com
Since I am able to get response with PostMan, so this certainly is not a network or firewall issue. Only when using Box SDK for Java I am facing this issue. Below is the code excerpt which uses SDK -
BoxAPIConnection api = new BoxAPIConnection("XXXXXXXXXXXXXXXX");
BoxUser.Info userInfo = BoxUser.getCurrentUser(api).getInfo();
BoxFolder rootFolder = BoxFolder.getRootFolder(api);
rootFolder.getMetadata(); ==> HERE I AM GETTING ERROR
I also tried to use apache HttpClient with HttpGet by pasting the API and passing token in header and it worked perfectly fine.
So I am able to connect to Box API with PostMan and traditional Java Code (using Apache HTTP). This clearly shows there is no network error. But only when I use Box SDK, I get Network error.
Please help in figuring out the issue.
Thanks in Advance.