Skip to content

Commit 13d7ef1

Browse files
author
Dilwoar Hussain
committed
Updates readme with documentation for webchat
- The outlines how to add new webchat providers. - Outlines the APIs required to get each provider working with valid statuses
1 parent b200f67 commit 13d7ef1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,40 @@ The yaml file contains a custom key of `:document_types` not used by wraith but
170170
bundle exec rake wraith:update_document_types[:sample_size]
171171
```
172172

173+
## Webchat
174+
175+
### How to add a new webchat provider
176+
1. Open to `lib/webchat.yaml`
177+
2. Append new entry:
178+
```yaml
179+
- base_path: /government/contact/my-amazing-service
180+
open_url: https://www.my-amazing-webchat.com/007/open-chat
181+
availability_url: https://www.my-amazing-webchat.com/007/check-availability
182+
```
183+
3. Deploy changes
184+
4. Go to https://www.gov.uk/government/contact/my-amazing-service
185+
5. Finished
186+
187+
### Required configuration
188+
189+
#### Base path
190+
This is the base path of a contact page, for example, `/government/organisations/hm-revenue-customs/contact/child-benefit`.
191+
This path should always be a contact page, any other content page type will result in the webchat component not being loaded.
192+
193+
#### Availability URL
194+
This URL is used to check the availability of agents at regular intervals.
195+
196+
| Function | Required |
197+
|-----------|-----------|
198+
| Request Method | GET |
199+
| Response Format | JSON |
200+
| Request Example | {"status":"success","response":"BUSY"} |
201+
| Valid statuses | ["BUSY", "UNAVAILABLE", "AVAILABLE", "ERROR"] |
202+
203+
#### Open URL
204+
This url is used to start a webchat session.
205+
This url should not include session ids or require anything specific parameters to be generated.
206+
173207
## Licence
174208

175209
[MIT License](LICENCE)

0 commit comments

Comments
 (0)