# Exception: ApiResponseException: Unknown Error

**URL:** <https://forum.heroiclabs.com/t/exception-apiresponseexception-unknown-error/4873>\
**Category:** Client Libraries\
**Tags:** authentication\
**Created:** [January 15, 2024, 12:15pm UTC](https://forum.heroiclabs.com/t/exception-apiresponseexception-unknown-error/4873 "2024-01-15T12:15:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhuguiqing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/zhuguiqing/32/2013_2.png) [@zhuguiqing](https://forum.heroiclabs.com/u/zhuguiqing)\
**Post date:** [January 15, 2024, 12:15pm UTC](https://forum.heroiclabs.com/t/exception-apiresponseexception-unknown-error/4873/1 "2024-01-15T12:15:58Z")

</div>

The same code is normal on Android, but it will report an exception on iOS. How to solve it?  
Exception is:  
Exception: ApiResponseException: Unknown Error

Nakama.ApiClient.AuthenticateCustomAsync (System.String basicAuthUsername, System.String basicAuthPassword, Nakama.ApiAccountCustom account, System.Nullable`1[T] create, System.String username, System.Nullable`1[T] cancellationToken) (at \<00000000000000000000000000000000\>:0)  
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at \<00000000000000000000000000000000\>:0)  
System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at \<00000000000000000000000000000000\>:0)  
System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at \<00000000000000000000000000000000\>:0)  
System.Threading.Tasks.Task.FinishContinuations () (at \<00000000000000000000000000000000\>:0)  
System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) (at \<00000000000000000000000000000000\>:0)  
System.Threading.Tasks.TaskCompletionSource`1[TResult].TrySetException (System.Exception exception) (at <00000000000000000000000000000000>:0) Nakama.UnityWebRequestAdapter+<SendRequest>d__13.MoveNext () (at <00000000000000000000000000000000>:0) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0) --- End of stack trace from previous location where exception was thrown --- Nakama.RetryInvoker.InvokeWithRetry[T] (System.Func`1[TResult] request, Nakama.RetryHistory history) (at \<00000000000000000000000000000000\>:0)  
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at \<00000000000000000000000000000000\>:0)  
System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at \<00000000000000000000000000000000\>:0)  
System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback callback, System.Object state, System.Threading.Tasks.Task& currentTask) (at \<00000000000000000000000000000000\>:0)  
System.Threading.Tasks.Task.FinishContinuations () (at \<00000000000000000000000000000000\>:0)  
System.Threading.Tasks.Task.TrySetException (System.Object exceptionObject) (at \<00000000000000000000000000000000\>:0)  
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException (System.Exception exception) (at <00000000000000000000000000000000>:0) Nakama.ApiClient.AuthenticateCustomAsync (System.String basicAuthUsername, System.String basicAuthPassword, Nakama.ApiAccountCustom account, System.Nullable`1[T] create, System.String username, System.Nullable`1[T] cancellationToken) (at \<00000000000000000000000000000000\>:0)  
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at \<00000000000000000000000000000000\>:0)  
System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () (at \<00000000000000000000000000000000\>:0)

---

<div class="post-metadata">

**Author:** ![flavio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/flavio/32/2161_2.png) [@flavio](https://forum.heroiclabs.com/u/flavio)\
**Post date:** [January 15, 2024, 1:33pm UTC](https://forum.heroiclabs.com/t/exception-apiresponseexception-unknown-error/4873/2 "2024-01-15T13:33:16Z")

</div>

Hello @zhuguiqing,

What are the Nakama and SDK versions you are using? Is there an error log on the server side?

---

<div class="post-metadata">

**Author:** ![zhuguiqing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/zhuguiqing/32/2013_2.png) [@zhuguiqing](https://forum.heroiclabs.com/u/zhuguiqing)\
**Post date:** [January 15, 2024, 2:49pm UTC](https://forum.heroiclabs.com/t/exception-apiresponseexception-unknown-error/4873/4 "2024-01-15T14:49:34Z")

</div>

@flavio SDK version is 3.10.1.There is no error log on the server side.

---

<div class="post-metadata">

**Author:** ![flavio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/flavio/32/2161_2.png) [@flavio](https://forum.heroiclabs.com/u/flavio)\
**Post date:** [January 15, 2024, 5:00pm UTC](https://forum.heroiclabs.com/t/exception-apiresponseexception-unknown-error/4873/5 "2024-01-15T17:00:56Z")

</div>

If I’m not mistaken a ApiResponseException would result from a server error however “Unknown Error” isn’t very helpful and distinct from the usual “Internal Error”. That exception should contain as fields the status code and response content, could you verify which values those contains? Could you share a code snippet as well?

---

<div class="post-metadata">

**Author:** ![zhuguiqing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/zhuguiqing/32/2013_2.png) [@zhuguiqing](https://forum.heroiclabs.com/u/zhuguiqing)\
**Post date:** [January 18, 2024, 11:16am UTC](https://forum.heroiclabs.com/t/exception-apiresponseexception-unknown-error/4873/6 "2024-01-18T11:16:21Z")

</div>

OK,thank you.We finally found the problem. In the plist of iOS, a field called NSAppTransportSecurity blocks the client’s network.
