Getting a backup
You can use the REST API to get a backup of a company as follows:
GET /c/db_nazev/backup
if you specify the
Acceptheader, it must have the valueapplication/x-winstrom-backup(orapplication/octet-stream),the response has
Content-Type: application/x-winstrom-backup.
ℹ️ If the Accept header has a different value (e.g. application/json), the server will respond with 406 Not Acceptable.
Restoring from a backup
A company can also be restored from a backup using the REST API:
PUT /c/db_nazev/restore?name=Firma
the
nameparameter is optional — if not specified, the name from the last valid company settings will be used,the request body must contain the company backup,
if you specify the
Content-Typeheader, it must have the valueapplication/x-winstrom-backup(orapplication/octet-stream) — otherwise the server will respond with415 Unsupported Media Type.
⚠️ The company being restored must not already exist — it will be created during the restore process. If the company already exists, the server will respond with 400 and the message Company 'db_nazev' already exists — the message contains the database identifier from the URL, not the value of the name parameter.
If you use a disallowed character in the company identifier, you will be redirected to the URL with a valid identifier.
Restoring a test company
When restoring from a backup, you can also mark the company as a test company and disable features that are not desirable during testing. The forTesting=1 parameter is used for this purpose:
PUT /c/db_nazev/restore?name=Firma&forTesting=1
In this mode, you can also specify which features should be disabled. By default (if not specified), the parameters have the value 1, which disables the corresponding feature. If you don't want the feature to be disabled, specify the parameter with the value 0.
Features that can be disabled:
| Disables sending messages to EET. In all validity periods of the company settings, the Communication mode property (on the Automatic operations — EET tab) will be changed to the value |
| Disables automatic sending of emails. In all validity periods of the company settings, the Automatically send documents by email property (on the Other tab) will be changed to the value |
| Unregisters all Web Hooks registered in the company. |
| Optional parameter — do not restore the change history. |
| Optional parameter — do not restore the Changes API history. |
The URL might then look something like this:
PUT /c/db_nazev/restore?name=Firma&forTesting=1&disableAutoSendMail=0&skipZurnal
