Skip to content

Instantly share code, notes, and snippets.

@scottsbaldwin
Created April 27, 2017 22:16
Show Gist options
  • Save scottsbaldwin/36d9f7bc448ee651112f7499e4b564bc to your computer and use it in GitHub Desktop.
Save scottsbaldwin/36d9f7bc448ee651112f7499e4b564bc to your computer and use it in GitHub Desktop.
Add file to deal in Pipedrive using node.js client
'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