├── HealthAgentAPI
├── package.json
├── healthAgentAPI.js
└── README.md
├── README.md
├── GeoPol.xml
├── LICENSE
├── SECURITY.md
└── .gitignore
/HealthAgentAPI/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "health-bot-api",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "healthAgentAPI.js",
6 | "dependencies": {
7 | "request": "^2.82.0",
8 | "request-promise": "^4.2.2",
9 | "jsonwebtoken": "^8.0.1"
10 | },
11 | "devDependencies": {},
12 | "scripts": {
13 | "test": "echo \"Error: no test specified\" && exit 1"
14 | },
15 | "author": "",
16 | "license": "ISC"
17 | }
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Contributing
3 |
4 | This project welcomes contributions and suggestions. Most contributions require you to agree to a
5 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
6 | the rights to use your contribution. For details, visit https://cla.microsoft.com.
7 |
8 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
9 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
10 | provided by the bot. You will only need to do this once across all repos using our CLA.
11 |
12 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
13 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
14 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
15 |
--------------------------------------------------------------------------------
/GeoPol.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 | ]>
7 |
8 |
9 |
10 | &GitReposFolder;\AInR_NExT\&GitRepoName;
11 | &GitRepoName;
12 |
13 |
14 | .
15 |
16 |
17 | .gitignore
18 | GeoPol.xml
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
40 |
41 |
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # .NET Core
46 | project.lock.json
47 | project.fragment.lock.json
48 | artifacts/
49 | **/Properties/launchSettings.json
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # Visual Studio code coverage results
117 | *.coverage
118 | *.coveragexml
119 |
120 | # NCrunch
121 | _NCrunch_*
122 | .*crunch*.local.xml
123 | nCrunchTemp_*
124 |
125 | # MightyMoose
126 | *.mm.*
127 | AutoTest.Net/
128 |
129 | # Web workbench (sass)
130 | .sass-cache/
131 |
132 | # Installshield output folder
133 | [Ee]xpress/
134 |
135 | # DocProject is a documentation generator add-in
136 | DocProject/buildhelp/
137 | DocProject/Help/*.HxT
138 | DocProject/Help/*.HxC
139 | DocProject/Help/*.hhc
140 | DocProject/Help/*.hhk
141 | DocProject/Help/*.hhp
142 | DocProject/Help/Html2
143 | DocProject/Help/html
144 |
145 | # Click-Once directory
146 | publish/
147 |
148 | # Publish Web Output
149 | *.[Pp]ublish.xml
150 | *.azurePubxml
151 | # TODO: Comment the next line if you want to checkin your web deploy settings
152 | # but database connection strings (with potential passwords) will be unencrypted
153 | *.pubxml
154 | *.publishproj
155 |
156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
157 | # checkin your Azure Web App publish settings, but sensitive information contained
158 | # in these scripts will be unencrypted
159 | PublishScripts/
160 |
161 | # NuGet Packages
162 | *.nupkg
163 | # The packages folder can be ignored because of Package Restore
164 | **/packages/*
165 | # except build/, which is used as an MSBuild target.
166 | !**/packages/build/
167 | # Uncomment if necessary however generally it will be regenerated when needed
168 | #!**/packages/repositories.config
169 | # NuGet v3's project.json files produces more ignorable files
170 | *.nuget.props
171 | *.nuget.targets
172 |
173 | # Microsoft Azure Build Output
174 | csx/
175 | *.build.csdef
176 |
177 | # Microsoft Azure Emulator
178 | ecf/
179 | rcf/
180 |
181 | # Windows Store app package directories and files
182 | AppPackages/
183 | BundleArtifacts/
184 | Package.StoreAssociation.xml
185 | _pkginfo.txt
186 |
187 | # Visual Studio cache files
188 | # files ending in .cache can be ignored
189 | *.[Cc]ache
190 | # but keep track of directories ending in .cache
191 | !*.[Cc]ache/
192 |
193 | # Others
194 | ClientBin/
195 | ~$*
196 | *~
197 | *.dbmdl
198 | *.dbproj.schemaview
199 | *.jfm
200 | *.pfx
201 | *.publishsettings
202 | orleans.codegen.cs
203 |
204 | # Since there are multiple workflows, uncomment next line to ignore bower_components
205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206 | #bower_components/
207 |
208 | # RIA/Silverlight projects
209 | Generated_Code/
210 |
211 | # Backup & report files from converting an old project file
212 | # to a newer Visual Studio version. Backup files are not needed,
213 | # because we have git ;-)
214 | _UpgradeReport_Files/
215 | Backup*/
216 | UpgradeLog*.XML
217 | UpgradeLog*.htm
218 |
219 | # SQL Server files
220 | *.mdf
221 | *.ldf
222 | *.ndf
223 |
224 | # Business Intelligence projects
225 | *.rdl.data
226 | *.bim.layout
227 | *.bim_*.settings
228 |
229 | # Microsoft Fakes
230 | FakesAssemblies/
231 |
232 | # GhostDoc plugin setting file
233 | *.GhostDoc.xml
234 |
235 | # Node.js Tools for Visual Studio
236 | .ntvs_analysis.dat
237 | node_modules/
238 |
239 | # Typescript v1 declaration files
240 | typings/
241 |
242 | # Visual Studio 6 build log
243 | *.plg
244 |
245 | # Visual Studio 6 workspace options file
246 | *.opt
247 |
248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
249 | *.vbw
250 |
251 | # Visual Studio LightSwitch build output
252 | **/*.HTMLClient/GeneratedArtifacts
253 | **/*.DesktopClient/GeneratedArtifacts
254 | **/*.DesktopClient/ModelManifest.xml
255 | **/*.Server/GeneratedArtifacts
256 | **/*.Server/ModelManifest.xml
257 | _Pvt_Extensions
258 |
259 | # Paket dependency manager
260 | .paket/paket.exe
261 | paket-files/
262 |
263 | # FAKE - F# Make
264 | .fake/
265 |
266 | # JetBrains Rider
267 | .idea/
268 | *.sln.iml
269 |
270 | # CodeRush
271 | .cr/
272 |
273 | # Python Tools for Visual Studio (PTVS)
274 | __pycache__/
275 | *.pyc
276 |
277 | # Cake - Uncomment if you are using it
278 | # tools/**
279 | # !tools/packages.config
280 |
281 | # Telerik's JustMock configuration file
282 | *.jmconfig
283 |
284 | # BizTalk build output
285 | *.btp.cs
286 | *.btm.cs
287 | *.odx.cs
288 | *.xsd.cs
289 |
--------------------------------------------------------------------------------
/HealthAgentAPI/healthAgentAPI.js:
--------------------------------------------------------------------------------
1 | const jwt = require("jsonwebtoken");
2 | const rp = require("request-promise");
3 | const fs = require('fs')
4 |
5 | if (process.argv.length !== 5) {
6 | console.log("Usage: node healthAgentAPI.js ");
7 | process.exit();
8 | }
9 | const action = process.argv[2];
10 | const tenantName = process.argv[3]
11 | const jwtSecret = process.argv[4];
12 |
13 | const BASE_URL = "https://eastus.healthbot.microsoft.com/";
14 | const jwtToken = jwt.sign({
15 | tenantName: tenantName,
16 | iat: Math.floor(Date.now() / 1000)
17 | }, jwtSecret);
18 |
19 | /**** Scenarios ****/
20 |
21 | if (action === "post_scenarios") {
22 | const options = {
23 | method: 'POST',
24 | uri: `${BASE_URL}api/account/${tenantName}/scenarios`,
25 | headers: {
26 | 'Authorization': 'Bearer ' + jwtToken
27 | },
28 | body: [
29 | {
30 | "name":"Hello World",
31 | "scenario_trigger":"hello_world",
32 | "description":"",
33 | "code":"{\n \"version\": 2,\n \"steps\": [\n {\n \"id\": \"aaa3073dc553-32a44525cced8e2f-2200\",\n \"type\": \"statement\",\n \"designer\": {\n \"xLocation\": 479,\n \"yLocation\": 196\n },\n \"text\": \"Hello World!\"\n }\n ]\n}"
34 | },
35 | {
36 | "name":"Greetings",
37 | "scenario_trigger":"greetings",
38 | "description":"",
39 | "code":"{\n \"version\": 2,\n \"steps\": [\n {\n \"id\": \"aaa3073dc553-32a44525cced8e2f-2200\",\n \"type\": \"statement\",\n \"designer\": {\n \"xLocation\": 479,\n \"yLocation\": 196\n },\n \"text\": \"Greetings!\"\n }\n ]\n}"
40 | }
41 | ],
42 | json: true
43 | };
44 |
45 | rp(options)
46 | .then(function (parsedBody) {
47 | console.log(parsedBody);
48 | })
49 | .catch(function (err) {
50 | console.log(err.message);
51 | });
52 | }
53 |
54 | if (action === "get_scenarios") {
55 | const options = {
56 | method: 'GET',
57 | uri: `${BASE_URL}api/account/${tenantName}/scenarios`,
58 | headers: {
59 | 'Authorization': 'Bearer ' + jwtToken
60 | }
61 | };
62 |
63 | rp(options)
64 | .then(function (parsedBody) {
65 | console.log(parsedBody);
66 | })
67 | .catch(function (err) {
68 | console.log(err.message);
69 | });
70 | }
71 |
72 | /**** Backup ****/
73 |
74 | if (action === "post_backup") {
75 | const options = {
76 | method: 'POST',
77 | uri: `${BASE_URL}api/account/${tenantName}/backup`,
78 | headers: {
79 | 'Authorization': 'Bearer ' + jwtToken
80 | },
81 | body: {
82 | "hbs": "Get Backup Output"
83 | }
84 | ,
85 | json: true
86 | };
87 |
88 | rp(options)
89 | .then(function (parsedBody) {
90 | console.log(parsedBody);
91 | })
92 | .catch(function (err) {
93 | console.log(err.message);
94 | });
95 | }
96 |
97 | if (action === "get_backup") {
98 | const options = {
99 | method: 'GET',
100 | uri: `${BASE_URL}api/account/${tenantName}/backup`,
101 | headers: {
102 | 'Authorization': 'Bearer ' + jwtToken
103 | }
104 | };
105 | rp(options)
106 | .then(function (parsedBody) {
107 | console.log(parsedBody);
108 | })
109 | .catch(function (err) {
110 | console.log(err.message);
111 | });
112 | }
113 |
114 | /**** Resources ****/
115 |
116 | if (action === "post_resources") {
117 | const options = {
118 | method: 'POST',
119 | uri: `${BASE_URL}api/account/${tenantName}/resources`,
120 | headers: {
121 | 'Authorization': 'Bearer ' + jwtToken
122 | },
123 | formData: {
124 | file: {
125 | value: fs.readFileSync('myfile.txt'),
126 | options: {
127 | filename: 'myfile.txt',
128 | contentType: 'text/plain'
129 | }
130 | }
131 | },
132 | json: true
133 | };
134 |
135 | rp(options)
136 | .then(function (parsedBody) {
137 | console.log(parsedBody);
138 | })
139 | .catch(function (err) {
140 | console.log(err.message);
141 | });
142 | }
143 |
144 | if (action === "get_resources") {
145 | const options = {
146 | method: 'GET',
147 | uri: `${BASE_URL}api/account/${tenantName}/resources`,
148 | headers: {
149 | 'Authorization': 'Bearer ' + jwtToken
150 | }
151 | };
152 |
153 | rp(options)
154 | .then(function (parsedBody) {
155 | console.log(parsedBody);
156 | })
157 | .catch(function (err) {
158 | console.log(err.message);
159 | });
160 | }
161 |
162 | /**** Localization ****/
163 |
164 | if (action === "post_localization") {
165 | const options = {
166 | method: 'POST',
167 | uri: `${BASE_URL}api/account/${tenantName}/localization`,
168 | headers: {
169 | 'Authorization': 'Bearer ' + jwtToken
170 | },
171 | body: {
172 | "custom": [{
173 | "en-us": "test1",
174 | "stringId": "test1"
175 |
176 | }],
177 | "system": []
178 | },
179 | json: true
180 | };
181 |
182 | rp(options)
183 | .then(function (parsedBody) {
184 | console.log(parsedBody);
185 | })
186 | .catch(function (err) {
187 | console.log(err.message);
188 | });
189 | }
190 |
191 | if (action === "get_localization") {
192 | const options = {
193 | method: 'GET',
194 | uri: `${BASE_URL}api/account/${tenantName}/localization`,
195 | headers: {
196 | 'Authorization': 'Bearer ' + jwtToken
197 | }
198 | };
199 |
200 | rp(options)
201 | .then(function (parsedBody) {
202 | console.log(parsedBody);
203 | })
204 | .catch(function (err) {
205 | console.log(err.message);
206 | });
207 | }
208 |
--------------------------------------------------------------------------------
/HealthAgentAPI/README.md:
--------------------------------------------------------------------------------
1 | # Microsoft Health Bot Management API
2 |
3 | ## Background
4 |
5 | The Microsoft Health Bot provides API to enable programmatic management actions. For example, programmatic import and export of scenarios from the scenario editor.
6 |
7 | ## The Management API supports the following actions:
8 |
9 | 1. Import/Export of scenarios
10 |
11 | 2. Create bot backup
12 |
13 | 3. Restore from backup
14 |
15 | 4. Import/Export of resource files
16 |
17 | 5. Import/Export of localization strings
18 |
19 | 6. Assign User access to management portal
20 |
21 | ## How to use the API
22 |
23 | ### Code samples
24 |
25 | The provided [code samples](https://github.com/microsoft/HealthBotCodeSnippets/blob/master/HealthAgentAPI/healthAgentAPI.js) demonstrate how to use the API.
26 |
27 | ### API Structure
28 |
29 | The API is implemented with REST architecture, enabling to perform CRUD operations on resources that are represented as URLs.
30 |
31 | ### API URL
32 |
33 | The fully qualified domain name(FQDN) should match the FQDN of the portal used to log into the health bot admin panel for example:
34 | ```
35 | URL: https://.healthbot.microsoft.com/
36 | ```
37 | List of regions:
38 |
39 | ```
40 | eastus
41 | westeurope
42 | australiaeast
43 | centralindia
44 | eastus2
45 | eastus2euap
46 | northeurope
47 | southcentralus
48 | southeastasia
49 | uksouth
50 | westcentralus
51 | westus2
52 | ```
53 |
54 | ### API Security
55 |
56 | The API is protected with standard JWT tokens. The JWT tokens contain two claims:
57 |
58 | - "tenantName": Taken from the management portal in the keys tab
59 | - "iat": timestamp as an UNIX epoch value
60 |
61 | The JWT token is signed with an API secret, called API\_JWT\_secret. The secret is taken from the management portal, as shown in the following screenshot:
62 |
63 | 
64 |
65 | An exemplary JWT token payload before encoding is shown here:
66 |
67 | ```JSON
68 | {
69 | "tenantName": "myTenant",
70 | "iat": "1507056900"
71 | }
72 | ```
73 |
74 | The JWT token is placed in the authorization header, according to the following example:
75 |
76 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoibXlUZW5hbnQiLCJpYXQiOiIxNTA3MDU2OTAwIn0.MN4DcxO2mLsltEYNpXbC6T6Bjxj3-rxIAObngZIw4-U
77 |
78 |
79 | It is recommended to implement the JWT tokens with standard libraries, for example: Node.js "jsonwebtoken" library.More information at https://jwt.io/.
80 |
81 | ## API Resources
82 |
83 | ### Export Scenarios
84 |
85 | ```
86 | URL: https://.healthbot.microsoft.com/api/account//scenarios
87 | ```
88 |
89 | **Method:** GET
90 |
91 | **Special headers:** Authorization: Bearer <JWT Token>
92 |
93 | **Request Parameters:** None
94 |
95 | **Response:** An array of JSON objects in the response body. Every object represents a Health Bot scenario
96 |
97 | **Examples:**
98 |
99 | GET https://eastus.healthbot.microsoft.com/api/account/healthagentprod/scenarios HTTP/1.1
100 |
101 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYwODAwfQ.x9oyA4kgfIgV5R1CpvMQeUYuP6FSlI65lx7Og8nMuWw
102 |
103 | Host: healthbot.microsoft.com
104 |
105 | HTTP/1.1 200 OK
106 |
107 | [exported scenarios will appear in the response body]
108 |
109 | **Comments:** N/A
110 |
111 | ### Import Scenarios
112 |
113 | ```
114 | URL: https://.healthbot.microsoft.com/api/account//scenarios
115 | ```
116 |
117 | **Method:** POST
118 |
119 | **Special headers:** Authorization: Bearer <JWT Token> , Content-type: application/json
120 |
121 | **Request Parameters:** An array of JSON objects in request body. Every object represents a Health Bot scenario
122 |
123 | **Response:** 200 OK in case of success
124 |
125 | **Examples:**
126 |
127 | POST https://eastus.healthbot.microsoft.com/api/account/healthagentprod/scenarios HTTP/1.1
128 |
129 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYxMzAwfQ.YGayhOc0fOaLRK4cWzRIhSsNH0zWOTy7Pe2PWSY5-cE
130 |
131 | Host: healthbot.microsoft.com
132 |
133 | Content-type: application/jsonContent-Length: 51116
134 |
135 | [scenarios in request body]
136 |
137 | **Comments:** When posting new scenarios, they will be added to the existing scenarios in the scenario editor. Scenario with the same name will be overridden.
138 |
139 | ### Export bot backup
140 |
141 | ```
142 | URL: https://.healthbot.microsoft.com/api/account//backup
143 | ```
144 |
145 | **Method:** GET
146 |
147 | **Special headers:** Authorization: Bearer <JWT Token>
148 |
149 | **Request Parameters:** None
150 |
151 | **Response:** A file in the response body. The file represents the bot backup.
152 |
153 | **Examples:**
154 |
155 | GET https://eastus.healthbot.microsoft.com/api/account/healthagentprod/backup HTTP/1.1
156 |
157 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYwODAwfQ.x9oyA4kgfIgV5R1CpvMQeUYuP6FSlI65lx7Og8nMuWw
158 |
159 | Host: healthbot.microsoft.com
160 |
161 | HTTP/1.1 200 OK
162 |
163 | [exported bot backup will appear in the response body]
164 |
165 | **Comments:** N/A
166 |
167 | ### Restore from backup
168 |
169 | ```
170 | URL: https://.healthbot.microsoft.com/api/account//backup
171 | ```
172 |
173 | **Method:** POST
174 |
175 | **Special headers:** Authorization: Bearer <JWT Token> , Content-type: application/json
176 |
177 | **Request Parameters:** A file in the request body. The file represents the bot backup.
178 |
179 | **Response:** 200 OK in case of success
180 |
181 | **Examples:**
182 |
183 | POST https://eastus.healthbot.microsoft.com/api/account/healthagentprod/backup HTTP/1.1
184 |
185 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYxMzAwfQ.YGayhOc0fOaLRK4cWzRIhSsNH0zWOTy7Pe2PWSY5-cE
186 |
187 | Host: healthbot.microsoft.com
188 |
189 | Content-type: application/jsonContent-Length: 51116
190 |
191 |
192 | ### Export Resources
193 |
194 | ```
195 | URL: https://.healthbot.microsoft.com/api/account//resources
196 | ```
197 |
198 | **Method:** GET
199 |
200 | **Special headers:** Authorization: Bearer <JWT Token>
201 |
202 | **Request Parameters:** None
203 |
204 | **Response:** An array of JSON objects in the response body. Every object represents a Resource
205 |
206 | **Examples:**
207 |
208 | GET https://eastus.healthbot.microsoft.com/api/account/healthagentprod/resources HTTP/1.1
209 |
210 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYwODAwfQ.x9oyA4kgfIgV5R1CpvMQeUYuP6FSlI65lx7Og8nMuWw
211 |
212 | Host: healthbot.microsoft.com
213 |
214 | HTTP/1.1 200 OK
215 |
216 | [exported resources will appear in the response body]
217 |
218 | **Comments:** N/A
219 |
220 | ### Import Resources
221 |
222 | ```
223 | URL: https://.healthbot.microsoft.com/api/account//resources
224 | ```
225 |
226 | **Method:** POST
227 |
228 | **Special headers:** Authorization: Bearer <JWT Token> , Content-type: application/json
229 |
230 | **Request Parameters:** Resourse Files in request body. Every File represents a Resourse of Health Bot scenario
231 | **The file name cannot contain spaces or special characters
232 |
233 | **Response:** 200 OK in case of success
234 |
235 | **Examples:**
236 |
237 | POST https://eastus.healthbot.microsoft.com/api/account/healthagentprod/resources HTTP/1.1
238 |
239 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYxMzAwfQ.YGayhOc0fOaLRK4cWzRIhSsNH0zWOTy7Pe2PWSY5-cE
240 |
241 | Host: healthbot.microsoft.com
242 |
243 | [Resources in request body]
244 |
245 | ### Export Localization
246 |
247 | ```
248 | URL: https://.healthbot.microsoft.com/api/account//localization
249 | ```
250 |
251 | **Method:** GET
252 |
253 | **Special headers:** Authorization: Bearer <JWT Token>
254 |
255 | **Request Parameters:** None
256 |
257 | **Response:** An array of JSON objects in the response body. Every object represents a localization string
258 |
259 | **Examples:**
260 |
261 | GET https://eastus.healthbot.microsoft.com/api/account/healthagentprod/localization
262 |
263 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYwODAwfQ.x9oyA4kgfIgV5R1CpvMQeUYuP6FSlI65lx7Og8nMuWw
264 |
265 | Host: healthbot.microsoft.com
266 |
267 | HTTP/1.1 200 OK
268 |
269 |
270 | **Comments:** N/A
271 |
272 | ### Import Localization
273 |
274 | ```
275 | URL: https://.healthbot.microsoft.com/api/account//localization
276 | ```
277 |
278 | **Method:** POST
279 |
280 | **Special headers:** Authorization: Bearer <JWT Token> , Content-type: application/json
281 |
282 | **Request Parameters:** An array of JSON objects in request body. Every object represents a Localization string of Health Bot scenario
283 |
284 | Body Format:
285 | ```
286 | {
287 | "custom": [{
288 | "": "test",
289 | "stringId": "test"
290 |
291 | }],
292 | "system": []
293 | }
294 | ```
295 | List of language:
296 | ```
297 | en-us,
298 | ar-sa,
299 | cs-cz,
300 | de-de,
301 | el-gr,
302 | en-gb,
303 | es-es,
304 | es-mx,
305 | et-ee,
306 | fr-ca,
307 | fr-fr,
308 | it-it,
309 | nl-nl,
310 | pl-pl,
311 | pt-br,
312 | pt-pt,
313 | ro-ro,
314 | ru-ru,
315 | sk-sk,
316 | tr-tr,
317 | uk-ua,
318 | zh-cn
319 | ```
320 |
321 | **Response:** 200 OK in case of success
322 |
323 | **Examples:**
324 |
325 | POST https://eastus.healthbot.microsoft.com/api/account/healthagentprod/localization HTTP/1.1
326 |
327 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYxMzAwfQ.YGayhOc0fOaLRK4cWzRIhSsNH0zWOTy7Pe2PWSY5-cE
328 |
329 | Host: healthbot.microsoft.com
330 |
331 | Content-type: application/jsonContent-Length: 51116
332 |
333 | Request body:
334 | ```
335 | {
336 | "custom": [{
337 | "en-us": "test1",
338 | "stringId": "test1"
339 |
340 | }],
341 | "system": []
342 | }
343 | ```
344 |
345 | ### Assign User access to management portal
346 |
347 | ```
348 | URL: https://.healthbot.microsoft.com/api/account//user
349 | ```
350 |
351 | **Method:** POST
352 |
353 | **Special headers:** Authorization: Bearer <JWT Token> , Content-type: application/json
354 |
355 | **Request Parameters:** email and role ("Reader", "Editor", "Admin)
356 |
357 | Body Format:
358 | ```
359 | {
360 | "email": "johndoe@microsoft.com",
361 | "role": "Editor"
362 | }
363 | ```
364 |
365 | **Response:** 200 OK in case of success
366 |
367 | **Examples:**
368 |
369 | POST https://eastus.healthbot.microsoft.com/api/account/healthagentprod/user HTTP/1.1
370 |
371 | Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnROYW1lIjoiaGVhbHRoYWdlbnRwcm9kIiwiaWF0IjoxNTA2OTYxMzAwfQ.YGayhOc0fOaLRK4cWzRIhSsNH0zWOTy7Pe2PWSY5-cE
372 |
373 | Host: healthbot.microsoft.com
374 |
375 | Request body:
376 | ```
377 | {
378 | "email": "johndoe@microsoft.com",
379 | "role": "Editor"
380 | }
381 | ```
382 |
--------------------------------------------------------------------------------