How to fix API response Err., UI:108 Failure"

Aypn CNN 446 Reputation points
2023-02-26T15:30:30.8233333+00:00

Hi,

Ref my below code, I'm getting below success response; after this im getting err., mentioned below, please let me know where I did mistake and how to resolve

"StatusCode: OK, Content-Type: application/json; charset=utf-8, Content-Length: 100)"

Err.Message

[{""ErrorCode"":""UI:108"",""Response"":false,""ResponseMsg"":""UI:Failure"",""Status"":""0"",""WorkingDate"":null}]"

(Note: tried with postman, I am getting data prefect in Postman)

ref my code:

Protected Sub GetMembrInfo()

        Dim restClient As RestClient = New RestClient("https://testMemberapi")
        restClient.Timeout = -1
        Dim request As RestRequest = New RestRequest(Method.POST)     
        request.AddParameter("Method", "GetTestAPI")
        request.AddParameter("MEMBERID", "12345")
        request.AddHeader("cache-control", "no-cache")
        request.AddHeader("Key", "TestKey12345")
        request.AddHeader("Value", "TestValue12345")
        request.AddHeader("Authorization", "Bearer " + "Token 12345")
        request.AddHeader("Accept", "application/json")
        Dim response As IRestResponse = restClient.Execute(request)
        If response.IsSuccessful Then
            Dim content As String = response.Content
            Dim Mi As MemberDset() = JsonConvert.DeserializeObject(Of MemberDset())(response.Content)
            If Mi(0).MemberInfo.Count > 0 Then
                Dim a As String = (Mi(0).MemberInfo(0).MemberID.ToString)
                Dim b As String = (Mi(0).MemberInfo(1).MemberFirstName.ToString)
            End If
        Else
            Dim errorMessage As String = response.ErrorMessage
        End If
    End Sub
	
	Public Class MemberDset
        Public Property Message As String
        Public Property Status As String
        Public Property MemberInfo As List(Of MemberInfo)
    End Class
    Public Class MemberInfo
        Public Property MemberID As String
        Public Property MemberFirstName As String
        Public Property Address1 As String
    End Class
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
398 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.