Skip to main content

How to obtain Access Token for MailChimp REST API?


Register an Application 

In the MailChimp account, navigate to the Account page.

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.

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:

Comments

  1. Dear Steve,
    Thanks for your valuable comment. I will keep publishing as you requested.

    ReplyDelete

Post a Comment

Popular Posts

How to install draw.io Desktop Application on Kali Linux?

draw.io is an online diagramming open source web application which can be used as flowchart maker, network diagram software, ER diagram tool, UML diagramand more. It can be freely accessible website of draw.io or official Docker image or Desktop version for macOS, Linux & Windows. This guide includes detailed instructions about Desktop version installation on Kali Linux. Download the .deb build for draw.io sudo apt update sudo apt -y install wget curl curl -s https://api.github.com/repos/jgraph/drawio-desktop/releases/latest | grep browser_download_url | grep '\.deb' | cut -d '"' -f 4 | wget -i - Install with dpkg command sudo apt -f install ./drawio-amd64-*.de When application is installed, launch the application with following command. drawio Now application is ready to use. Click on " Create New Diagram"  to create new project or click on " Open Existing Diagram " to edit. ...

What is Honeypot?

A  honeypot is a security mechanism that creates a virtual trap to lure attackers. Simply we can say that this is a  decoy box residing inside your network demilitarized zone  (DMZ), set up by a security professional to trap or aid in locating hackers, or to draw them  away from the real target system. Since this a  decoy system , a malicious attacker might try to attack; software on  the system can log information about the attacker such as the IP address. This information  can be used to try to locate the attacker either during or after the attack. Honeypots vary based on design and deployment models, but they are all decoys intended to look like legitimate, vulnerable systems to attract cyber criminals. Type of Honeypot Production Honeypot : Used by companies and corporations for the purpose of researching the motives hackers as well ass diverting and mitigating the risk of attacks on the overall network. Research Honeypot : Used by nonprofit organi...

How to install Oracle Virtualbox in Ubuntu?

Introduction VirtualBox is a powerful free tool offered by Oracle for running an operating system on your computer virtually. In this tutorial lets learn how to install VirtualBox on Ubuntu. Installation 1. Open a terminal or press Ctrl + Alt +T 2. Enter the following command to all the packages or dependencies.      sudo apt-get update ( make sure to give the root password) 3. Run the following command to download and install Virtualbox     sudo apt-get install vrtualbox virtualbox-ext-pack That's all! VirtualBox has been successfully installed on your Ubuntu machine, and you can start using it.