Get Response

Hello,

I am trying the Login Component with Radzen (Angular). I have a API for signup. Which requires parameters like, username, email, and password. If the parameters are all right, the API returns a token, the response looks like this:
{
"authToken": "TOKEN"
}

If the user give an email which is already existing, the API returns a response with status 403 like this:
{
"code": "ERROR_CODE_ACCESS_DENIED",
"message": "This account is already in use.",
"payload": ""
}

In radzen I defined the event to invoke datasource method, which is calling this API. When the API call is successfully, it returns a token, (and the token can be catched in radzen with ${result.authToken}). When the API fails, I try to catch the message with ${result.message}, it just returns something like "HTTP fail response for API-URL Status 403". But I can see the message in Chrome.

image

could anyone help me? Many thanks.

regards,
haidong

my bad. It was just a problem of getting the right schema from the backend. ${result.error.message} would be the correct one to get the error message.

It is all fine with radzen. cheers