• FEATURES
  • PRICING
  • MARKETPLACE
  • CASE STUDIES
  • BLOG
  • API Participant Registration fails with HTTP 400 - bad request

    We have one particular participant that we can’t create and register in OpenSpecimen through the API. We get HTTP 400 bad request.
    This is the JSON that we are sending (ePHI changed of course):

    “{“cpId”:“81”,“participant”:{“firstName”:“Shirley”,“middleName”:“Ann”,“lastName”:“Temple”,“uid”:null,“birthDate”:“1946-11-10”,“vitalStatus”:null,“deathDate”:null,“gender”:“Female”,“races”:[“White”],“ethnicity”:“Not Hispanic or Latino”,“sexGenotype”:null,“pmis”:[{“mrn”:“12345678”,“siteName”:“Winship Cancer Institute”}],“empi”:null,“activityStatus”:null},“ppid”:“BBI608-201CIT-7”,“registrationDate”:“2016-07-06”}”

    I don’t see anything in the Tomcat logs that explains the failure. I turned on Hibernate logging as well. I can’t see an explanation there either.

    Thank you.

    Hi Kenneth,

    A quick look at your JSON suggests the gender value is incorrect. It should be “Female Gender”. The API response contains details of fields that are causing bad request. In your case, the 400 error response payload will be:

    {
      code: "PARTICIPANT_INVALID_GENDER",
      message: "Gender specified in request is invalid."
    }
    

    Let us know how it works…

    I’ve found that it’s not the gender that is the issue. The problem is that this participant already exists on a protocol, and can’t be added to another protocol as the same site due to a unique constraint as follows:

    What JSON parameters are necessary to register an existing participant to a protocol?
    Where can I find documentation for this?

    Thank you.