API endpoints
jonathanstegall opened this issue · 3 comments
jonathanstegall commented
We need to at least be able to:
- Send user info to MailChimp and create or update their subscription ✅
- Get user info from MailChimp (determine what lists they're subscribed to via an API url) ✅
- Check for city/state from zip code ✅
- Check if a user exists on the website with a given email address. ✅
- Create a user account on website ✅
- Change the URLs for these links on the Salesforce/Stripe app. This is done, it's just not live.
jonathanstegall commented
Full list of URLs from Drupal:
accounts
- /accounts/exists
- accepts
$_POST['email']
- returns
drupal_json(array('status' => 'success', 'reason' => 'user exists', 'uid' => $success->uid));
if successful
- /accounts/create
- first checks to see if user exists. returns
drupal_json(array('status' => 'success', 'reason' => 'user exists', 'uid' => $success->uid));
if user does exist. - accepts
$_POST['email']
,$_POST['password']
,$_POST['first']
,$_POST['last']
,$_POST['city']
,$_POST['state']
,$_POST['zip']
,$_POST['stripe_customer_id']
- returns
drupal_json(array('status' => 'success', 'reason' => 'new user', 'uid' => $success->uid));
if successful
- /accounts/check_zip
- accepts
$_POST['zipcode']
and$_POST['country']
- returns
drupal_json(array('status' => 'success', 'state' => $state, 'city' => $city));
if successful
mailchimp
- /mailchimp/minnpost/api
- accepts
$_POST['minnpost_mailchimp_js_form_action'] = 'newsletter_subscribe';
,$_POST['minnpost_mailchimp_firstname']
,$_POST['minnpost_mailchimp_lastname']
,$_POST['minnpost_mailchimp_email']
- /mailchimp/minnpost/groups
jonathanstegall commented
We're using this branch of the SF/Stripe app to make these changes, and will merge it into master and deploy it to Heroku when the site is launched. https://github.com/MinnPost/salesforce-stripe/tree/switching-to-wordpress
jonathanstegall commented
This is fixed with the above branch, as of this commit. MinnPost/donations@908de7a