4
votes

I have been trying hard to find any example, resource which explains how to get a list of installed apps in SharePoint 2013 environment using Client Object Model. So far I have found nothing.

Could you please share some links if you happen to know any that explains:

  1. How to get list of apps installed in a SharePoint 2013 web using SP2013 Managed Client Object Model.

  2. How to get list of apps installed in a SharePoint 2013 web using either WCF or REST service. -- I would really like to know how to do this as I need to create a WebPart in SP 2010 that lists apps installed in our SP 2013 Office 365 env.

3

3 Answers

3
votes

You can get them from here:

https://<your_site_collection>/_api/web/AppTiles?$filter=AppType eq 3

This is the REST service..

I believe the correct Managed CSOM class is

Microsoft.SharePoint.Client.AppTileCollection 

found at..

https://msdn.microsoft.com/en-us/Library/microsoft.sharepoint.client.apptilecollection.aspx

2
votes

In SharePoint 2013/Online CSOM API AppCatalog class provides querying capabilities for discovering installed Apps, in particular AppCatalog.GetAppInstances method retrieves the installed app instances.

Example

using (var ctx = ClientContext(webUri))
{
    var apps = AppCatalog.GetAppInstances(ctx, ctx.Web);
    ctx.Load(apps);
    ctx.ExecuteQuery();

    //print info
    foreach (var app in apps)
    {
        Console.WriteLine("Name: {0},InstanceId: {1},Status: {2}", app.Title,app.Id, app.Status);
     }
}
0
votes

I only know about SharePoint Online 2013 but for that, the apps are listed in a special SharePoint site:

https://<tenancyname>.sharepoint.com/sites/AppCatalog

You should be able to connect to the list there using CSOM or REST.

Not sure that answers your question but maybe it gives some pointers?