Obtaining the Cloud Subscriptions of a Microsoft 365 Subscription
You can obtain a list of the cloud subscriptions that belong to a Microsoft 365 subscription by following these steps:
- Prepare the system identifier of the Microsoft 365 subscription that you need.
-
Obtain the Tenant APS resource that belongs to the Microsoft 365 subscription:
CopyGET https://BRAND_DOMAIN/aps/2/resources?implementing(APS_TYPE_ID_OF_TENANT_RESOURCE),select(subscription.subscriptionId,office365Application.instance_name,ms_account_id),eq(subscription.subscriptionId,SYSTEM_ID_OF_SUBSCRIPTION)
Note: To prepare the APS type ID of an APS resource, use the instructions in Obtaining APS Type IDs.
-
From the response that you receive, write down the values of these parameters:
- aps.id: This is the APS ID of the Tenant APS resource.
- ms_account_id: This is the internal ID of the Microsoft account (it differs from the Microsoft ID of the Microsoft account that is displayed in the Microsoft Partner Center).
-
office365Application.aps.id: This is the APS ID of your application instance.
-
Obtain all cloud subscriptions of the Microsoft account that the Microsoft 365 subscription belongs to. To do this, use the getMSSubscriptionsInfoFast custom operation of the Tenant APS resource:
CopyGET https://BRAND_DOMAIN/aps/2/resources/APS_ID_OF_TENANT_RESOURCE/getMSSubscriptionsInfoFast?msAccountId=INTERNAL_ID_OF_MS_ACCOUNT&globallSettingsId=APS_ID_OF_APPLICATION_INSTANCE
Note: This request returns cloud subscriptions that contain recurring licenses and add-on recurring licenses.
-
The response that you receive contains all cloud subscriptions of the Microsoft account. To find the cloud subscriptions that belong to the target Microsoft 365 subscription, use the ApsTenantId parameter: In the cloud subscriptions that you need, the value of this parameter is the same as the APS ID of the Tenant APS resource from step 2.
Note: The CspId parameter contains cloud subscription identifiers that are displayed in the Microsoft Partner Center.
Important: Obtaining cloud subscriptions of a Microsoft account is a custom operation. The user whose key and secret you use to access the APS REST API must have http://www.parallels.com/Office365/Tenant and GET in its list of allowed operations.
Examples
HTTP Request (Obtaining Tenant APS Resource of Microsoft 365 Subscription)
GET https://example.com/aps/2/resources?implementing(http://www.parallels.com/Office365/Tenant/2.8),select(subscription.subscriptionId,office365Application.instance_name,ms_account_id),eq(subscription.subscriptionId,1000011)
HTTP Response (Obtaining Tenant APS Resource of Microsoft 365 Subscription)
[
{
"aps": {
"modified": "2020-02-28T05:22:52Z",
"id": "6fcff2c9-de5c-4eb3-b2b7-d5722cc29338",
"subscription": "df973571-7146-4a0e-a7fe-a01516abdf22",
"type": "http://www.parallels.com/Office365/Tenant/2.8",
"status": "aps:ready",
"revision": 12
},
"ms_account_id": "0ec8e245-2509-44b9-a184-a313345db839",
"office365Application": {
"instance_name": "CSP: 1st Microsoft 365 instance",
"aps": {
"modified": "2020-03-05T21:00:04Z",
"id": "498c7d95-54ef-45c1-9877-da03ec230993",
"type": "http://www.parallels.com/Office365/Office365app/3.0",
"status": "aps:ready",
"revision": 53
}
},
"subscription": {
"aps": {
"modified": "2020-02-26T06:13:31Z",
"id": "df973571-7146-4a0e-a7fe-a01516abdf22",
"type": "http://parallels.com/aps/types/pa/subscription/1.0",
"status": "aps:ready",
"revision": 2
},
"subscriptionId": 1000011
}
}
]
The JSON object in this response represents the Tenant APS resource that belongs to the target Microsoft 365 subscription (1000011). You need to write down the values of these parameters: aps.id (6fcff2c9-de5c-4eb3-b2b7-d5722cc29338), ms_account_id (0ec8e245-2509-44b9-a184-a313345db839), and office365Application.aps.id (498c7d95-54ef-45c1-9877-da03ec230993).
HTTP Request (Obtaining Cloud Subscriptions of Microsoft Account)
GET https://example.com/aps/2/resources/6fcff2c9-de5c-4eb3-b2b7-d5722cc29338/getMSSubscriptionsInfoFast?msAccountId=0ec8e245-2509-44b9-a184-a313345db839&globallSettingsId=498c7d95-54ef-45c1-9877-da03ec230993
HTTP Response (Obtaining Cloud Subscriptions of Microsoft Account)
[
{
"IsTrial": false,
"IsExpired": false,
"ExpiredIn": 372,
"SubsId": "2ca62d0e-04f4-4927-b026-22226c95600a",
"OfferId": "91fd106f-4b2c-4938-95ac-f54f74e9a239",
"Status": "Enabled",
"AutoRenew": true,
"StartEffectiveDate": "2020-02-26T00:00:00",
"EndEffectiveDate": "2021-03-14T00:00:00",
"ApsTenantId": "6fcff2c9-de5c-4eb3-b2b7-d5722cc29338",
"PbaOrderId": null,
"ApsId": "42642e55-a602-4ae3-a771-94954f4c410e",
"PbaExpirationDate": null,
"Quantity": 5,
"ParentSubscriptionId": null,
"ProductId": "18181a46-0d4e-45cd-891e-60aabd171b4e",
"CspId": "c855a2d3-b618-4b91-a163-a8a1b9ebfa4a"
},
{
"IsTrial": false,
"IsExpired": false,
"ExpiredIn": 372,
"SubsId": "620cbdce-4e12-414c-a84c-5b4c4b1306c2",
"OfferId": "53fc25f7-6639-4f78-bb44-3c2dfec3ed40",
"Status": "Enabled",
"AutoRenew": true,
"StartEffectiveDate": "2020-02-27T00:00:00",
"EndEffectiveDate": "2021-03-14T00:00:00",
"ApsTenantId": "6fcff2c9-de5c-4eb3-b2b7-d5722cc29338",
"PbaOrderId": null,
"ApsId": "8f20ecaf-072d-4821-bf91-e25adcec9ee7",
"PbaExpirationDate": null,
"Quantity": 1,
"ParentSubscriptionId": "2ca62d0e-04f4-4927-b026-22226c95600a",
"ProductId": "99049c9c-6011-4908-bf17-15f496e6519d",
"CspId": "e802ac77-97e6-4749-bcb0-d64bef53bdd2"
},
{
"IsTrial": false,
"IsExpired": false,
"ExpiredIn": 372,
"SubsId": "64d2c9b4-d450-4a24-bd4c-6195679d2228",
"OfferId": "35a36b80-270a-44bf-9290-00545d350866",
"Status": "Enabled",
"AutoRenew": true,
"StartEffectiveDate": "2020-02-26T00:00:00",
"EndEffectiveDate": "2021-03-14T00:00:00",
"ApsTenantId": "d8812853-3a26-4058-8881-6e1e9bd31cab",
"PbaOrderId": null,
"ApsId": "08beba1b-d7fc-4923-bea4-4c1caf771aca",
"PbaExpirationDate": null,
"Quantity": 2,
"ParentSubscriptionId": null,
"ProductId": "80b2d799-d2ba-4d2a-8842-fb0d0f3a4b82",
"CspId": "abb709dc-3709-477e-b74a-df785ccb0265"
},
{
"IsTrial": false,
"IsExpired": false,
"ExpiredIn": 372,
"SubsId": "c7c5cc28-bae0-49dc-b1b2-91c948de1ae0",
"OfferId": "796b6b5f-613c-4e24-a17c-eba730d49c02",
"Status": "Enabled",
"AutoRenew": true,
"StartEffectiveDate": "2020-03-02T00:00:00",
"EndEffectiveDate": "2021-03-14T00:00:00",
"ApsTenantId": "d107eaff-9e3e-4c31-90e5-818842c1fc0f",
"PbaOrderId": null,
"ApsId": "e7426f14-50dd-4c56-be18-959bc162bc5f",
"PbaExpirationDate": null,
"Quantity": 2,
"ParentSubscriptionId": null,
"ProductId": "6fd2c87f-b296-42f0-b197-1e91e994b900",
"CspId": "c40c08c6-30bd-405f-9668-4c558f5649f6"
},
{
"IsTrial": false,
"IsExpired": false,
"ExpiredIn": 372,
"SubsId": "7a8ea58f-d352-494c-9592-ecbcabe3821a",
"OfferId": "91fd106f-4b2c-4938-95ac-f54f74e9a239",
"Status": "Enabled",
"AutoRenew": true,
"StartEffectiveDate": "2020-03-02T00:00:00",
"EndEffectiveDate": "2021-03-14T00:00:00",
"ApsTenantId": "32e9c8bd-23a1-4a73-9af2-c05b05116136",
"PbaOrderId": null,
"ApsId": "42642e55-a602-4ae3-a771-94954f4c410e",
"PbaExpirationDate": null,
"Quantity": 2,
"ParentSubscriptionId": null,
"ProductId": "18181a46-0d4e-45cd-891e-60aabd171b4e",
"CspId": "4ee154cd-e9e7-4be4-be08-d0f5cf6a24ed"
}
]
In this response, all cloud subscriptions of the Microsoft account that belongs to the target Microsoft 365 subscription are returned. The cloud subscriptions where ApsTenantId is 6fcff2c9-de5c-4eb3-b2b7-d5722cc29338 belong to the target Microsoft 365 subscription (1000011).