The owned apps for a user can be retrieved using the List Apps API method. Listing apps returns App Pages based on query and sort criteria. This is useful when displaying combinations of apps to end users on your marketplace such as all, sorted and by category or tag. It’s also simple to return only the apps that are owned by the current user.

The standard API call for returning owned apps for a user with id “123”:

curl --user {marketplaceId}:{secret} https://market.openchannel.io/v2/apps?
  query={'status.value':'approved'}&
  userId=123&
  isOwner=true

This standard API call will display the following:

  • Apps that have been approved by marketplace administrators
  • Apps that have a current status of “approved”
  • Apps that are owned by the user “123”

It’s important to know that returned apps include both approved and suspended apps. This API will only return apps that have been submitted and approved by the administrator and is most suitable for displaying apps to end users. When listing apps on your public marketplace, it is important to filter out suspended apps from the results. This can be achieved by adding the “status.value”: “approved” clause to your query parameter.

Results can be returned with additional user-specific data in the app listing by providing the userId. When the userId is provided, app ownership details are automatically added to the app results; statistics are gathered on usage and app restrictions are enforced. Always supply the userId when an authenticated (logged-in) user requests an app listing.

In addition to returning a user’s owned apps, additional query parameters can be added to filter by any attribute that’s part of the app’s object.

An example of returning owned apps by category and sorted by name for a user with id “123”:

curl --user {marketplaceId}:{secret} https://market.openchannel.io/v2/apps?
  query={'status.value':'approved','customData.category':'sales'}&
  sort={'name':1}&
  userId=123&
  isOwner=true

If a user needs to perform a text search through their installed apps, then the Search Apps API Method can be used.

An example of returning owned apps by text search for a user with id “123”:

curl --user {marketplaceId}:{secret} https://market.openchannel.io/v2/apps/textSearch?
  query={'status.value':'approved'}&
  text=electricity&
  fields=['name','customData.summary','customData.description']&
  userId=123&
  isOwner=true