Closed nosvalds closed 3 years ago
Hey Nik! Thanks for the details; those made it easy for me to find the server logs for your request 🙂
It looks like Pizzly (or some other part of your code) is accidentally modifying the parameters somehow before sending them to the Splitwise API. Rather than sending a series of key/value pairs, it's sending the entire JSON blob as one big key, with a value of nil
. So instead of our server receiving params like this:
{"cost"=>"1.00", "currency_code"=>"GBP", "description"=>"Niki test API", "payment"=>false, "group_id"=>"11912464", "split_equally"=>true, "users__0__user_id"=>"906803", "users__0__paid_share"=>"0.50", "users__0__owed_share"=>"0.50", "users__1__user_id"=>"6811318", "users__1__paid_share"=>"0.50", "users__1__owed_share"=>"0.50", "category_id"=>12}
We're receiving params like this:
{"{\n \"cost\": \"1.00\",\n \"currency_code\": \"GBP\",\n \"description\": \"Niki proxy API from Postman\",\n \"payment\": false,\n \"group_id\": \"11912464\",\n \"split_equally\": true,\n \"users__0__user_id\": \"906803\",\n \"users__0__paid_share\": \"0.50\",\n \"users__0__owed_share\": \"0.50\",\n \"users__1__user_id\": \"6811318\",\n \"users__1__paid_share\": \"0.50\",\n \"users__1__owed_share\": \"0.50\",\n \"category_id\": 12\n}"=>nil}
Thus our server fails to find a cost
parameter, and you get back the error "You must enter an amount"
.
—
I'm closing this issue since it doesn't appear to be an API issue, but if you continue to have trouble, feel free to reach out to developers@splitwise.com – we'll help as much as we can!
Hello,
I'm building a personal project of a Vue.JS front-end form to automate some of the settings I typically enter into splitwise.
I'm trying to do OAUTH2 authentication using https://github.com/Bearer/Pizzly . I can use Postman going through the Pizzly proxy (running locally) to do a GET /get_current_user just fine. But when I try to POST to create_expense (through the Pizzly proxy), I receive this error: "You must enter an amount":
Request Log (Postman)
Error:
I'm able to do a POST /create_expense with the same body JSON through Postman using the API Bearer token method with no issues.
Any ideas on where I can look next?
Thank you, Nik