Answers.Body: <p>I think you're right. The table that links attachments to what they're attached to is <code>civicrm_entity_file</code>, and the table with details of the file itself is <code>civicrm_file</code>. In 4.4 (and indeed 4.6 and 4.7) the former has its own DAO but isn't its own API entity.</p>
  
  <p>If you want to get details of the attachments on some entity, you might need to write a custom API function wrapping <code>CRM_Core_BAO_File::getEntityFile</code>.</p>
  
  <p>One way you can present a link to the user to download the attachment, is <code>/civicrm/file?id=&lt;file ID&gt;&amp;eid=&lt;activity ID&gt;</code>, but they'll need the 'access uploaded files' permission. On Drupal (I don't know about roles and permissions in Wordpress) this means they'd either need to be actually logged into Civi with a role that has that permission, or the permission would need to be granted to anonymous users, which would mean anybody could grab any attachment by guessing the numbers.</p>
  
  <p>Another way you could allow your app to download an attachment is to write a custom API that base64-encodes the file contents and includes that in the API result.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T09:19:47.400Z
Answers.Text: Hmm, I hadn't actually heard about the Attachment.get API before as I'm on 4.4 myself. It's not in 4.4 but is in 4.6 and 4.7.
Answers.UserDisplayName: DaveFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T11:12:39.707Z
Answers.Text: See this question: http://civicrm.stackexchange.com/q/9586/2
Answers.UserDisplayName: DaveFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-14T09:12:10.287Z
Answers.LastActivityDate: 2016-04-14T09:12:10.287Z
Answers.UserDisplayName: DaveFF
Body: <p>This is through the REST API, I'm using CiviCRM 4.4.14, REST API v3.</p>
  
  <p>I read that there is an attachment API, but the attachment API does not seem to be available through the REST API.</p>
  
Tags: <api><attachments>
Title: How would I view an attachment PDF that is attached to a contact activity, through the REST API?
ThreadText: # How would I view an attachment PDF that is attached to a contact activity, through the REST API?
  
  (Asked by: username_0 on 2016-04-14)
  
  This is through the REST API, I'm using CiviCRM 4.4.14, REST API v3.
  
  I read that there is an attachment API, but the attachment API does not seem to be available through the REST API.
  
  **Tags:** api, attachments
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-04-14. Score: 1
  
  I think you're right. The table that links attachments to what they're attached to is `civicrm_entity_file`, and the table with details of the file itself is `civicrm_file`. In 4.4 (and indeed 4.6 and 4.7) the former has its own DAO but isn't its own API entity.
  
  If you want to get details of the attachments on some entity, you might need to write a custom API function wrapping `CRM_Core_BAO_File::getEntityFile`.
  
  One way you can present a link to the user to download the attachment, is `/civicrm/file?id=&eid=`, but they'll need the 'access uploaded files' permission. On Drupal (I don't know about roles and permissions in Wordpress) this means they'd either need to be actually logged into Civi with a role that has that permission, or the permission would need to be granted to anonymous users, which would mean anybody could grab any attachment by guessing the numbers.
  
  Another way you could allow your app to download an attachment is to write a custom API that base64-encodes the file contents and includes that in the API result.
  
  > **Comments:**
  > **username_1**: Hmm, I hadn't actually heard about the Attachment.get API before as I'm on 4.4 myself. It's not in 4.4 but is in 4.6 and 4.7.  
  > **username_1**: See this question: http://civicrm.stackexchange.com/q/9586/2  
  
  ---
  
  