Forum Discussion

senkwe85's avatar
senkwe85
Copper Contributor
Mar 17, 2025

usageRights api returning multiple results for the same catalogID

So I'm using Graph SDK's usageRights endpoint to test license management for a transactable offer.

I'm curious to know how it is that I'm getting a result that looks like this. (actual property values masked)

For the same serviceIdentifier and catalogId I get two different results for the same user. The only difference being the actual usageRight id

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('some-user-id')/usageRights",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET users('<guid>')/usageRights?$select=catalogId,serviceIdentifier",
    "value": [
        {
            "id": "some-usage-right-id",
            "catalogId": "XXX:0001",
            "serviceIdentifier": "my.test-offer.plan1",
            "state": "inactive"
        },
        {
            "id": "some-other-usageright-id",
            "catalogId": "XXX:0001",
            "serviceIdentifier": "my.test-offer.plan1",
            "state": "active"
        }
    ]
}

 

When I unnasign this license and make the same call, I get the following result

 

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('some-user-id')/usageRights",
    "@microsoft.graph.tips": "Use $select to choose only the properties your app needs, as this can lead to performance improvements. For example: GET users('<guid>')/usageRights?$select=catalogId,serviceIdentifier",
    "value": [
        {
            "id": "some-usage-right-id",
            "catalogId": "XXX:0001",
            "serviceIdentifier": "my.test-offer.plan1",
            "state": "inactive"
        }

    ]

}

This implies to me that for some reason, I have a "hanging" usageRight perhaps from some previous test.

My question is, how do I reliably determine which of these two usageRights is the correct one to use? Based on what I've written above it's clearly the second one but how do I determine this in code?

No RepliesBe the first to reply

Resources