Steps to start a new export

Introduction

Before you start a new export, you should read the Getting Started With DMM API. In this page, you have the installation steps to start using the DMM API.

In all the requests you have to pass the header X-DMM-Token. This value is the one define in the section Define the REST API key from the Getting Started With DMM API page.


Create the connections

When you install the DMM API, it is automatically created the Runtime Connection. If you want to export data from this environment to a file, you don't need to create any connection, otherwise you can create a Data Source connection using the CreateConnection request.

Start the export

To start a new export, you should use the StartExecution request.

The Type parameter is Export.

This request has the header X-DMM-Token-OTP and the value can be found in the environment where the export is to be executed, in the Authentication Token page.

You can find more information about the JSON configuration in the Start Execution export configuration page.

This configuration file can be generated using the DMM (Full version) application. This application is available on Forge. In this DMM (Full version) you can select the applications or entities that you need and after that you have an option to download the configuration file. This file can be used to start the execution in the DMM API, you just need to confirm if the source and destination connection are with the correct names. This interface to generate the configuration is free, you don't need to activate any license!

If this request finishes without any error, in the response you find the MainExecutionTrackerId. You will need this value to use the remaining requests related to this export.

Stop the export

You can use the StopExecution request to stop the export. The export process will be stopped and no more chunks will be exported. If the export was to a database, the entities that already were exported will not be reverted!

Check the export status

You can use the GetExecutionStatus request to obtain some information about the export.

With this request you can get some reports (if you pass the parameter IncludeReports with value true), like number of records and when the export was started, and you can also get the execution log if you pass the parameter IncludeLogs with the value true.

Also, with the parameters LogRecords and LogPage you can have pagination in the logs (by default, you only will obtain the first 10 lines).

The log information will be return in the parameter Logs. This field is sent as a base64 string, so you need to do a base64 decode to obtain the log lines.

To learn more about this request response, you can follow this link.

Get the export final reports

You can use the GetExecutionOutputs request to obtain the final outputs when the export is finished.

This request only return data if the export already finishes (status InError or Complete). You can know the status with the GetExecutionStatus request, in the field Status.

With this request you can get some final reports (if you pass the parameter IncludeReports with value true), like number of records and when the export was started.

You can also get the execution final logs if you pass the parameter IncludeLogs with the value true. This field is sent as a base64 string, so you need to do a base64 decode to obtain the log zip file. After you do the base64 decode, you can save the file with the extension .zip. Inside this zip file, you can find one or more files with all the logs from the export.

Is with this request that you can obtain the exported zip file. To obtain the zip, you have to pass the parameter IncludeFiles with the value true. The file will be sent in the field ZipFile base64 encoded. You have to first do a base64 decode and you can save the file as a .zip. The zip file contains some system entity tables (files ossys_*), the entities metadata (files *_Struct.dmm) and the entities records (files *_Data.csv)

If the export was to a SFTP connection or to a folder, in this request you will find the output zip location.

To learn more about this request response, you can follow this link.