Skip to content

Commit e917aa5

Browse files
authored
Update README.md
1 parent 31be1de commit e917aa5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,14 @@ bundle exec rake wraith:update_document_types[:sample_size]
180180
open_url: https://www.my-amazing-webchat.com/007/open-chat
181181
availability_url: https://www.my-amazing-webchat.com/007/check-availability
182182
```
183+
183184
3. Deploy changes
184185
4. Go to https://www.gov.uk/government/contact/my-amazing-service
185186
5. Finished
186187
188+
### CORS considerations
189+
To avoid CORS and CSP issues a new provider would need to be added to the Content Security Policy
190+
187191
### Required configuration
188192
189193
#### Base path
@@ -196,14 +200,28 @@ This URL is used to check the availability of agents at regular intervals.
196200
| Function | Required |
197201
|-----------|-----------|
198202
| Request Method | GET |
199-
| Response Format | JSON |
203+
| Response Format | JSON/JSONP (Default to JSONP) |
200204
| Request Example | {"status":"success","response":"BUSY"} |
201-
| Valid statuses | ["BUSY", "UNAVAILABLE", "AVAILABLE", "ERROR"] |
205+
| Valid statuses | ["BUSY", "UNAVAILABLE", "AVAILABLE","ONLINE", "OFFLINE", "ERROR"] |
202206

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

211+
### Optional Configuration options
212+
213+
#### Browser window behaviour
214+
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.
215+
```yaml
216+
open_url_redirect: true
217+
```
218+
#### Payload format
219+
220+
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.
221+
```yaml
222+
availability_payload_format: json
223+
```
224+
207225
## Licence
208226

209227
[MIT License](LICENCE)

0 commit comments

Comments
 (0)