-
You should see a popup with your API Access token. You're done!
-
Enter an app name and select a workspace. You may be prompted to log in if your workspace is not listed:
-
Under "Add features and functionality", click "Permissions":
-
Add the following permission scopes, then "Save Changes":
-
Scroll back up and click "Install App to Workplace". When asked to confirm, click "Authorize":
-
Your OAuth Access Token should now be visible under "Tokens for your Workspace". You're done!
- Handler : Handles all incoming HTTP requests for a particular resource, invoking the appropriate translator, and eventually returning the result in a uniform format.
- Translator: Makes outgoing requests to a particular service.
- Service: Any messaging API we can make outgoing queries against.
sanity.py
: Basic tests to make sure the API isn't completely broken.unichat/app.py
: Sets everything up. Configures handlers+endpoints, routes, errors, etc.unichat/errors.py
: Maps raisable exceptions to error handling code.unichat/models.py
: Defines basic data objects passed between handlers and translators.unichat/util.py
: Contains various generically useful helper functions.unichat/handlers.py
: Defines falcon Resources for each endpoint. Handlers invoke the appropriate translator depending on the service requested.unichat/translators/*
: Contains Translators to manage requests to various messaging APIs.
Note: Currently make test
only runs a very basic test to see if the server
returns an HTTP error for a valid request, with no other checks of any kind.
Prerequisites: User must have Python 3, pip, and pipenv installed Before running tests, modify test.config.sample (adding authentication tokens as necessary) and save it as test.congig. Otherwise, any tests requiring authentication will fail.
In one terminal:
$ make install # (If this is the first time)
$ make serve
In another:
$ make test
Or, for more verbose output (such as the JSON returned from each request):
$ make test-verbose
To generate and view the documentation: (after running make install
in the
base directory):
cd ./docs
make livehtml
This will run an auto-reloading server on port 8080.