Erick B
Erick B

Reputation: 516

How can we retrieve existing subscriptions in Microsoft Graph?

This is the call I'm trying:

https://graph.microsoft.com/v1.0/subscriptions

This results in the following error:

{
    "error": {
        "code": "QueryNotSupported",
        "message": "The query is not supported.",
        "innerError": {
            "request-id": "8b2f2137-51ed-498d-9fbb-bc0a29c509da",
            "date": "2018-01-27T14:56:01"
        }
    }
}

I am using the Microsoft Graph .NET SDK to make the actual call:

var subscriptions = await graphServiceClient.Subscriptions.Request().GetAsync();

Upvotes: 1

Views: 530

Answers (1)

Marc LaFleur
Marc LaFleur

Reputation: 33094

It isn't possible to retrieve a list of all existing subscriptions. You need to know the subscriptionId for a given subscription before you can GET, PATCH, or DELETE a subscription.

Keep in mind that subscriptions are by nature temporary resources. Unless that application that requested the subscription renews it, a given subscription will generally automatically expire within 3 days.

Upvotes: 1

Related Questions