I am trying to create Magento 2.3 custom rest API but couldn't get JSON response.
Expected:
{
"status" : true,
"dattails": [
{"id": ""}, {"id": ""}
]
}
Actual:
[true] (array format)
How to solve this issue? Anyone can help me?
Hi @jothi_vijila1
Try to modify your return statement as below.
return json_decode(json_encode($arr), true);
Thanks
---If you've found my answer useful, please give"Kudos" and "Accept as Solution".