Created
May 4, 2017 01:33
-
-
Save jordanwalsh23/93577aef49274061904a6ded22345947 to your computer and use it in GitHub Desktop.
Developers Guide to Lending - Snippet 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Dependencies | |
| const fs = require('fs') | |
| //Attach the loan agreement to the Contact | |
| let loanContract = { | |
| FileName: "loanContract.pdf", | |
| MimeType: "application/pdf" | |
| } | |
| let filePath = "/path/to/some/loanContract.pdf" | |
| let fileReadStream = fs.createReadStream(filePath) | |
| let attachmentObj = xeroClient.core.attachments.newAttachment(loanContract) | |
| return attachmentObj.save(`Contacts/${contactID}`, fileReadStream, true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment