Extension Subscription

Overview

The Extension Subscription service allows tenants to browse and manage their monitored YaaS Market packages. When a tenant subscribes to a package, the service automatically activates the extensions from that package in the metamodel. The service deactivates those extensions when tenants unsubscribe. Additionally, the service returns a list of all extensions available to the tenant, which includes extensions from purchased packages, tenant's privately-developed extensions, and public extensions in packages for which the tenant is not subscribed.

Register your developed package with the Extension Subscription service to make the included extensions available for use by other tenants, and to activate and deactivate those extensions automatically for subscribed tenants. Registration tells the system that the registered package includes extensions for the system to listen to, and it enables system monitoring of the registered package.

Package registration enables automatic changes to registered packages in the metamodel. When you subscribe to an extension that belongs to a subscribed, monitored package, the system automatically activates it for the tenant in the metamodel. Likewise, when you unsubscribe a registered extension, the system removes it from the metamodel.


API Reference

/status

/status

get

/{tenant}/packages

/{tenant}/packages

get

Returns the list of packages registered by tenant (package provider project). Requires hybris.profile_subscription_view scope.

put

Regsiters lists of packages to be enabled for Yaas subscription for given package provider project (aka tenant). Replaces the complete list of packages. Requires hybris.profile_subscription_manage scope.

/{tenant}/extensions

/{tenant}/extensions

get

Returns UI oriented list of extensions to be subscribed or alredy subscribed by project (tenant) in Yaas. Requires hybris.profile_subscription_view scope.

/{tenant}/extensions/{extensionType}/{extensionId}

put

Enables enricher with given enricherId for tenant. Requires hybris.profile_subscription_manage scope.

delete

Disables enricher with given enricherId for tenant. Requires hybris.profile_subscription_manage scope.


Introduction to Tutorial

You can interactively learn how to use a service by reading and following the tutorial in the API Console.

Prerequisites


Package registration

Register a package

When you develop your own extension for SAP Hybris Profile and want to enable it for future subscriptions, you must first add the extension to a package and register the package in the Extension Subscription service.

To register a package in the Extension Subscription service, run the command in this example.

cURL command pattern

curl -X PUT -H "Authorization: Bearer access_token" -H "Content-Type: application/json" -d '[{
  "id": "expected.id",
  "packageName": "expected-package-name"
}]' 'https://api.beta.yaas.io/hybris/extension-subscription/v1/{tenant}/packages'

Parameters

  • Headers
    • Authorization: Includes a valid Bearer access token with the hybris.profile_subscription_manage scope
  • URI parameters
    • {tenant}: Your tenant name

Example of a PUT request with real data

curl -X PUT -H "Authorization: Bearer 021-efb7acb5-6b98-4e18-bae4-2783bf20cce8" -H "Content-Type: application/json" -d '[{
  "id": "522-e6e2f49c-0c1f-48d7-8e37-1c7a88f2e02b",
  "packageName": "The Dark Knight Returns"
}]' 'https://api.beta.yaas.io/hybris/extension-subscription/v1/mycomicsshop/packages'

Response

If the PUT request is successful, the response includes the following:

  • Status code: A status code of 200 indicates that the package was successfully registered.
The PUT method overwrites the collection of monitored packages. To prevent this from happening, retrieve all registered packages by executing the GET method, then add your package to the collection, and finally execute the PUT method to store the collection with the addition of the new package. Otherwise, the system overwrites the previous settings and monitors only your latest input.

Retrieve a list of monitored packages

To retrieve a list of packages monitored by the Extension Subscription service, run the command in this example.

cURL command pattern

curl -X GET -H "Authorization: Bearer access_token" 'https://api.beta.yaas.io/hybris/extension-subscription/v1/{tenant}/packages'

Parameters

  • Headers
    • Authorization: Includes a valid Bearer access token with the hybris.profile_subscription_view scope
  • URI parameters
    • {tenant}: Your tenant name

Example of a GET request with real data

curl -X GET -H "Authorization: Bearer 021-efb7acb5-6b98-4e18-bae4-2783bf20cce8" 'https://api.beta.yaas.io/hybris/extension-subscription/v1/mycomicsshop/packages'

Response

A successful response returns the details of the monitored packages:

[
  {
    "id": "13f810db-f659-4186-aaf9-27e58e675edc",
    "packageName": "The Dark Knight Returns"
  }
]


  • Send feedback

    If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.

  • Get Help

    Use our private help channel. Receive updates over email and contact our specialists directly.

  • hybris Experts

    If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.