Get list of users for a customer subscription (REST API) RRS feed


All replies

  • Hi!

    Make a request to the Users with the Graph API:


    The User Object has AssignedLicense,AssignedPlan and match the SkuId and ServicePlanId

    • Edited by Pseudocode Wednesday, May 18, 2016 2:14 PM
    Wednesday, May 18, 2016 2:11 PM
  • I'm already retrieving the list of users with their assigned licenses, but I don't see a way to match a license (skuId) to an Office 365 subscription. How do I match licenses to subscriptions in order to view the users of a particular subscription?
    • Edited by theodorejb Wednesday, May 18, 2016 3:50 PM Improve wording
    Wednesday, May 18, 2016 2:58 PM
  • Hi,

    We can firstly get all subscriptions for each user and then compare the subscription offer uri with Offer id in Price list.

    Price list download link:



    Best Regards

    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, May 19, 2016 9:11 AM
  • What API endpoint do I use to get all subscriptions for each user?
    • Edited by theodorejb Thursday, May 19, 2016 1:19 PM
    Thursday, May 19, 2016 1:14 PM
  • Did you try to call:


    to get all subscribedSkus for a tenant
    and then, match the ServicePlanId with the User from


    Thursday, May 19, 2016 2:55 PM
  • Yes, that lets me match users to SKUs but what I'm trying to do is match users to Office 365 subscriptions. How do I determine which subscription a SKU is for?
    • Edited by theodorejb Thursday, May 19, 2016 3:07 PM
    Thursday, May 19, 2016 2:59 PM
  • Hi,

    i assign subscriptions (license) to specific users with the CREST and GRAPH API.
    I can check my code tomorrow and post some examples.
    Hope that helps!

    Thursday, May 19, 2016 5:19 PM
  • Thanks! I'm looking forward to see your examples.
    Thursday, May 19, 2016 8:51 PM
  • So here are my steps to assign a subscription to a user.

    1. Book a subscription
    2. Get the Entitlements Information for the subscription with
      In the Entilement there is a product_uri 
      The Last GUID is the product GUID for my subscription (SkuId)
    3. Next step is to call the subscribedSkus for the tenant to get the right servicePlanId
    4. The last step is to assignLicense with the servicePlanId

    You are right, there is no match between skuid and Subscription Id (the way back from user to subscription)

    • Edited by Pseudocode Friday, May 20, 2016 8:29 AM
    Friday, May 20, 2016 8:29 AM
  • I figured this out based on a reply to the Azure Graph API. Assigned licenses. How to find related subscription post.

    When a subscription is requested it includes a links/offer/uri property which can be used to request the subscription offer. The resulting offer object includes a product/id property which (when lowercased) matches to a user skuId.

    • Marked as answer by theodorejb Friday, May 20, 2016 2:50 PM
    Friday, May 20, 2016 2:50 PM
  • Thanks for the Information.

    If you mean this line:

    This is working only, if you have one eg. Office 365 Business subscription for the tenant.If you have two Office 365 Business subscriptions, you can not match this back from user to the subscription.

    Friday, May 20, 2016 2:57 PM