In this tutorial we will talk about importing/exporting bots, it's this is a very useful feature that allows the will allow our bots to be very portable and easy to re-use in other machines/instances of EDDI and of course to back up and restore your our bots and maintain them and keep them shiny.
...
Exporting a bot is a fairly simple process, send a POST request to the following api endpoint and you will receive the location of the exported zip file on the response headers, specifically the location header.
HTTP Method | POST |
---|---|
API endpoint |
|
{botId} |
|
{botVersion} |
|
Example :
Code Block | ||||
---|---|---|---|---|
| ||||
Request URL |
...
http://localhost:7070/backup/export/5aaf90e29f7dd421ac3c7dd4?botVersion=1 |
...
Response Body |
...
no content |
...
Response Code |
...
200 |
...
Response Headers |
...
{ |
...
"access-control-allow-origin": "*", |
...
"date": "Mon, 19 Mar 2018 10:41:41 GMT", |
...
"access-control-allow-headers": "authorization, Content-Type", |
...
"content-length": "0", |
...
"location": "http://localhost:7070/backup/export/5aaf90e29f7dd421ac3c7dd4-1.zip", |
...
|
...
|
...
|
...
"access-control-allow-methods": "GET, PUT, POST, DELETE, PATCH, OPTIONS", |
...
"content-type": null |
...
} |
Importing a bot :
Send a POST request to the following api endpoint , you will recieve the id of the imported bot on the response headers same way as we mentioned of the export feature.
HTTP Method | POST |
---|---|
API endpoint |
|
HTTP Content Type | application/zip |
Request body | the zip file binary. |
Example:
For the sake of simplifying things you can use Postman to upload the zip file of the exported bot just dont forget to add the http header of content type : application/zip.
...