question

BhanuPrasad-4344 avatar image
1 Vote"
BhanuPrasad-4344 asked JohnVannoy-0283 published

Graph API - calendar event subscription response doesnt include unique id which is icaluid for an event

We have calendar event subscriptions and we get the following response.

{
"value": [{
"subscriptionId": "xxxxxxxx-878b-4d07-8539-1da3axxxxxxxx",
"subscriptionExpirationDateTime": "2021-03-07T02:30:14.5887657-08:00",
"changeType": "created",
"resource": "Users/0b53683d-fd4c-4ca4-9f3a-3c6bxxxxxxxx/Events/AAMkAGZjZWFlNWJkLTAzMTctNGEzNy1hZjA4LWRmNDQwNDczYWRjOQBGAAAAAAAkVKcbJTK2T7-a4sSv1LzgBwDdRTpe0854Qan5mu_s52tQAAAAsmZUAACye3PIhW7CS4D=",
"resourceData": {
"@odata.type": "#Microsoft.Graph.Event",
"@odata.id": "Users/0b53683d-fd4c-4ca4-9f3a-3c6bxxxxxxxx/Events/AAMkAGZjZWFlNWJkLTAzMTctNGEzNy1hZjA4LWRmNDQwNDczYWRjOQBGAAAAAAAkVKcbJTK2T7-a4sSv1LzgBwDdRTpe0854Qan5mu_s52tQAAAAsmZUAACye3PIhW7CS4D=",
"@odata.etag": "W/\"DwAAABYAAACye3PIhW7CS4DdyklpCnLAxxxxxxxx\"",
"id": "AAMkAGZjZWFlNWJkLTAzMTctNGEzNy1hZjA4LWRmNDQwNDczYWRjOQBGAAAAAAAkVKcbJTK2T7-a4sSv1LzgBwDdRTpe0854Qan5mu_s52tQAAAAsmZUAACye3PIhW7CS4D="
},
"clientState": "REPLACE",
"tenantId": "xxxxxxxx-004e-444d-93e8-f7e8xxxxxxxx"
}]
}

we found that "id" field mentioned in the json is not unique and we can clearly see other events assigned with the same id. Also for an event "iCalUId" is a unique id. So when we call the event details using above "id" we get details of a different event sometimes or am I missing something?

Please suggest if we can access "iCalUId" in subscription response.

Thanks.

microsoft-graph-calendar
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Deva-MSFT avatar image
0 Votes"
Deva-MSFT answered JaumeBalust-3996 commented

What you meant by id is not unique? Do you see the difference when you subscribed to various calendars/mailboxes? Please explain.

In the above scenario, if you use iCalUId to identify a specific instance of a recurring meeting, this scenario can be achieved by listing instances (occurrences) of an event with seriesMasterId for a specified time range.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Deva-MSFT ,
It is not very pratical to list ocurrences. Imagine :
- a recurring event that repeats each day "forever"
- User edits instance from next year.

In order to update it in our database we would need to fetch all the events from 2 years...
If they edit an instance that is 3 years away...

It is not efficient...

If we could do the matching via ICalUid it would be extremely clean.
Thanks in advance,
Jimmy


0 Votes 0 ·
GaryBailey-7392 avatar image
1 Vote"
GaryBailey-7392 answered

The problem that we have on this one now is that iCalUid is unique, but that ID is not sent on the webhook call. We're trying to work through the immutable ID route, but webhook calls are creating duplicate events in our database currently.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JohnVannoy-0283 avatar image
0 Votes"
JohnVannoy-0283 answered JohnVannoy-0283 published

You would need to do a subsequent API to call to retrieve the details of the event, using the ID supplied on the webhook call; the event details would contain the ICalUID

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.