BreezeChMS / breeze-api-v1

The Breeze API v1 allows you to build custom applications integrated with the Breeze database.
https://www.breezechms.com/api
5 stars 3 forks source link

Giving API - Create Contribution - "Missing Name (API)" #2

Closed ziyan-junaideen closed 4 years ago

ziyan-junaideen commented 4 years ago

DISCLAIMER: Breeze does not actively monitor the contents of posted messages, is not responsible for any messages posted, does not vouch for or warrant the accuracy, completeness or usefulness of any message, and is not responsible for the contents of any message.

Summary

Attempting to create a contribution fails. The error message isn't helpful to figure out the issue.

Details

Make a POST to /api/giving/add with the following data.

Request params (as a Ruby Hash):

{
  date: "9-2-2020",
  uid: "gf-2",
  processor: "GivingFire",
  method: "Credit/Debit Online",
  funds_json: "[{\"name\":\"General Fund\",\"amount\":\"100.0\"}]",
  amount: "100.0",
  person_id: 22334478
}

Response:

{"success"=>false, "errors"=>["Missing name (API)"], "payment_id"=>nil}

Looking at the API documentation, there doesn't seem to be "name" field. Would appreaciate to figure out what might be missing. Also would be good to know which fields are required in teh API documentaiton.

Expected behavior

The API request to create a record, or respond with a more helpful error message.

What is the motivation / use case for changing the behavior?

NA

Environment

christianpatrick commented 4 years ago

Hi @ziyan-junaideen!

I had the same error at first when trying to create a contribution. After working through it with the API docs: https://app.breezechms.com/api#add_contribution, I found that the name key in person_json is required when you pass in the person_id.

So if you pass in a single key/value array on person_json like {"name":"Tony Stark"}, it should come back with success and the corresponding payment_id.

I hope that helps you on your Ruby Library!

MarownIOM commented 3 weeks ago

Ok. so add_contribution is available in the api? Why wouldn't this be in the documentation??? I've been waiting for api v2 before I bothered creating an interface.
Is there an interface for get contributions?