class User
def create_dwolla_customer
dwolla_token = DwollaToken.current
puts dwolla_attributes
customer = dwolla_token.post "customers", dwolla_attributes
binding.pry
end
private
def dwolla_attributes
{ firstName: first_name, lastName: last_name, email: email }
end
end
APi call is responding with:
DwollaV2::BadRequestError:
{"code"=>"BadRequest", "message"=>"The request body contains bad syntax or is incomplete."}
spencer
(Spencer Hunter - Lead Developer Advocate @ Dwolla)
2
Hey @chris, Can you output the raw JSON request body that is getting sent to the API? Are you making sure the required fields (firstName, lastName, and email) have valid string value? I’m wondering if you are sending null as a value…
@spencer, It was my refresh token, it was invalid. I need to raise an error if the token is bad. However the token is good for 60 days. it could have only been a few days old not sure why it was not authenticating correctly.
We are using drop-in components for business verified customer and beneficial owners. Business verified customer working well while getting access-token from API but for beneficial owner it says badrequest. For beneficial owners access tokens url hitting 4 times for different actions and normally for third request it says badrequest. I guess it’s due to frequent hits to the API for access token. Is there any limitations with sandbox account or what we are missing here.
Usually for first 2-3 hits the response return valid token and subsequently its returning bad request.
Hi @aravind.calimex – there shouldn’t be any limitations in the Sandbox environment for drop-ins. I wasn’t able to recreate this on my machine. I’m using version 2.1.8 of dwolla-web.js.
Would you be able to share any relevant code and network logs of your implementation of the beneficial-owners drop-in component?