Cannot submit KBA answers

Hi,

Answers submissions for KBA questions are not working for me.

Request body:

> POST /kba/83f06e29-1b70-474d-b0a2-3be9d89e0598 HTTP/2
Host: api-sandbox.dwolla.com
user-agent: php-swagger-1.3.0
accept: application/vnd.dwolla.v1.hal+json
content-type: application/json
authorization: Bearer gOBgT61RJzD91xVzo4pWonzTILD939kWlTSyXbje2IZZ5uFpDt
content-length: 201

[
   {
      "questionId":2355953375,
      "answerId":"2687969325"
   },
   {
      "questionId":2355953385,
      "answerId":"2687969355"
   },
   {
      "questionId":2355953395,
      "answerId":"2687969435"
   },
   {
      "questionId":2355953405,
      "answerId":"2687969485"
   }
]

I am getting the following response:

{"code":"ValidationError","message":"Validation error(s) present. See embedded errors list for more
details.","_embedded":{"errors":[{"code":"Required","message":"List of answers is
required","path":"/answers","_links":{}}]}}

Hey @SumonMSelim – ah I see that it may be how the request-body is structured that’s causing the error.

The body would have to be in the following format according to the docs -

{
    "answers": [
        {
            "questionId": "2355953375",
            "answerId": "2687969335"
        },
        {
            "questionId": "2355953385",
            "answerId": "2687969385"
        },
        {
            "questionId": "2355953395",
            "answerId": "2687969435"
        },
        {
            "questionId": "2355953405",
            "answerId": "2687969485"
        }
    ]
}

Additionally, you can also follow this doc for simulating KBA success or failure - https://developers.dwolla.com/guides/sandbox#testing-customers

Let me know if you have any questions!

1 Like