Register an Application

In the account drop-down menu, click Extras and choose API Keys

Under the “Developing an App?” heading, click Register and Manage Your Apps

Click Register an App

In the fields provided, input your application’s information and click Create

When creation is successful, you’ll see an Aplication created message appear, and more information at the end of your form, including the Client_ID and Client Secret

Obtain the Access Token It begins the authorization process by redirecting the user to the authorize_uri.
This is a GET request, and response_type=code, client_id, and the redirect_uri are included.
The user is prompted to enter their username and password to approve the application then you will redirect back to your redirect_uri as a GET request with the code parameter.
http://vsvives.blogspot.com/?code=219d43821aba59e3xxxxxxxxxxxxx
To obtain the access token make the POST request to https://login.mailchimp.com/oauth2/token with grant_type, client_id, client_secret, code, and redirect_uri.
curl --request POST \ --url 'https://login.mailchimp.com/oauth2/token' \ --data "grant_type=authorization_code&client_id={client_id}&client_secret={client_secret}&redirect_uri={encoded_url}&code={code}" \ --include
And the example response:
https://login.mailchimp.com/oauth2/authorize?response_type=code&client_id=12345&redirect_uri=http://vsvives.blogspot.com/
The user is prompted to enter their username and password to approve the application then you will redirect back to your redirect_uri as a GET request with the code parameter.
http://vsvives.blogspot.com/?code=219d43821aba59e3xxxxxxxxxxxxx
To obtain the access token make the POST request to https://login.mailchimp.com/oauth2/token with grant_type, client_id, client_secret, code, and redirect_uri.
curl --request POST \ --url 'https://login.mailchimp.com/oauth2/token' \ --data "grant_type=authorization_code&client_id={client_id}&client_secret={client_secret}&redirect_uri={encoded_url}&code={code}" \ --include
And the example response:
Dear Steve,
ReplyDeleteThanks for your valuable comment. I will keep publishing as you requested.