Import bot from zip?

Hi! Probably a real easy answer but when we want to copy a flow we export the existing flow and try to import it again. The exported bot is a zipfile. We can’t use this file for import. How can we solve this? Many thanks to all you botpress pro’s!!!

I’d like to automate the topic, creating a manual CI task to trigger bot import and training. I heard there are APIs for it but I am still gathering the infos.

There are SDK docs:
https://botpress.com/reference/modules/botpress_sdk.bots.html#importbot
I can’t find anything for the API though, @spgin do you have some more references? Else I have to debug the calls the frontend sends to do the import :stuck_out_tongue: I am missing some kind of OpenAPI/Swagger docs.

@ditjedatje sorry for reviving your topic this late, but you never got an answer and I felt our issues are similar. What do you mean with “zipfile. We can’t use this file for import”? I guess in meanwhile this manual process has been improved and your issue is solved?

Hey @JustusNBB and @ditjedatje

You can do a POST call to /api/v1/admin/bots/{bot id}/import?overwrite=[true | false]
You will need to set the Content-Type: application/tar+gzip header in your request.
The request’s body is the archive read as a Buffer. Source code for the frontend upload can be seen here.

1 Like