Calling the DMF Import API using Postman

Calling the DMF Import API using Postman

In this article , I would go over the process of calling the DMF import API using Postman. There is an assumption that you are already familiar with setting up Postman and are familiar with authentication part. Here is an article that covers the setup part

One the authentication is done and bearer token is initialized, we need to Post the GETAzureWriteURL

Post {{Resource}}/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetAzureWriteUrl        

Here Resource is a variable which is your test/dev box URL.

For Authorization you can use Bearer Token Type and pass the token received during the authentication part. In the body you need to pass a uniqueFileName

No alt text provided for this image

The response of a successful request would return a Azure blob URL where you can put your data package. The data package must be in a compressed form. You can download the package from the Import DMF project in D365 and can change the file contents for the right import values.

Next step would be to use a PUT request to the location that was the result of earlier call

PUT https://XXXdev3114add26db35a745.blob.core.windows.net/dmf/D365123456.xml?sv=2014-02-14&sr=b&sig=SxXU08xclH2vArBXvNH%2FnFSORtyJo6yaepzMLPU78zo%3D&st=2021-09-06T12%3A40%3A37Z&se=2021-09-06T13%3A15%3A37Z&sp=rw        

Make sure that you include x-ms-blob-type set to BlockBlob in the message header

No alt text provided for this image

The body contains the zip file for import.

No alt text provided for this image

After the successful Put , next step would be to invoke ImportFromPackage

POST{{Resource}}/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ImportFromPackage        
No alt text provided for this image

Make sure that you use the bearerToken for Authorization. The definitionGroupId is the Name of your import project and legalEntityID specifies the legal entity where the import shall be executed. The package URL is the URL where you have write the zip file in previous request. A successful request would create an entry in the execution log of the Import Project.

Alternatively, if know the activity ID and prefer one call (instead of 3), you may send your file using single POST request to https://<base URL>/api/connector/enqueue/<activity ID>?entity=<entity name> POST https://usncax1aos.cloud.onebox.dynamics.com/api/connector/enqueue/%7B6D31E09F-0249-459F-94F0-AAD9C2C47B64%7D?entity=Customer%20Groups (https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/recurring-integrations)

To view or add a comment, sign in

Others also viewed

Explore content categories