I'm working with Magento 2 API and I'm really struggled with response of it
How can I return some kind of response like this:
{
"status": 200,
"error": false,
"message": "Request processed successfully.",
"data": {
"id": "1",
"email": "us@test.com",
"first_name": "user1",
"last_name": "user01"
}
}
It's simple with other framework like Laravel or Express. But it seems really hard to achieve this with Magento 2 API.
Anyone has idea? Thank you.