# File

Users can create the ContentVersion or Attachment from the response and link that to the parent as well using the Action Type as File.

**For Attachment :** Used in the classic version. Users can query in the lightning version if required.

**RESPONSE HANDLER FOR ATTACHMENT :**

* **JSON**
* **Octet-Stream**

JSON : In response header Content-Type: application/json should be present and the format for response mapping is as follows.<br>

{"Body":"/BodyData","Name":"/fileName","parentId":"{!$RecordId}"}

\
Example = { "BodyData": "0696D000001iVoBQAU", "fileName": "int1.png", "parentId": "{!$RecordId}"}\
\
BodyData- It should be a byte stream coming in the response with the key asBodyDat&#x61;**.**

fileName - it should be the name of the file which the end user wants to give along with extension.

**Integration Action :**

Select File as the Action Type. Select Attachment as the File.

<figure><img src="https://1271267903-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F899iGp7icc9A7KXck3HI%2Fuploads%2FZq6yzhGrtPJDwEKQIR9u%2FPicture%201.png?alt=media&#x26;token=8efff01f-895b-44ed-9548-73ee8101ba19" alt=""><figcaption></figcaption></figure>

Octet-Stream : In response header Content-Type: application/octet-stream should be present  and the format for response mapping is as follows.

Body,ContentType,Name,parentId<br>

<figure><img src="https://lh3.googleusercontent.com/G6V6P4xPDkWGSUFEnvXPd1A-aOEwMwJK7rVSh6-4sBsWcWQm5lWmDtMELEdQXEW9ksVmwyMxnLIQcmO9VobusMggZkp5MIQ2-TE3mWRRycHOErpelyzxpVgiVgVeDXFlNY2jPeZKe7vwb7CDCrbf364" alt=""><figcaption></figcaption></figure>

<br>

**RESPONSE HANDLER FOR CONTENT-VERSION**

Select File as the Action Type. Select Content Version as the File.

* JSON
* Octet-Stream

JSON : In response header Content-Type: application/json should be present and the format for response mapping is as follows.

\
{"VersionData":"/FileData","Title":"/fileName","LinkedEntityId":"{!$RecordId}"}<br>

Example = {"FileData":"0695g000008FzHZAA0","FileName":"int1.png","ParentId":"{!$RecordId}"}<br>

VersionData- It should be a byte stream coming in the response with a key as BodyData(Any key name)

FileName- It should be the name of the file which the end user wants to give along with the extension.

**Integration Channel :**&#x20;

<figure><img src="https://lh5.googleusercontent.com/hL5NcFadED0hAc7oGk3g-xPiyII5IcFJZ1bXy62yVvgKVw-htnwCnKqLcBJ2EB0kAF58svdSd9zN29I-eXnb7YfHkBey_jBorUEwHNUgFyd4mC5uq1wg0JmQU6GdQIaTYoWC5vR8FZG75k4-CzTmrk0BRBTfI4FzTyJLStR4KiULcl_F65Fzci_IRotNSg" alt=""><figcaption></figcaption></figure>

**Integration Action :**

<figure><img src="https://lh5.googleusercontent.com/7be4sTCc7DnBAdy3AuTM6xUT26RzLm3dz0DBw4vReFdiIHEPI_rDO1j43Z7gZwSTXvh9suW4j_YERt1GGVm7P-3oMPAOqnEk1Mc6RDL6tjxYqX34TyBGhfesXetjyCz6T4vSXd4mtflH4FcC9NERjL81WwCOYW318Vse2aO7uKHccIruMOwSRUi2k5BXLg" alt=""><figcaption></figcaption></figure>

Octet-Stream : In response header Content-Type: application/octet-stream should be present and the format for response mapping is as follows.<br>

VersionData,FileExtension,Title,LinkedEntityId<br>

<figure><img src="https://lh3.googleusercontent.com/jaow3cMOF6XQy_i_brB5E9uM4Qljqgv_wYMVwpSfWgUhp0ZaR_6xUDDSt17IFobVIem1X_nAr84grWgdOgfYPizLxVF-6BEWAfbkaSlnnc6PY6QlqMpb-zcqVE40mcUUSEDyhKser2I8T8Dfvcw1SLQ" alt=""><figcaption></figcaption></figure>

"And that’s how you use the File—simple, seamless, and ready to go!"<br>
