Access Token support?
Does this API wrapper support using access tokens via OAuth for the api_key? I keep getting missing or invalid api key error when I attempt to.
It does not currently support that. I have not used the API with OAuth, and don't know what it takes to implement it.
I will be happy to accept a PR for it. It might be as easy as changing the constructor to accept an optional DC argument, as this is currently parsed from the api key.
I added a issue for browser side support, and closing the related tasks
Reopened, as relevant server side
See: https://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/
The access_token is used as an API key. Users don’t have access to these keys because they are tied directly to your application. But, the user can de-authorize your application in MailChimp, which removes and invalidates the token.
If you GET /oauth2/metadata:
{"dc":"us1","login_url":"https:\/\/login.mailchimp.com","api_endpoint":"https:\/\/us1.api.mailchimp.com"}
And concatenate the accessToken and the datacenter, ${accessToken}-${dc}, you should be able to pass this right to mailchimp as the api key.