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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How do i know what is contribution page id using civicrm_api
Pages: [1]

Author Topic: How do i know what is contribution page id using civicrm_api  (Read 827 times)

shashikant

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: civicrm 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: Mysql 5.1.56
  • PHP version: PHP Version 5.3.6
How do i know what is contribution page id using civicrm_api
August 16, 2012, 02:51:54 am
Hi
I saw that there is column for contribution_page_id in civicrm contribution table.
I wants to use contribution_page_id for coding purpose.
But if i am using civicrm_api( 'contribution','get',$params ) , I am not able to get the contribution_page_id in the result returned by the civicrm_api.
Can any one suggest me that how to get contribution_page_id using contribution_id.

Thanks in advanced.

shashikant

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 0
  • CiviCRM version: civicrm 4.1.3
  • CMS version: Drupal 6.26
  • MySQL version: Mysql 5.1.56
  • PHP version: PHP Version 5.3.6
Re: How do i know what is contribution page id using civicrm_api
August 16, 2012, 04:17:49 am
Hi,
Got the solution by using params like

Code: [Select]
  $params = array(
  'version' => 3,
  'contribution_id' => $contribution_id,
  'return.contribution_page_id' => 1,
  );

It will good if these kind of example gets documented in
http://svn.civicrm.org/civicrm/trunk/api/v3/examples/

Thanks

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How do i know what is contribution page id using civicrm_api
August 16, 2012, 05:58:00 am
These examples are automatically generated from the test cases.

Could you write a test to cover your case (and beside helping us, will help you be sure we don't brake this feature)?
http://civicrm.org/blogs/brylie/testing-civicrm

Also, the syntax you are using is the old one. Could you try using instead:

Code: [Select]
  $params = array(
  'version' => 3,
  'contribution_id' => $contribution_id,
  'return=> 'contribution_page_id',
  );
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How do i know what is contribution page id using civicrm_api

This forum was archived on 2017-11-26.