Question

I would like to get access to information about POA subscription from my custom UI, like subscription ID and available resources.

How can it be done?

Answer

From custom UI with customer's token you can see information about all subscriptions, and it is not possible to say which one contains your application. If you need to know POA subscription associated with your tenant-level resource, you will need to add a strong relationship with "http://aps-standard.org/types/core/subscription/1.0" resource to it, it can look like this in resource schema:

"relations": {
"subscription": {
  "type": "http://aps-standard.org/types/core/subscription/1.0",
  "required": true,
  "collection": false
},
...

Or, if you use PHP runtime, it can be declared like this:

/**
* @link("http://aps-standard.org/types/core/subscription/1.0")
* @required
*/
public $subscription;

Then, you query the subscription relationship of your tenant resource:

GET /aps/2/resources/caeb15e1-289f-4e48-8c6c-db6c86cc4378/subscription
[
    {
        "aps":
        {
            "type": "http://parallels.com/aps/types/pa/subscription/1.0",
            "id": "fdd7f1d3-d401-4c89-a9d3-ebd6a703b84c",
            "status": "aps:ready",
            "revision": 3,
            "modified": "2014-04-25T00:21:59Z"
        },
        "trial": false,
        "disabled": false,
        "subscriptionId": 5
    }
]

This way you get the APS resource ID of POA subscription, as well as a conventional POA subscription ID.

You can also fetch information about APS resources that are included into this subscription as described in this article.

Note that if you add a strong relation to subscription resource, you can fetch the same information from your endpoint as well, see details in this article.

Additional information on "http://parallels.com/aps/types/pa/subscription/1.0" resource type is available in documentation.

As an example of an application which implements a link to POA subscription resource you can check the Basic Demo Project. There the context resource contains a link to POA subscription.

Internal content