Closed tw1t611 closed 3 years ago
@tw1t611 hi!
NewPerson
constructor expects only name
parameter.
To add a new person with an email use a simple object that contains fields you want to fill. Here is an example:
const personsApi = new lib.PersonsApi();
let opts = {
newPerson: {
name: 'Robin Good',
email: 'robin@test.com'
},
};
personsApi.addPerson(opts).then((data) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
res.send(JSON.stringify(data));
}, (error) => {
console.error(error);
});
Expected result:
"email": [
{
"value": "robin@test.com",
"primary": true,
"label": ""
}
],
Thank you very much, I'd really like that example in the docs. Closing now. :)
I am trying to add a person with an email field on v11. https://github.com/pipedrive/client-nodejs/blob/v11/docs/PersonsApi.md#addPerson
I tried several combinations. Its fine, if its not implemented yet. Just to make sure, that the request was made properly:
Response:
Expected: