Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Governance and Administ...
Answered

Share an app through an api

(0) ShareShare
ReportReport
Posted on by 16

Hi there community

Is there an api endpoint that allows me through a rest request to share an app with a AAD team (or users)

Categories:
  • KubraS Profile Picture
    2 on at
    Re: Share an app through an api

    Hi everyone, I want to share my power apps web api endpoint with other people. Is there anyone tried it before?

  • v-xiaochen-msft Profile Picture
    on at
    Re: Share an app through an api

    Hi @jjaramillo ,

     

    That's cool! Thanks for sharing something not in the documentation.

     

    Best Regards,

    Wearsky

  • Verified answer
    jjaramillo Profile Picture
    16 on at
    Re: Share an app through an api

    On the other hand, I've tried to use the GrantAccess operation from the dataverse api with no success

    (I can make the post request, however, i get an empty 204 response from the server, and If I check the share functionality from the ui I see no changes)

    This is the body in case anyone has any info on the matter:

    {
     "Target": {
     "@odata.type": "Microsoft.Dynamics.CRM.canvasapp",
     "canvasappid": "[app guid]"
     },
     "PrincipalAccess": {
     "@odata.type": "Microsoft.Dynamics.CRM.PrincipalAccess",
     "AccessMask": "ReadAccess",
     "Principal": {
     "@odata.type": "Microsoft.Dynamics.CRM.team",
     "ownerid": "[team guid]"
     }
     }
    }
  • jjaramillo Profile Picture
    16 on at
    Re: Share an app through an api

    Did a little bit of digging and you can actually use the same apis the powershell command uses (which btw are the same that the ui use when you do the process from the "share" button on the app.

    I case someone is wondering this is the endpoint (POST):

    {{powerappsUrl}}scopes/admin/environments/{{environmenName}}/apps/{{appId}}/modifyPermissions?api-version=2016-11-01&$filter=environment%20eq%20'{{environmenName}}'

    Where:

    As for the body I used the following json object:

    {
     "put": [
     {
     "properties": {
     "NotifyShareTargetOption": "DoNotNotify",
     "roleName": "CanView",
     "capabilities": [],
     "principal": {
     "email": null,
     "type": "Group",
     "id": "[azureactivedirectoryobjectid]",
     "tenantId": "null"
     }
     }
     }
     ]
    }

    The parameters for this call can be found here on the Set-AdminPowerAppRoleAssignment command documentation

     

    Cheers!

  • v-xiaochen-msft Profile Picture
    on at
    Re: Share an app through an api

    Hi @jjaramillo ,

     

    At my knowledge, there are no powerapps APIs for us to use.

    WorkAround:

    1\ Share app with users with powershell.

    https://docs.microsoft.com/en-us/powershell/module/microsoft.powerapps.administration.powershell/set-adminpowerapproleassignment?view=pa-ps-latest

     

    2\ Use Powerapps for admin connector.

    A nice blog which shows how to use this connector.

    https://www.c-sharpcorner.com/article/automate-powerapps-app-sharing/

     

    Best Regards,

    Wearsky

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Governance and Administering

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 9 Super User 2025 Season 1

#2
bscarlavai33 Profile Picture

bscarlavai33 5 Super User 2025 Season 1

#3
getsplash Profile Picture

getsplash 2

Overall leaderboard

Featured topics