This command is based on two other slash commands that can be found below:
http://developer.mixmax.com/docs/overview-slash-commands#tutorial-building-mygiphy https://github.com/simonxca/mixmax-soundcloud-slash-command
- Install using
npm install
- Run using
npm start
To simulate locally how Mixmax calls the typeahead URL (to return a JSON list of typeahead results), run:
curl https://localhost:9145/typeahead?text=cats --insecure
To simulate locally how Mixmax calls the resolver URL (to return HTML that goes into the email), run:
curl https://localhost:9145/resolver?text=cats --insecure
Mixmax slash command APIs are required to be served over https. This is because they are queried directly from the Mixmax client in the browser (using AJAX) that's running on an https domain. Browsers forbid AJAX requests from https domains to call http APIs, for security. So we must run an https server with a locally-signed certificate.
See here for how to fix the ERR_INSECURE_RESPONSE error that you might get in Chrome.