Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datacenter not deriving from auth token #34

Open
ghost opened this issue Jan 25, 2014 · 0 comments
Open

datacenter not deriving from auth token #34

ghost opened this issue Jan 25, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 25, 2014

In MailChimpAPI_v2_0.js the constructor takes an apiKey which is split and then uses as the datacenter prefix for .api.mailchimp.com. If I have already negotiated an oauth token externally to your library, currently need to fudge the API key so the datacenter is correctly derived from the user profile, and then force the actual auth token attribute

My current workflow is something like this :

getAPI = function(sysImports) {  
  var api = new MailChimpAPI(
      ' -' + JSON.parse(sysImports.auth.oauth.profile).dc,       
      {    
        version : '2.0'
    }
  );
  api.apiKey = sysImports.auth.oauth.token;
  return api;
}

... to get the right dc.

Is there a better way to use prenegotiated oauth profile and token or can I please otherwise request that datacenter be part of MailChimpAPI_v2_0 constructor options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants