-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_bot1.html
104 lines (97 loc) · 7.63 KB
/
test_bot1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test Generated Code</title>
<link rel="stylesheet" type="text/css" href="https://assets.onestore.ms/cdnfiles/external/webcore/4.14.0/stylesheets/WebCore.4.14.0.ltr.light.fixed.min.css">
</head>
<body>
<div>
<button id="button" class="btn btn-primary">Render</button>
</div>
<div id='iframe_container' style="display: none; height: 540px; width: 360px; outline: solid thin #0078d7"></div>
<script src="https://code.jquery.com/jquery-3.1.1.js" type="text/javascript"></script>
<script src="https://az725175.vo.msecnd.net/scripts/jsll-4.0.0.js" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.support.services.microsoft.com/support-web-sdk/v2/latest/support.sdk.all.js"></script>
<script>
var appConfig = {
partnerId: "partner",
appId: "partnercenter"
};
// initialize the web sdk
var initPromise = window.MsSupportSdk.init(appConfig);
// Setup config the web sdk
var config = { // Configuration for virtual agent component
//"context": { // context that will be passed to the virtual agent that will be passed to the agent and torronto. context is a JS object, the value of any property can only be a string.
//"name": "John",
//"account": "[email protected]",
//"occupation": "developer"
//},
//"authInfo": { // A {{#crossLink "ui.AuthInfo"}}{{/crossLink}} object that specifies the authentication information.
//"token": "", // Authentication token
//"type": "" // Auth type
//},
"environment": "partner.support.services.microsoft.com", // A value from ui.virtualAgent.Environment (default is ui.virtualAgent.Environment.PRODUCTION)
"flowId": "", // ID of the flow definition to use.
"locale": "en-us", // locale supported by Virtual Agent (en-us)
"areaId": "PartnerCenter", // Area ID is a specific Toronto ID to determine where to fetch content from
"preview": false, // Enable preview content
"content": { // Configuration for virtual agent content assets
//"userInput": "", // Input from the user that should be prepopulated as the first user message in the virtual agent experience. This field has a limit of 1024 characters
"name": "Partner Bot-in-training", // Name of the virtual agent in the title bar
"greeting": "Welcome Microsoft Partner!", // Greeting text in the welcome screen
"welcomeMessage": "Hi, I’m the Partner Bot-in-training. Please describe your issue below:", // First message the virtual agent displays to the user
"bigImage": { // Image of the virtual agent above the greeting. Image is an interface that will define the content and display of an image
"display": {
"type": "none"
}
},
"flowExtensionOption": { //Options for the next flow action, you can provide a type of extension and customize the flow. If a field is not provided for any property, that property will fall back to default behavior. (some fields are required) ui.virtualAgent.content.FlowExtension
//"actionText":"", // the text that invokes the next flow action
"type": "default", // Type of the virtual agent flow extension ui.virtualAgent.content.ExtensionType i.e. CUSTOM, DEFAULT, DISABLED, LINK
"actionText": "talk to an agent",
"showImmediately": false, // prompt user to access assisted support immediately as part of the initial greeting message.
"phoneNumber": "800MPNSolv",
"product": "partner",
"issue": "mpn",
"agentTitle": "Microsoft Partner Support Agent"
//"acceptedProducts": ["partner"],
},
// "response":"", // Answer content for the virtual agent messages. ui.virtualAgent.content.Responses https://cdn.support.services.microsoft.com/support-web-sdk/v2/latest/docs/classes/ui.virtualAgent.content.Responses.html
//"smallImage ":"", // Image of the virtual agent in the title bar ui.virtualAgent.content.Image. Image is an interface that will define the content and display of an image
"placeHolderInputText": { // Placeholder text for the main input text box of the virtual agent ui.virtualAgent.content.PlaceHolderStates
"initial": "e.g. How do I renew my Microsoft Partner Network membership?",
"content": "Enter your response here"
}
},
"theme": { // Configuration for virtual agent theme
"type": "light", //controls the default visual experience. A value from A value from ui.theme.ThemeColor. Default: LIGHT
//"feedbackButton": "normal", // feedback button that shows the survey( by disabling this you will disable modal surveys ) NORMAL or NONE
//"lineSeperator": "normal", // line seperator is the line between the greeting message and the welcome message NORMAL or NONE
//"agentMessageBubble": "", // customizes the agent message bubble. The agent message bubble appears when the user is selects chat and talks to the agent. theme.Theme
//"systemErrorMessageBubble": "", // customizes the System Error message bubble. theme.Theme
//"systemInfoMessageBubble": "", // customizes the System Info message bubble. theme.Theme
//"titleBar": "none", // titleBar can be customized by hiding it. NORMAL or NONE
//"userMessageBubble ": "", // customizes the user message bubble. theme.Theme
//"virtualAgentMessageBubble ": "", // customizes the virtual agent message bubble. theme.Theme
//"default": { // default controls the customization of the entire feature a complete default ui.theme.Theme is required if theming is applied for the rendered component.
//"accent": "#00ff00ff", // controls the color of the features that are the main focus in that component.
//"background": "#ff00ff00", // background color of the component that this theme object is applied to
//"foreground": "#e3e3e3ff", // color of the text in that component
//}
},
"uiInfo": { // UIInfo class which describes the details about a UI component
"type": 1, // A value in {{#crossLink "ui.HostType"}}{{/crossLink}} which indicates the type of UI to render. 0 = NONE, 1 = IFRAME, 2 = POPUP, 3 = EMBEDDED or sdk.ui.HostType.POPUP
"containerSelector": "#iframe_container", // Only required for iframe -- a JQuery selector statement to define the element into which the iframe will be loaded. Iframe container selector. Applicable when type is ui.HostType.IFRAME
//"accessibilityTitle": "Partner Bot"
//width: 600, Width of the popup window. Applicable when type is ui.HostType.POPUP Height of the popup window. Applicable when type is ui.HostType.POPUP
//height: 800 Height of the popup window. Applicable when type is ui.HostType.POPUP
}
};
$("#button").on("click", function() {
$("#iframe_container").toggle();
window.MsSupportSdk.ui.virtualAgent.render(config);
});
</script>
</body>
</html>