Skip to content

Magento 2 custom API giving “Class string does not exist” error

In Magento 2.4, I am using custom API and it is giving the below error.

{
"message": "Class string does not exist",
"code": -1
}

I have tried this and this solution. But nothing worked. Any solution for this?