Receiving Unexpected (non-JSON) response format text/html when using the ShareFile.Api.Client v3.033

  • 1
  • Question
  • Updated 2 weeks ago
We have an C# application that uses the ShareFile.API.Client.  Starting around October 4 2018 we started to receive the following error from ShareFile.

ShareFile.Api.Client.Exceptions.InvalidApiResponseException: Unexpected (non-JSON) response format text/html ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
   at ShareFile.Api.Client.Requests.Providers.BaseRequestProvider.DeserializeResponseStream[T](Stream responseStream, HttpResponseMessage httpResponseMessage)
   --- End of inner exception stack trace ---
   at ShareFile.Api.Client.Requests.Providers.BaseRequestProvider.DeserializeResponseStream[T](Stream responseStream, HttpResponseMessage httpResponseMessage)
   at ShareFile.Api.Client.Requests.Providers.BaseRequestProvider.<>c__DisplayClass16_0`1.<DeserializeResponseStreamAsync>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at ShareFile.Api.Client.Requests.Providers.AsyncRequestProvider.<HandleTypedResponse>d__7`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at ShareFile.Api.Client.Requests.Providers.AsyncRequestProvider.<ExecuteAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at TheFund.ShareFile.ShareFileController.<sendAsync>d__9.MoveNext()



Here is the operation we are calling in the API.CLient,

After the file is upload we do the following,
var uploadedFileId = await UploadFile(_createdFundOrderFolder, file, fundOrderID);                    
var itemUri = _sfClient.Items.GetAlias(uploadedFileId);
var uploadedFile = await _sfClient.Items.Get(itemUri).ExecuteAsync(); The error occurs in the above line. This error is becoming quite frequent. Thanks for your help.
Photo of Richard M

Richard M

  • 2 Posts
  • 0 Reply Likes

Posted 3 weeks ago

  • 1
Photo of Richard M

Richard M

  • 2 Posts
  • 0 Reply Likes
Is anyone from ShareFile looking at this issue?