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

Source Mailchimp: add oauth flow (java part) #7406

Closed
Tracked by #6273
annalvova05 opened this issue Oct 27, 2021 · 1 comment
Closed
Tracked by #6273

Source Mailchimp: add oauth flow (java part) #7406

annalvova05 opened this issue Oct 27, 2021 · 1 comment

Comments

@annalvova05
Copy link
Contributor

Source Mailchimp: add oauth flow (java part)

https://mailchimp.com/developer/marketing/guides/access-user-data-oauth-2/

=========== JAVA PART ================

Approve access from the customer side using:
client_id

https://login.mailchimp.com/oauth2/authorize?response_type=code&client_id=1234567890&redirect_uri=https://airbyte.io/

Get redirect url with 'code':

https://airbyte.io/?code=33333333

Obtain token using

curl https://login.mailchimp.com/oauth2/token
-X POST
-H 'Content-Type: application/json'
-d '{
"client_id": "1234567890",
"client_secret": "2222222",
"grant_type": "authorization_code",
"code": "3333333",
"redirect_uri": "https://airbyte.io/"
}'

RESPONSE:
{
"access_token": "1q2w3e4r5t6y.",
"expires_in": "0",
"scope": null
}

OAuth access tokens do not expire.

Obtain server_prefix (dc) using

curl https://login.mailchimp.com/oauth2/metadata
-X GET
-H 'Authorization: Bearer <access_token>'

RESPONSE:
{
"dc": "us2",
"role": "admin",
"accountname": "Airbyte",
"user_id": 123,
"login": {
"email": "email@email.com",
"avatar": null,
"login_id": 12345,
"login_name": "email@email.com",
"login_email": "email@email.com"
},
"login_url": "https://login.mailchimp.com",
"api_endpoint": "https://us2.api.mailchimp.com"
}

============== PYTHON PART =====================

API requests using access_token and server_prefix (dc).

$ curl
-s https://{server_prefix}.api.mailchimp.com/3.0/campaigns
-H 'Authorization: Bearer <access_token>'

@antixar
Copy link
Contributor

antixar commented Nov 4, 2021

Duplicate
It'll be fixed with #6273

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

No branches or pull requests

5 participants