From c77d3a1d47fd47a438f909d5f8dfc66d1dce6f44 Mon Sep 17 00:00:00 2001 From: Colin Crawford <35497463+ColinCrawford@users.noreply.github.com> Date: Wed, 12 Sep 2018 10:19:44 -0400 Subject: [PATCH] add optional partnerId param support for connection's getTokenQuery method Marketo has an optional partner_id param that you can pass when requesting an oath token see http://developers.marketo.com/support/Marketo_LaunchPoint_Technology_Partner_API_Key.pdf --- lib/connection.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index ede0e73..7df3595 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -166,11 +166,16 @@ Connection.prototype.getOAuthToken = function(force) { }; Connection.prototype._getTokenQuery = function() { - return { + var queryOptions = { grant_type: 'client_credentials', client_id: this._options.clientId, client_secret: this._options.clientSecret }; + var partnerId = this._options.partnerId; + if (partnerId) { + queryOptions.partner_id = partnerId; + } + return queryOptions; }; module.exports = Connection;