Skip to content

Commit

Permalink
Merge pull request #1631 from alphagov/RobBond-GDS-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
sihugh authored Jun 8, 2020
2 parents b80a205 + e917aa5 commit 9a57f88
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,14 @@ bundle exec rake wraith:update_document_types[:sample_size]
open_url: https://www.my-amazing-webchat.com/007/open-chat
availability_url: https://www.my-amazing-webchat.com/007/check-availability
```
3. Deploy changes
4. Go to https://www.gov.uk/government/contact/my-amazing-service
5. Finished
### CORS considerations
To avoid CORS and CSP issues a new provider would need to be added to the Content Security Policy
### Required configuration
#### Base path
Expand All @@ -196,14 +200,28 @@ This URL is used to check the availability of agents at regular intervals.
| Function | Required |
|-----------|-----------|
| Request Method | GET |
| Response Format | JSON |
| Response Format | JSON/JSONP (Default to JSONP) |
| Request Example | {"status":"success","response":"BUSY"} |
| Valid statuses | ["BUSY", "UNAVAILABLE", "AVAILABLE", "ERROR"] |
| Valid statuses | ["BUSY", "UNAVAILABLE", "AVAILABLE","ONLINE", "OFFLINE", "ERROR"] |

#### Open URL
This url is used to start a webchat session.
This url should not include session ids or require anything specific parameters to be generated.

### Optional Configuration options

#### Browser window behaviour
By default the chat session would open in an a separate browser window. An additional value can be added to the yaml entry that will allow the web chat to remain in the current browser window.
```yaml
open_url_redirect: true
```
#### Payload format

The default response from the api as used by HMRC webchat provider is JSONP. To add a provider that responds using JSON the following entry needs to be added.
```yaml
availability_payload_format: json
```

## Licence

[MIT License](LICENCE)

0 comments on commit 9a57f88

Please sign in to comment.