From Bright Pattern Documentation
|
|
Line 1: |
Line 1: |
− | <translate>= Request Chat =
| + | #REDIRECT [[Api]] |
− | ''Request Chat'' initiates a chat session. It provides values of all or some of the [[mobile-web-api-specification/ExpectedParameters|expected parameters]], and it may also contain the phone number of the mobile device. Depending on the [[contact-center-administrator-guide/Messaging|scenario entry configuration]], a callback can be initiated automatically to the specified number as soon as the chat request is delivered to the agent.
| |
− | | |
− | Note that if the mobile/web scenario entry is not configured for automatic callback, the agent can still use this number to call the mobile user manually, either upon the agent's own initiative or when asked to do this via a chat message from the mobile user.
| |
− | | |
− | Parameter ''from'' may be used to specify either the device owner’s name or phone number. It will be placed in the scenario variable ''$(item.from)''.
| |
− | | |
− | == URL ==
| |
− | http[s]://<host>:<port>/clientweb/api/v1/chats?tenantUrl=<tenantUrl>
| |
− | | |
− | == Method ==
| |
− | POST
| |
− | | |
− | == Request body ==
| |
− | Names and values of record fields (content type: application/json)
| |
− | | |
− | === Example ===
| |
− | {|border="1" style="border-collapse:collapse" cellpadding="5"
| |
− | |''{''
| |
− | | |
− | <blockquote>''“phone_number”:”phone number for callback, if necessary”,''
| |
− | | |
− | ''“from”:”propagated into scenario variable $(item.from)”,''
| |
− | | |
− | ''“parameters”:''
| |
− | | |
− | ''{ //list of expected parameters''
| |
− | | |
− | ''"parameter_1":"value_1", ''
| |
− | | |
− | ''..., ''
| |
− | | |
− | ''"parameter_n":"value_n"''
| |
− | | |
− | ''},''
| |
− | </blockquote>
| |
− | ''}''
| |
− | |}
| |
− | | |
− | == Returns ==
| |
− | 200 – Chat session properties (content type: application/json)
| |
− | | |
− | === Example ===
| |
− | {|border="1" style="border-collapse:collapse" cellpadding="5"
| |
− | |''{''
| |
− | | |
− | ''"chat_id":”<chat ID>”,''
| |
− | | |
− | <blockquote>''“state”: “<queued|connected|ivr>”,''
| |
− | | |
− | ''“ewt”:<estimated wait time for a chat in state queued>,''
| |
− | | |
− | ''“is_new_chat”: true|false,''
| |
− | | |
− | ''“phone_number”:”phone number that will be used for callback”''
| |
− | </blockquote>
| |
− | ''}''
| |
− | |}
| |
− | | |
− | == Errors ==
| |
− | 400 – Bad request
| |
− | | |
− | {|border="1" style="border-collapse:collapse" cellpadding="5"
| |
− | |''{''
| |
− | | |
− | ''"error_code": <error code>,''
| |
− | | |
− | ''“error_message”:”<error message>”''
| |
− |
| |
− | ''}''
| |
− | |}
| |
− | | |
− | 401 – Unauthorized
| |
− | | |
− | | |
− | | |
− | <center>[[mobile-web-api-specification/ExpectedParameters|< Previous]] | [[mobile-web-api-specification/GetActiveChat|Next >]]</center>
| |
− | </translate>
| |
Latest revision as of 22:57, 6 August 2020