diff --git a/app/Controllers/AbdmGateway.php b/app/Controllers/AbdmGateway.php index c768a5f..2b0daa1 100644 --- a/app/Controllers/AbdmGateway.php +++ b/app/Controllers/AbdmGateway.php @@ -4858,7 +4858,12 @@ class AbdmGateway extends BaseController ]); } - $body = $this->request->getJSON(true) ?: []; + try { + $body = $this->request->getJSON(true) ?: []; + } catch (\Throwable) { + $rawBody = (string) $this->request->getBody(); + $body = json_decode($rawBody, true) ?: []; + } $careContextRefs = $body['careContextReferences'] ?? []; if (empty($careContextRefs) && !empty($body['careContextReference'])) { $careContextRefs = [$body['careContextReference']];