Answers.Body: <p>There was an ongoing discussion at chat.civicrm.org and also at <a href="https://github.com/civicrm/civicrm-core/pull/25845" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/25845</a>. Short answer is it's not implemented yet.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-30T16:38:37.590Z
Answers.LastActivityDate: 2023-04-30T16:38:37.590Z
Answers.UserDisplayName: Demerit
Body: <p>So I am kinda new to civiCRM, I am using the API v4 and creating cases with it.
  but I have two questions about the attachments. the attachments are linked to the activity and the activity is linked to the case. so in order to get the attachements we need to get throw all those tables.</p>
  <p><em>PS: attachments are referred as File in the api explorer.</em></p>
  <p>in the API V4 explorer, we notice that we need a join in order to link the activity and case and for that we have an entity bridge called caseActivity it works just fine.
  but for the File and Activity entities we don't have an entity bridge like caseActivity.
  so my question is how can we link between Activity and File entities knowing that we have a SQL table called civicrm_entity_file that has the data we need for the join.</p>
  <p><a href="https://i.sstatic.net/Wkk7Y.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Wkk7Y.png" alt="enter image description here" /></a></p>
  <p>so the final goal is to get a case based on it's ID and get the attachments and the activity.</p>
  <p>Another question I have : how to do the upload (File) using the API v4 ?</p>
  
Tags: <wordpress><civicrm-entity>
Title: how to manipulate attachments using API V4 in CiviCRM 5.60
ThreadText: # how to manipulate attachments using API V4 in CiviCRM 5.60
  
  (Asked by: username_0 on 2023-04-30)
  
  So I am kinda new to civiCRM, I am using the API v4 and creating cases with it.
  but I have two questions about the attachments. the attachments are linked to the activity and the activity is linked to the case. so in order to get the attachements we need to get throw all those tables.
  
  *PS: attachments are referred as File in the api explorer.*
  
  in the API V4 explorer, we notice that we need a join in order to link the activity and case and for that we have an entity bridge called caseActivity it works just fine.
  but for the File and Activity entities we don't have an entity bridge like caseActivity.
  so my question is how can we link between Activity and File entities knowing that we have a SQL table called civicrm\_entity\_file that has the data we need for the join.
  
  [![enter image description here](https://i.sstatic.net/Wkk7Y.png)](https://i.sstatic.net/Wkk7Y.png)
  
  so the final goal is to get a case based on it's ID and get the attachments and the activity.
  
  Another question I have : how to do the upload (File) using the API v4 ?
  
  **Tags:** wordpress, civicrm-entity
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-04-30. Score: 1 | Accepted answer
  
  There was an ongoing discussion at chat.civicrm.org and also at <https://github.com/civicrm/civicrm-core/pull/25845>. Short answer is it's not implemented yet.
  
  
  ---
  
  