Access and show response body from api

Hi,
I get data from an API and show it in a table. I have another api to delete and another for put, post,…

for example the API delete Endpoint gives me Validation messages in the response body which I want to display the user if a row can’t be deleted. How can I access this message? I tried, but get
image

code for the delete button:

{{api1.run({id: tableQualityControlUnits.selectedRow.id})
.then(res => {
showAlert(‘Datensatz erfolgreich gelöscht’,‘success’);
api2t.run();
},
error => {
showAlert('Datensatz kann nicht gelöscht werden: '+ error[0].text, ‘error’)
})
}}

the response body from delete api is:

[
{
“text”: “Die Prüfung ist …”
}
]

so, I tried to access this message with: error[0].text

can anybody help me, please?

thx!

Hi! Is api1 the name of the API that returns that text? Then you have to use api1.data[0].text to access it.

hi and thx, I can access it!