Answers.Body: <p>Using the API is the recommended way to access CiviCRM information from an extension, so you are on the right tracks. You can study <a href="https://github.com/cividesk/com.cividesk.cardreader/blob/master/CRM/Cardreader/Page/Callback.php#L50" rel="nofollow">https://github.com/cividesk/com.cividesk.cardreader/blob/master/CRM/Cardreader/Page/Callback.php#L50</a> for an example on how to call the CiviCRM API. You need to read <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference" rel="nofollow">https://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference</a> and use the API explorer to get familiar with the API. You can access the API explorer by using the slug civicrm/api/explorer on your CiviCRM instance.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-18T16:22:36.003Z
Answers.LastActivityDate: 2016-07-18T16:22:36.003Z
Answers.UserDisplayName: cividesk
Answers.Body: <p>I think you are looking for the API getfields action? In the API explorer you can do a getfields and it will show you the possible fields for the API. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-18T08:27:54.813Z
Answers.LastActivityDate: 2016-07-18T10:26:18.213Z
Answers.LastEditDate: 2016-07-18T10:26:18.213Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I am working on an extension which requires me to use Civi Contribute.Yet i have not tried anything yet as i don't now the approach, so i wish to obtain the details of a particular contribution transaction such as total_amount, email ... so that i can use it in the extension, I have thought of using an API method but i am not clear of the details and if at all that is what i have to use. Something like the content of $params?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-18T08:26:24.113Z
Comments.Text: Not too sure what you're asking. If you're writing an extension, have you tried writing business logic developed using skeletons in $your_domain/civicrm/api ?
Comments.UserDisplayName: DMCoding
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-18T08:27:07.083Z
Comments.Text: It also seems like you might wanna read up on the API and its invocation first...
Comments.UserDisplayName: DMCoding
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-07-18T11:46:03.760Z
Comments.Text: It might be helpful if you provide more details about what you're trying to do -- for example, are you trying to alter details of a contribution before it's created? after a form is submitted? after it's created? during a particular workflow? In an extension, the API would be used to interact with the existing contribution, but it sounds like you're first issue is trying to determine what hook to work with.
Comments.UserDisplayName: lcdservices
Tags: <civicontribute><drupal><extension><developer>
Title: Fetching Contribution Information
ThreadText: # Fetching Contribution Information
  
  (Asked by: username_0 on 2016-07-18)
  
  I am working on an extension which requires me to use Civi Contribute.Yet i have not tried anything yet as i don't now the approach, so i wish to obtain the details of a particular contribution transaction such as total\_amount, email ... so that i can use it in the extension, I have thought of using an API method but i am not clear of the details and if at all that is what i have to use. Something like the content of $params?
  
  **Tags:** civicontribute, drupal, extension, developer
  
  > **Comments:**
  > **username_1**: Not too sure what you're asking. If you're writing an extension, have you tried writing business logic developed using skeletons in $your_domain/civicrm/api ?  
  > **username_1**: It also seems like you might wanna read up on the API and its invocation first...  
  > **username_2**: It might be helpful if you provide more details about what you're trying to do -- for example, are you trying to alter details of a contribution before it's created? after a form is submitted? after it's created? during a particular workflow? In an extension, the API would be used to interact with the existing contribution, but it sounds like you're first issue is trying to determine what hook to work with.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2016-07-18. Score: 1
  
  Using the API is the recommended way to access CiviCRM information from an extension, so you are on the right tracks. You can study <https://github.com/username_3/com.username_3.cardreader/blob/master/CRM/Cardreader/Page/Callback.php#L50> for an example on how to call the CiviCRM API. You need to read <https://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference> and use the API explorer to get familiar with the API. You can access the API explorer by using the slug civicrm/api/explorer on your CiviCRM instance.
  
  
  ---
  
  ### Answer by username_4 on 2016-07-18. Score: 1
  
  I think you are looking for the API getfields action? In the API explorer you can do a getfields and it will show you the possible fields for the API.
  
  
  ---
  
  