This is a simple microservice that will check if a given email exists in our member list per mailchimp
- A recent-ish version of node (I've tested this in v7.1.0 and v9.5.0), npm, and yarn
- Checkout the repository:
git checkout [email protected]:SeattleDSA/sdsa-member-verification.git
- Install dependencies
yarn install
- Setup required configuration environment variables. This can be done with a
.env
file in the project root
MAILCHIMP_API_KEY
MAILCHIMP_CONTACT_LIST_ID
MAILCHIMP_MEMBER_SEGMENT_ID
# This is the key clients will use to authenticate against this API
API_KEY
- Run the development server
# Starts a server on port 3000, overridable with PORT=[port]
npm start
Currently, the endpoint supports a single call. Authentication is acheived by providing an Authorization
http header with a value of the valid API key
POST /?email=[email]
. Responds with a200
status code and{ "isMember": [true|false ] }
, or a400
or500
status code and{ "error": "an error message" }
> curl -H "Authorization:api-key" -X POST localhost:3000/\?email='[email protected]'
{"isMember":false}%