D365 FO Export package.
1.Create the export project in Data Management and add the required data entities to the export project.
Start the process:
2.Trigger the below URL with the required parameters to export the data in package.
- You can assign an execution ID, otherwise, the system will generate the ID.
URL :
POST : {Resource}/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ExportToPackage
Input parameters:
{ "definitionGroupId":"<Data project name>", "packageName":"<Name to use for downloaded file.>", "executionId":"<Execution Id if it is a rerun>", "reExecute":<bool>, "legalEntityId":"<Legal entity Id>" }
3.In response, the system will send a 200k response and return the execution ID in the response payload.
4.In job history, you will find the transaction.
Get or Download file:
5.Trigger getExportedPackageURL to retrieve the package, passing the execution ID as an input parameter.
URL :
POST : {Resource}/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetExportedPackageUrl
Input parameters:
{"executionId":"<Execution Id>"}
6.The system will return the temporary blob URL in the value field. By using this URL, you can download the file.
Output:
Get the status:
7. In some scenarios, the data is huge and the system will take some time to process. In such cases, the above step will not work immediately. Before that, we need to check the status of that transaction.
8.To get the status of the transaction, trigger the below URL and pass the execution ID as an input parameter.
URL :
POST : {Resource}/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetExecutionSummaryStatus
Input parameters:
{"executionId":"<executionId>"}
Keep Daxing!!