The org is the Slack team name, usually the hostname from your .slack.com.
The slacktoken is a token for a user with admin access. You can get one from https://api.slack.com/docs/oauth-test-tokens
Recommend creating a bot user with admin to use for invites.
The action should do a http call to the slack API using the team host and token, then Slack will send the invite to the email provided.
Expose action
Create a public url to invoke the action using wsk CLI
wsk api-experimental create /openwhisk-team /slackinvite GET slackinvite
The command will print the new url created
ok: created api /slackinvite GET for action slackinvite
https://21ef035.api-gw.mybluemix.net/openwhisk-team/slackinvite
Verify the exposed url by invoking using the curl CLI or a web browser
curl -X GET https://21ef035.api-gw.mybluemix.net/openwhisk-team/slackinvite?email=user@example.com
Update index.html
Edit the line var actionUrl = "https://..."; and replace the value with your new url that expose your new action.
Deploy to GitHub Pages
Create a new GitHub repo, then go to settings, and set the master branch as GitHub Pages.
Push the modified index.html to the new repo, then your webpage will be accesible from https://$username.github.io/$reponame
openwhisk-slackinvite
Simple webpage for invitations for Apache OpenWhisk Slack Community.
Join our Slack: https://openwhisk.apache.org/slack.html
The backend is implemented as a serverless action with an API gateway route.
Installing
Deploy action
Configure the
wskCLI with authentication and hostCreate the action using
wskCLI and set default parametersThe org is the Slack team name, usually the hostname from your .slack.com. The slacktoken is a token for a user with admin access. You can get one from https://api.slack.com/docs/oauth-test-tokens Recommend creating a bot user with admin to use for invites.
Verify the action by invoking with the
wskCLIThe action should do a http call to the slack API using the team host and token, then Slack will send the invite to the email provided.
Expose action
Create a public url to invoke the action using
wskCLIThe command will print the new url created
Verify the exposed url by invoking using the
curlCLI or a web browserUpdate index.html
Edit the line
var actionUrl = "https://...";and replace the value with your new url that expose your new action.Deploy to GitHub Pages
Create a new GitHub repo, then go to settings, and set the master branch as GitHub Pages. Push the modified
index.htmlto the new repo, then your webpage will be accesible fromhttps://$username.github.io/$reponameLicense: Apache-2.0