Using GetSheet method returns Unexpected character encountered while parsing value: <. Path '', line

This is just using the basic code that is provided in the Github documentation.


Stack Trace;

  at Smartsheet.Api.Internal.AbstractResources.HandleError(HttpResponse response)

  at Smartsheet.Api.Internal.AbstractResources.GetResource[T](String path, Type objectClass)

  at Smartsheet.Api.Internal.SheetResourcesImpl.GetSheet(Int64 sheetId, IEnumerable`1 includes, IEnumerable`1 excludes, IEnumerable`1 rowIds, IEnumerable`1 rowNumbers, IEnumerable`1 columnIds, Nullable`1 pageSize, Nullable`1 page, Nullable`1 ifVersionAfter, Nullable`1 level)

  at Smartsheet.Api.Internal.SheetResourcesImpl.GetSheet(Int64 sheetId, IEnumerable`1 includes, IEnumerable`1 excludes, IEnumerable`1 rowIds, IEnumerable`1 rowNumbers, IEnumerable`1 columnIds, Nullable`1 pageSize, Nullable`1 page)

  at FederalGrantsExport.Program.Main(String[] args) in C:\Working\FederalGrantsExport\FederalGrantsExport\Program.cs:line 28

  at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)

  at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

  at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

  at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

  at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

  at System.Threading.ThreadHelper.ThreadStart()

Answers

  • Krissia B.
    Krissia B. Moderator

    Hello @cmiller

     Upon reviewing this, the issue may be relevant to a firewall/proxy server blocking the API call. Try by putting the following into app.config file (just below the configSections).

     

    <system.net>

       <defaultProxy useDefaultCredentials="true"></defaultProxy>

    </system.net>

     

    Let me know if this helps!

    Cheers,

    Krissia