Webapi Configuration in Power App Portal

Webapi Configuration in Power App Portal

We can test the API in browser.

Example: We want to retrieve the details of entity "dnlb_student", then use below format url.

<portal_url>/_api/dnlb_students

the letter 's' will be appended at the end of entity logical name.


So, it will give error. We need to configure the Web API setting in Site Setting of portal.

To configure it, Go to the Portal Management App and Site Setting.


Create new Site Setting Configuration to enable the Web API on "dnlb_student" entity and fields to be retrieved in result as below.

To Enable the Webapi:

To Enable the Fields:

Here, when we put * in Value then it will retrieve all the fields/columns of entity. 

However we can specify the fields logical name which we want to retrieve by separating them in comma (,).


Now, when we try to access, it gives permission issue.

To fix it, we need to create the table permission for "dnlb_student" entity and associate Web Role to it. Web Role should be the role which is associated to Login Contact user.

Now try to access the Webapi URI:

It gives the result now. It has all the fields in result.


To get the limited fields in the result, we can configure those fields in Webapi configuration.

Example, we need to get "dnlb_name", "dnlb_firstname", "dnlb_lastname". Then we need to configure the Webapi/dnlb_student/fields values as below:


Now try to access the api:

It gives error because we have specified particular fields in Webapi configuration and trying to retrieve all fields. Since we have not mentioned $select fields in query URI, it fails.

lets specify the fields names in $select in query as below:

It gives result perfectly.


We can also configure the Webapi for inner details of error as below:



Thank you !

Good Day 👏

No comments:

Post a Comment

Write us your comment.

Featured Posts

Download CRM 365 V9.X Tools using PowerShell

This configuration explains about how to download D365 utility tools step by steps. Step1 : Create a folder in your particular drive where y...

Popular Posts

Contact Me

Name

Email *

Message *