Hi all,
We have got a requirement where a 3rd party applications (most probably a node js application) wants to connect to our dataverse tables (read/write). Is there any way to call the dataverse webapi through this node js/javascript application?
I know about these articles:
1. Connecting Dataverse API through C# application: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/quick-start-console-app-csharp
2. Connecting through single page application: https://github.com/MicrosoftDocs/powerapps-docs/blob/main/powerapps-docs/developer/data-platform/oauth-cross-origin-resource-sharing-connect-single-page-application.md
But in this case, the javascript application is not a single page application. What is the efficient way to expose the dataverse webapi with proper authentication. I already registered an azure app.
@SShivi you may want to check out Scott Durow's https://github.com/scottdurow/dataverse-ify.
You also need to keep in mind that you cannot retrieve a bearer token in the browser. Client credential flows are blocked from the browser because it would be a security risk when you would perform these actions in clear text.
You would need to have a backend service to call azure ad and create the token and pass it back to the browser.
Then you can use the token in your request header to the dynamics web api
as I wrote before if you have clientid/clientsecret you can get the bearer token, in this scenario there isn't a login popup (like the standard oauth flow)
Hi @GuidoPreite ,
Thank you for providing the inputs. I will definitely check out the rest builder tool. I am facing issue in getting bearer token. The client do not want to have a login popup, but should be able to get the dataverse data from their application. Any code snippets for the authorization part for such scenario in javascript?
you don't need to expose the Dataverse Web API as they are already public protected by the authentication.
If you created an azure app registration you probably have a clientid/clientsecret and you can use them to obtain the bearer token.
With the bearer token you can execute your Web API (they are REST) with postman, nodejs or any other programming language.
To build the requests you can use my tool Dataverse REST Builder, regarding the bearer token I wrote some insights in this blog post.
WarrenBelz
85
Most Valuable Professional
Michael E. Gernaey
65
Super User 2025 Season 1
mmbr1606
55
Super User 2025 Season 1