Search code examples
javascriptdynamics-crmpowerappsdataverse

Microsoft Dataverse Web API - access data from within custom website using javascript


Currently I'm trying to build a headless CMS using Microsoft Power Apps in combination with Microsoft Dataverse. The Power App for managing the content is done and working, but now I struggle with accessing the data from within my website by using javascript.

I know the documentation about the Dataverse Web API, but I'm not sure how to implement fetching the table data from within my website.

Two questions arised:

  • is it necessary for reading data to be authenticated?
  • if I wanna add data to dataverse through the website (let's say in form of comments) there's no user authenticated in front. Is it possible to create an API key for that? Is this the point why the app is required to be registered in Azure App Directory?

Many thanks in advice and have a nice day!


Solution

    • is it necessary for reading data to be authenticated?

    Yes. Dynamics API can be used after authentication, either with User, Impersonated CRM user or non-interactive Application user.

    • if I wanna add data to dataverse through the website (let's say in form of comments) there's no user authenticated in front. Is it possible to create an API key for that? Is this the point why the app is required to be registered in Azure App Directory?

    Yes. Azure app registration gives the Client Id/Secret for App user (Non-interactive - who cannot login in CRM UI and consume license, but just for integration).

    Otherwise APIM can come handy to wrap around the CRM API and used in Website. Either way Client side (Ex. jquery AJAX) or Server side (Ex. HttpRequest) has to be used for GET/POST methods.