cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Evangelizt
Helper I
Helper I

Web API call

I have just been assigned to a very tiny project. Although I have a team lead and other senior developers that I could go to but at the same time I am trying to learn things on my own. Actually there is web api call I need to make. I have been given this Developer Toolkit from this 3rd party. It contains WSDL for the service and few .xsd files and another document that contains the method names. Now I have been told that this call should be a reusable component and we should be able to use it in other projects or even in the same project but other locations.

 

Everything else is in this project is mainly using D365 forms, a couple of flows and mainly the base entities except for a few custom entities. This web service call needs to be triggered from D365 portal button. This portal stores its data in D365 backend. My question is what would be the best way to make this web service call? My understanding is plugins will not be useful in this case but I am not very knowledgeable about this. So any guidance would be helpful. 

9 REPLIES 9
ragavanrajan
Super User
Super User

Hi @Evangelizt ,  The best place to start is to start with Portals Web API 

 

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-overview. 

You can use the Web API to perform create, update, and delete operations across all Microsoft Dataverse entities from your portal pages. 

 

You can customise the logic to trigger the event from button. 

 

There is a good deep dive tutorial from @OOlashyn  https://www.dancingwithcrm.com/powerapps-portal-web-api-deep-dive/. 

 

Hope it helps. 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

hey @ragavanrajan  thank you for the reply but this is a 3rd party web api call I need to make and not a Dataverse (CDS) call.

Hi @Evangelizt ,

Can you elaborate a bit from where you are calling web API (you said in your initial message that it is D365 portal)? Do you need to just call that API or afterwards you need to perform the operation in Dataverse? In general, it doesn't look like a Portal question. You might try to ask in Pro dev forum section

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

@OOlashyn sure it's a 3rd party API (provided by local government actually) but no we wouldn't be saving data in dataverse afterwards. It's just to inform the user of a result. This will be invoked via a button in Portal page. 

Well, then this is more development general question. I would advise you to talk with your senior developers in the team for your specific company style and code guidance. In general working with old endpoints and wsdl is easier with c#. With javascript take a look on this post from StackOverflow - itis an older post, but in general right now wsdl and soap endpoint and not that common.

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
Fubar
Solution Sage
Solution Sage

If it is something that you can call via Ajax and do not have to provide private authentication details then you can Ajax on the Portal, but other than that you need to code it inside a plugin or custom action (if processing fits doing it on the Dataverse/server side), other than that you will need to call another Service that you control/develop via Ajax that can act as a pass through to the end service (so you can keep the credentials etc out of public view), one option if you need verification of the Portal User is oAuth Implicit Grant Flow  https://docs.microsoft.com/en-us/powerapps/maker/portals/oauth-implicit-grant-flow (I wouldn't call any of it 'simple')

Evangelizt
Helper I
Helper I

@Fubar @OOlashyn thank you for your replies. Unfortunately I don't think I can use JS here since the username/pwd combination needs to be used to first authenticate with this 3rd party api and putting these credentials in cleartext would create a huge security risk! Let me try to explain my current understanding and I would love to have your expert opinions please:


We have a web portal. It stores data in dynamics. However it needs to make several api calls to 3rd party. There will uid/pwd based authentication for these web apis. These api calls should also be able to made from inside one of the dynamics forms. So in terms of the bigger pictures, this needs to be a reusable component. I am thinking may be an Azure function would be suitable perhaps? which could be invoked both from Power apps Portal web page as well as Dynamics backend.

Hi @Evangelizt ,

Yes, using Azure Function as a middle man is a good idea. Just make sure that you are protecting function API as well (see official docs here). Using Azure Function has the additional benefit of being able to easily reuse them in Power Automate flows as well. 

----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
Fubar
Solution Sage
Solution Sage

If you need to know that it is an authenticated portal user that is interacting with Azure look into the oAuth Implicit Grant Flow (there are links to sample code at the bottom of the link in my previous post).

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,891)