Commit febbb79f by Arnout Kazemier

Merge pull request #14 from karlclement/master

Added webhookBody to the query params
parents a90fece9 f1f57b91
...@@ -18,14 +18,14 @@ function Person(api) { ...@@ -18,14 +18,14 @@ function Person(api) {
* Retrieve contact information by e-mail. * Retrieve contact information by e-mail.
* *
* ```js * ```js
* fullcontact.person.email('opensource@observe.it', [queue], [webhookUrl], [webhookId], fn); * fullcontact.person.email('opensource@observe.it', [queue], [webhookUrl], [webhookId], [webhookBody], [style], fn);
* ``` * ```
* *
* @returns {Person} * @returns {Person}
* @api public * @api public
*/ */
Person.prototype.email = function email() { Person.prototype.email = function email() {
var args = this.api.args(arguments, 'queue', 'webhookUrl', 'webhookId'); var args = this.api.args(arguments, 'queue', 'webhookUrl', 'webhookId', 'webhookBody', 'style');
this.send({ email: args.value }, args); this.send({ email: args.value }, args);
return this; return this;
......
...@@ -62,6 +62,13 @@ FullContact.prototype.process = function req(api, query, args) { ...@@ -62,6 +62,13 @@ FullContact.prototype.process = function req(api, query, args) {
if (args.webhookId) { if (args.webhookId) {
query.webhookId = args.webhookId; query.webhookId = args.webhookId;
} }
if (args.webhookBody) {
query.webhookBody = args.webhookBody;
}
if (args['style']) {
query['style'] = args['style'];
}
// //
// The packet that is send to the server or queued when we are in queuing // The packet that is send to the server or queued when we are in queuing
......
...@@ -39,6 +39,22 @@ describe('FullContact.Person', function () { ...@@ -39,6 +39,22 @@ describe('FullContact.Person', function () {
it('provides the proper casing'); it('provides the proper casing');
}); });
describe('#email with webhook url/id/bodyType', function () {
it('retrieves data by e-mail and sets up a webhook with the right url and id and body type', function (done) {
api.person.email('arnout@observe.it', null, 'http://requestb.in/1bxgb751', 'webhookTest', 'json', done);
});
it('provides the proper casing');
});
describe('#email with webhook url/id/bodyType/style', function () {
it('retrieves data by e-mail and sets up a webhook with the right url and id', function (done) {
api.person.email('arnout@observe.it', null, 'http://requestb.in/1bxgb751', 'webhookTest', 'json', 'dictionary', done);
});
it('provides the proper casing');
});
describe('#md5', function () { describe('#md5', function () {
var md5 = require('crypto').createHash('md5') var md5 = require('crypto').createHash('md5')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment