I have an API endpoint which one of the below JSON responses:
{
"requestId":"114382-4744950-1",
"errorCode": "500.002.1001",
"errorMessage": "Service is currently under maintenance. Please try again later"
}
or
{
"OriginatorCoversationID": "60682-3118069-1",
"ResponseCode": "0",
"ResponseDescription": "success"
}
I need to check if the response had "errorCode" key in the JSON object to respond effectively. How do I check in PHP/Laravel if JSON object has a given key/property?