CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to get amount funded for a Contribution Page via API?
Pages: [1]

Author Topic: Best way to get amount funded for a Contribution Page via API?  (Read 2549 times)

mrmeech

  • I’m new here
  • *
  • Posts: 24
  • Karma: 1
Best way to get amount funded for a Contribution Page via API?
July 28, 2013, 04:27:03 pm
Using the API, I've been trying to figure out how to get the dollar amount that a Contribution Page has been funded.

Using the ContributionPage entity i can get min_amount, max_amount, and goal_amount... but using those numbers, I cannot retrieve or calculate the amount of funds the campaign page has received.

The only way I can figure out how to do this seems potentially inefficient: Using the Contribution entity, giving it an argument for "contribution_page_id" and then adding up the numbers from ['values'][0]['total_amount'].

Is there a better way to go about this? Is the dollar amount (and/or percentage) for funds received for a contribution page already calculated by Civi somewhere?

Thanks in advance!  :)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Best way to get amount funded for a Contribution Page via API?
July 29, 2013, 02:02:26 pm
Not currently. I dont know if it would make sense to think about a getsum action - but you might just need to do it using an sql query for now
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Best way to get amount funded for a Contribution Page via API?

This forum was archived on 2017-11-26.