Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions docs/HOWTO_INTEGRATE_BANDWIDTH.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bandwidth Integration

Bandwidth.com is a telephone service API company. To use Bandwidth, set `DEFAULT_SERVICE=bandwidth`. The `sticky-sender` and `num-picker` service managers are required for the Bandwidth extension to work. `sticky-sender` must come before `numpicker-basic` in the `SERVICE_MANAGERS` environment variable.
Bandwidth.com is a telephone service API company. To use Bandwidth, set `DEFAULT_SERVICE=bandwidth`. The `sticky-sender` and `numpicker-basic` service managers are required for the Bandwidth extension to work. `sticky-sender` must come before `numpicker-basic` in the `SERVICE_MANAGERS` environment variable. NOTE: Because service managers are complicated, there is not an entry for SERVICE_MANAGERS in the Spoke Documentation Hub. Just add it as an enviromental variable.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the documentation for Service Managers

We could have the Service Managers doc (linked above) can have a new section for ngpvan and beneath it, link the HOWTO Integrate Bandwidth. I'd be happy to make those changes and push them to this branch. :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look at what is required to update the Service Managers doc. Please feel free to close the request :)


For setting up a development environment with Bandwidth, first read [this section](HOWTO_DEVELOPMENT_LOCAL_SETUP.md#ngrok).

Expand All @@ -9,23 +9,26 @@ For setting up a development environment with Bandwidth, first read [this sectio

1. Create a Bandwidth account and login.
2. Create a sub-account.
3. Add a location to your sub-account.
4. Give the location a name.
5. Click the "MESSAGING" tab of the location.
6. Fill out the following fields:
3. Note the sub-account id for use later.
4. Add a location to your sub-account.
5. Give the location a name.
6. Note the location id for use later.
7. Click the "MESSAGING" tab of the location.
8. Fill out the following fields:
1. Enable `SMS Enabled`
2. Enable `Toll Free`
3. Enable `Short Codes`
3. Enable `Short Codes` (This may not be enablable, depending on your Bandwitdth account)
4. Enable `V2 Messaging`
5. Enable `MMS Enabled`
7. Leave all other values as their default value.
8. Click the "SAVE CHANGES" button.
9. Create an application. Fill out the following fields:
1. Callback URL: `<BASE_URL_ENV_VAR>/bandwidth/<ORGANIZATION_ID>`
2. Enable `Use a username/password for callbacks`
3. Callback user ID: `bandwidth.com`
10. Open a new tab and go to the following website: https://www.tutorialspoint.com/execute_nodejs_online.php
11. Paste the following code into the code editor:
9. Leave all other values as their default value.
10. Click the "SAVE CHANGES" button.
11. Create an application. Fill out the following fields:
1. Callback URL: `<BASE_URL_ENV_VAR>/bandwidth/<ORGANIZATION_ID>` for example https://your-spoke.herokuapp.com/bandwidth/1
2. NOTE: If your Spoke instance doesn't have a BASE_URL environmental variable **you must set it**. The BASE_URL environmental variable should not include the trailing slash (ie. just https://your-spoke.herokuapp.com)
3. Enable `Use a username/password for callbacks`
4. Callback user ID: `bandwidth.com`
12. Open a new tab and go to the following website: https://www.tutorialspoint.com/execute_nodejs_online.php
13. Paste the following code into the code editor. The values can be found in your environmental variables :
```
const crypto = require("crypto");
const hmac = crypto.createHmac("sha256", "<SESSION_SECRET_ENV_VAR>");
Expand All @@ -38,12 +41,13 @@ For setting up a development environment with Bandwidth, first read [this sectio
14. Paste the value into the following "Callback password" field. This value being set as the callback password provides HMAC authentication for Bandwidth.
15. Leave all other fields as their default value.
16. Click the "CREATE APPLICATION" button.
17. Associate the created location to the application.
17. Note the Application Id that is created for use later.
18. Associate the created location to the application.


## Spoke Instructions

1. Navigate to the admin settings page of an organization.
2. Under the "Bandwidth Config" section, enter your Bandwidth account ID, API username, and API password. The API user must have the `Configuration` role in Bandwidth.
3. In the Advanced tab, fill out the sub-account, location, and application IDs.
2. Under the "Bandwidth Config" section, enter your Bandwidth account ID, API username (probably your email address), and API password (probably just your account password). If you use an API, the user must have the `Configuration` role in Bandwidth. You can check this by looking under the Users menu and checking on the Roles assigned to the user.
3. In the Advanced tab, fill out the sub-account, location, and application IDs you noted down above.
4. Click the "SAVE CREDENTIALS" button.