Closed ntdef closed 5 years ago
Hello @ntdef 👋!
Thanks for this issue - I am almost certain you are receiving a 400
response because you are not providing complete transaction resources in the transactions
array (only sending up { id: t.id, flag_color: "red" }
). The PATCH
is on the collection, not the resources themselves. So, you are PATCHing, or modifying the collection of transactions but the data for the individual transaction resources must be complete (i.e. have all necessary data).
In https://github.com/ynab/ynab-sdk-ruby/pull/40, I've added an example for update_transactions
usage to hopefully make this clearer: https://github.com/ynab/ynab-sdk-ruby/blob/master/examples/update-multiple-transactions.rb
Thanks Brady this is just what I needed.
On Jan 21, 2019, at 7:12 PM, Brady Holt notifications@github.com wrote:
Hello @ntdef 👋!
Thanks for this issue - I am almost certain you are receiving a 400 response because you are not providing complete transaction resources in the transactions array (only sending up { id: t.id, flag_color: "red" }). The PATCH is on the collection, not the resources themselves. So, you are PATCHing, or modifying the collection of transactions but the data for the individual transaction resources must be complete (i.e. have all necessary data).
In #40, I've added an example for update_transactions usage to hopefully make this clearer: https://github.com/ynab/ynab-sdk-ruby/blob/master/examples/update-multiple-transactions.rb
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
The docs for update transactions say that the PATCH will update multiple transactions with changes by transaction id or import id.
However, the API doesn't accept
id
as a field in the transaction change. I get a 400 back when I try to, say, change the flag color on a group of transactions.For example, the following doesn't work.