Views:

Applies to Product - Dynamics 365 Project Operations
 

What’s happening?
Customers encounter 401 Unauthorized errors when attempting to call the msdyn_ConvertProject API using cloud flows and plugins. Additionally, some customers experience 400 Bad Request errors when executing the same API from plugins.
 

Reason:

  • The 401 error is typically caused by an authorization issue, where the token used does not have the necessary permissions to access the Dataverse resource.
  • The 400 error may arise from incorrect API call structure or parameters, authentication issues, or incompatibility between the plugin's execution environment and the API requirements.

 

Resolution:
For 401 Unauthorized Error:

  1. Verify that the token being used is correctly obtained and has the necessary permissions to access the msdyn_ConvertProject API.
  2. Ensure that the Azure AD app registration used for authentication has the required permissions set for accessing the msdyn_ConvertProject API.
  3. Review the code used to obtain the token and ensure it aligns with the recommended practices. 
  4. Check if there are any recent changes to the security roles or permissions of the user under which the cloud flow and plugin are executing.
For 400 Bad Request Error:
  1. Ensure that the API call structure and parameters are correctly formatted. See Sample: Web access from a plug-in (Microsoft Dataverse) - Power Apps | Microsoft Learn for more information. 
  2. Confirm that all required permissions are granted for the plugin to execute the msdyn_ConvertProject API call.
  3. Test the API call outside of the plugin (e.g., using Postman) to ensure the API itself is functioning as expected.
  4. If the issue persists, consider removing any customizations related to the msdyn_projectTask and msdyn_project entities, as they may be causing conflicts with the system plugins.