Created
April 27, 2017 22:16
-
-
Save scottsbaldwin/36d9f7bc448ee651112f7499e4b564bc to your computer and use it in GitHub Desktop.
Add file to deal in Pipedrive using node.js client
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
'use strict'; | |
var Pipedrive = require('pipedrive'); | |
var pipedrive = new Pipedrive.Client(process.env.PIPEDRIVE_API_TOKEN, { strictMode: true }); | |
var params = { | |
"file_path": "/path/to/document.pdf", | |
"deal_id": 1 | |
}; | |
pipedrive.Files.add(params, (err, f) => { | |
if (err !== null) { | |
callback(err); | |
} | |
console.log(`File has been added to ${params["deal_id"]}.`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment