Domanda

I'm trying to get all installed app on a SharePoint site using the REST API. I couldn't find any information about that.

Is it possible?

È stato utile?

Soluzione

When you add an App to your site, basically it adds an sub-site to your site. It is not visible under site content because it is hidden. For this kind of sub-site, WebTemplate is 'APP'. So you can make a GET request to following end-point for your installed apps.

/_api/web/Webs?$select=Title&$filter=WebTemplate eq 'APP'

Update

SharePoint Hosted apps are added as sub-site but Provider Hosted apps are not. In that case actual solution is:

/_api/web/AppTiles?$filter=AppPrincipalId ne ''&$select=Title

Altri suggerimenti

Yes, it is possible. But please note that everything in SP 2013 is app so you will get all the list/libraries in report. For e.g. below give you one custom APP installed and one Library Images as app.

Use below REST API... https://yourdomain/sites/dev/_api/Web/AppTiles

Above will give you result in below format

Kai's comment - you can further filter this json by AppPrincipalId. For library\list it will be empty, for apps there will be a value.

{
            "__metadata": {
                "id": "https://yourdomain/sites/dev/_api/SP.AppTile89eb2f1b-4d78-47c0-9f89-0ee7e603fb6f",
                "uri": "https://yourdomain/sites/dev/_api/SP.AppTile89eb2f1b-4d78-47c0-9f89-0ee7e603fb6f",
                "type": "SP.AppTile"
            },
            "AppId": "03f1f764-99ef-4889-aff2-fe3a454561d38",
            "AppPrincipalId": "i:0i.t|ms.sp.int|e78cef77-9009-4ca1-b49c-94395450629e@e4954830-cf2d-45634-a7d8-4d64546ff6669",
            "AppSource": 2,
            "AppStatus": 4,
            "AppType": 3,
            "AssetId": null,
            "BaseTemplate": -1,
            "ChildCount": -1,
            "ContentMarket": null,
            "CustomSettingsUrl": null,
            "Description": "",
            "IsCorporateCatalogSite": false,
            "LastModified": "9/13/2016 10:32 AM",
            "LastModifiedDate": "2016-09-13T17:32:50.93Z",
            "ProductId": "d123db28d-d6f2-4897-8f4b-1fc745656438a",
            "Target": "",
            "Thumbnail": "https://yourdomain/sites/dev/_layouts/15/images/spstorefrontappdefault.96x96x32.png",
            "Title": "hello-world-client-side-solution",
            "Version": ""
        },
{
            "__metadata": {
                "id": "https://yourdomain/sites/dev/_api/SP.AppTileb7313ab9-95e9-4918-a041-757d93cfacec",
                "uri": "https://yourdomain/sites/dev/_api/SP.AppTileb7313ab9-95e9-4918-a041-757d93cfacec",
                "type": "SP.AppTile"
            },
            "AppId": "d0f8c841-709b-45f7-b5bf-21b145564678d49",
            "AppPrincipalId": "",
            "AppSource": 0,
            "AppStatus": 4,
            "AppType": 5,
            "AssetId": "0;4bcccd62-dcaf-46dc-a7d4-e38277e4564564;851;",
            "BaseTemplate": 851,
            "ChildCount": 0,
            "ContentMarket": "",
            "CustomSettingsUrl": "",
            "Description": "This system library was created by the Publishing feature to store images that are used on pages in this site.",
            "IsCorporateCatalogSite": false,
            "LastModified": "9/17/2016 12:46 AM",
            "LastModifiedDate": "2016-09-17T07:46:26Z",
            "ProductId": "4bcccd62-dcaf-46dc-a7d4-e38277ef33f4",
            "Target": "/sites/dev/PublishingImages/Forms/Thumbnails.aspx",
            "Thumbnail": "/_layouts/15/images/ltal.png?rev=44",
            "Title": "Images",
            "Version": "39"
        },
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top