Answers.Body: <p>Invoices can be send via email or can be downloaded. Both create an activity (of type "Emailed Invoice" or "Downloaded Invoice"). The invoice pdfs are attached to that activity.</p>
  
  <p>When you first get the activity via the API and collect the Activity ID, you can get information about the attachment via the "Attachment-Get" API function, where "entity_table" then should be "civicrm_activity" and "entity_id" should be the activity id.</p>
  
  <p>For example in php:</p>
  
  <pre><code>$result = civicrm_api3('Attachment', 'get', array(
    'sequential' =&gt; 1,
    'entity_table' =&gt; "civicrm_activity",
    'entity_id' =&gt; #activity_id#,
  ));
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-11T11:58:51.867Z
Answers.LastActivityDate: 2016-02-11T11:58:51.867Z
Answers.UserDisplayName: Catorghans
Body: <p>I can see that the invoices I have created are in the civicrm/custom map as invoiceID.pdf, but how can I link to them using Civicrm api?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-11T09:02:27.907Z
Comments.Text: What do you mean link to them?
Comments.UserDisplayName: Xavier
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-11T09:02:48.390Z
Comments.Text: Please update bit more details - like what are you trying to do - do you want to send this Invoice in email ??
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-12T18:09:41.487Z
Comments.Text: The invoices have been sent by mail. I want to make a my/invoices page where the current user has a linked list of all the invoices that have been sent to her.
Comments.UserDisplayName: Hans Rossel
Tags: <api><invoice>
Title: How to link to a stored invoice pdf with civicrm api
ThreadText: # How to link to a stored invoice pdf with civicrm api
  
  (Asked by: username_0 on 2016-02-11)
  
  I can see that the invoices I have created are in the civicrm/custom map as invoiceID.pdf, but how can I link to them using Civicrm api?
  
  **Tags:** api, invoice
  
  > **Comments:**
  > **username_1**: What do you mean link to them?  
  > **username_2**: Please update bit more details - like what are you trying to do - do you want to send this Invoice in email ??  
  > **username_0**: The invoices have been sent by mail. I want to make a my/invoices page where the current user has a linked list of all the invoices that have been sent to her.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2016-02-11. Score: 3 | Accepted answer
  
  Invoices can be send via email or can be downloaded. Both create an activity (of type "Emailed Invoice" or "Downloaded Invoice"). The invoice pdfs are attached to that activity.
  When you first get the activity via the API and collect the Activity ID, you can get information about the attachment via the "Attachment-Get" API function, where "entity_table" then should be "civicrm_activity" and "entity_id" should be the activity id.
  For example in php:
  $result = civicrm_api3('Attachment', 'get', array(
    'sequential' => 1,
    'entity_table' => "civicrm_activity",
    'entity_id' => #activity_id#,
  ));
  
  
  ---
  
  