Getting "Value Does not fall within Expected Range" Exception

Options

Hello All,

I have Created a Console App in Dot Net Using C# SDK for Smartsheet API.

And Successfully Retrieved the Sheets that are accessed to me using ListSheets() method in my Local system.

But the same method Returns Exception at the Production Server like "Value does not fall within the expected range". in the Line

PaginatedResult<Sheet> sheets = smartsheet.SheetResources.ListSheets(null,null, null);

I used same token for both environment.

Am I missed Something?

Exception:

Unhandled exception. Smartsheet.Api.SmartsheetException: Value does not fall within the expected range.

  at Smartsheet.Api.Internal.Http.DefaultHttpClient.Request(HttpRequest smartsheetRequest)

  at Smartsheet.Api.Internal.AbstractResources.ListResourcesWithWrapper[T](String path)

  at Smartsheet.Api.Internal.SheetResourcesImpl.ListSheets(IEnumerable`1 includes, PaginationParameters paging, Nullable`1 modifiedSince)

  at SmartsheetInterface.Program.Main(String[] args) in C:\SmartsheetInterface\Program.cs:line 37



Any help would be greatly appreciated!

Best Answer

  • KevinFansler
    KevinFansler Employee
    Answer ✓
    Options

    Hi, It looks like you have the right syntax for C#. I wonder if you can run the List Sheets command just in Curl to isolate it and see if that gives you a response? Then you would know whether it's some other issue or your request through the SDK.

Answers

  • KevinFansler
    KevinFansler Employee
    Answer ✓
    Options

    Hi, It looks like you have the right syntax for C#. I wonder if you can run the List Sheets command just in Curl to isolate it and see if that gives you a response? Then you would know whether it's some other issue or your request through the SDK.