# 400 error attempting to retrieve ehrBySubjectId api **Category:** [Platform](https://discourse.openehr.org/c/platform-implem/7) **Created:** 2023-10-12 03:08 UTC **Views:** 437 **Replies:** 0 **URL:** https://discourse.openehr.org/t/400-error-attempting-to-retrieve-ehrbysubjectid-api/4532 --- ## Post #1 by @mrwilde Working with a new integration I have come across a sporadic issue that I need assistance identifying the cause. recently updated to using ehrBase 0.30.0 The error is ``` { "error": "Bad Request", "message": "Could not retrieve EHR for party:22108b3f-b1ae-4d30-ac65-169593fd5253 exception:java.lang.IllegalArgumentException: Cannot translate a null SQLException" } ``` this happens when the external service uses the ehrBase API to get the EHR summary by subjectId ``` /ehrbase/rest/openehr/v1/ehr?subject_id=2b61ec68-a5b1-45d8-9562-b7807e6e4f0e&subject_namespace=development-domain-com ``` on inspection of the ehrbase party_identified table I discovered duplicate `party_ref_value` & `party_ref_namespace` I would have believed this to be not possible and I cannot replicate this using the API with swagger endpoint in ehrBase. There is no direct documentation suggesting there should only be one so I am interested to know if anyone else has seen this happen. Happy to share any information details --- **Canonical:** https://discourse.openehr.org/t/400-error-attempting-to-retrieve-ehrbysubjectid-api/4532 **Original content:** https://discourse.openehr.org/t/400-error-attempting-to-retrieve-ehrbysubjectid-api/4532