Skip to content

Commit

Permalink
add optional partnerId param support for connection's getTokenQuery m…
Browse files Browse the repository at this point in the history
…ethod

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
  • Loading branch information
colinc-zylotech authored Sep 12, 2018
1 parent 4cdfb81 commit c77d3a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit c77d3a1

Please sign in to comment.