Skip to content

datacenter not deriving from auth token #34

@ghost

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions