Is there an endpoint to fetch list of apps available in the app hub?

Is there an endpoint to fetch list of apps available in the app hub?

I tried this endoint api/apps.json?paging=false&fields=* but it only returns the list of custom applications I uploaded through the App Management app

Is there any other endpoint that return all the apps, plugins both core and custom?

1 Like

Hey @jetisco4u

I usually use the Network requests in the DevTools to figure things like this, so I went to the App Management app with the Network tab open after clicking on All Apps:

You can see the endpoint being used is: https://play.im.dhis2.org/stable-2-39-6/api/39/appHub/v2/apps

You could do the same in the apps.dhis2.org website, you’ll find the endpoint is: https://apps.dhis2.org/api/v2/apps?types=APP

I hope this helps! :slight_smile:

1 Like

Thanks that’s a great insight

1 Like

I learned it from @austin when I first joined the community! :heart_eyes::pray:

1 Like

Now I get it, the url you provided fetch from the App Hub while the one I shared fetch from the api endpoint for custom apps

Both are very important for my use case for the project I am working on

1 Like

Something is missing though

The endpoint api/apps.json?paging=false&fields=* has the fields: name, launchURL, baseURL, short_name which is exactly what I want but the shared appHub endpoint api/39/appHub/v2/apps?paging=false&fields=* does not contain these fields except name

Is there a pattern I can use to get the baseURL from the apps in the App Hub?

For example is there a way to sanitize the name to generate a pattern for the baseURL so that I can use it in a BrowserRouter?

Is there a way to get list of installed apps from the appHub?

@jetisco4u : you can also look at dhis-web-commons/menu/getModules.action for a list of installed apps, though not all of these are available from the app hub. Also, this endpoint may change in the future.

Am I supposed to access this through a browser or an api endpoint?

For example: https://debug.dhis2.org/dev/dhis-web-commons/menu/getModules.action

1 Like

Is the endpoint dhis-web-commons/menu/getModules.action only available on the debug instance?

Hi @jetisco4u

I think it works on all (at this point):

1 Like

You mean this one from the website? https://apps.dhis2.org/api/v2/apps?paging=false&fields=*

I can’t find these fields, could you screenshot it for me?

1 Like

Not this, I mean the path api/apps.json?paging=false&fields=* after the play demo site url this https://play.im.dhis2.org/stable-2-41-1/api/apps.json?paging=false&fields=*