0

Trying to get sheet data using the smartsheet java sdk. This is the code I am using -

Smartsheet smartsheet = new SmartsheetBuilder()
                .setAccessToken(accessToken)
                .build();
smartsheet.setAssumedUser(emailAddress);
smartsheet.sheetResources().getSheet(sheetId, null, null, null, null, null,null, null);

This is the error I am getting -

java.net.UnknownHostException: No such host is known (api.smartsheet.com)

When I make a get request on postman using the same access token it works.

blurfus
  • 13,485
  • 8
  • 55
  • 61

1 Answers1

0

I don't know much about Java, but based on a bit of research I'd suspect you may be getting that error due to your internal proxy. According to the (accepted) answer in this other Stack Overflow post, you can setup a proxy in the Smartsheet Java SDK by using the same process that Smartsheet's QR Code sample uses.

Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
  • I tried using a proxy from this sample - https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/master/ADVANCED.md. When I do this I get an error saying com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') do you have any idea how to fix this? – Richa Ravi Feb 24 '21 at 22:22
  • Sounds like something is wrong with the structure/contents of your request. I'd suggest you post a new question to SO and include the code that's resulting in this error. – Kim Brandl Feb 27 '21 at 16:49