Data Management Package REST API - Import Package in Dynamics 365FO Using Postman
Welcome to our comprehensive guide on using the Data Management Package REST API to import data into Dynamics 365 for Finance and Operations (Dynamics 365FO) efficiently. This tutorial will walk you through each step of the process using Postman.Please ensure your Bearer token is generated before proceeding.
This same URL which i am going to use can be trigger from any third party system to integrate with dynamics D365 Finance and operations.
Step 1: Create Import Project
Create an import project in Data Management as shown below.
Step 2: Get Azure Write URL
Post the GetAzureWriteUrl
request to the following endpoint:
POST - {{resource}}/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetAzureWriteUrl
Body:
{ "uniqueFileName": "CustomerGroupTestFile" }
A successful response from GetAzureWriteUrl
will provide the necessary URL for the next steps.
Step 3: Generate Package
You can generate the package in two ways:
- Generate the package as shown in this blog.
- Generate the package by exporting it directly from the DMF project as shown below.
Steps to Export Package:
- Create an export project.
- Run the export project.
- Download the package as shown below.
Prepare your template in an Excel file.
Save it as a Zip. Ensure the Zip contains only the three files shown below.
Step 4: Upload Package
Copy the highlighted blob URL from the previous response of GetAzureWriteUrl highlited in below screen response section.
.
Paste the URL in the URL section select Put method.
Set the below parameter x-ms-blob-type to BlockBlob
.
After sending the request, you will receive the response shown below:
Step 5: Import From Package
Post the ImportFromPackage
request with the following body:
POST : {{resource}}/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ImportFromPackage Body: { "packageUrl": "URL on which we have uploaded the package.", "definitionGroupId": "VendorGroupsFileImport", "executionId": "", "execute": true, "overwrite": true, "legalEntityId": "USMF" }
Headers for ImportFromPackage
The response of ImportFromPackage
New batch history record created under the import group.
Conclusion
By following these detailed steps, you can effectively manage data imports using the Data Management Package REST API in Dynamics 365FO. This approach not only ensures accuracy but also enhances the efficiency of handling large data sets within your organization.
No comments:
Post a Comment