microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Unable to create Subscriptions using GraphServiceClient

Open
#2,269 5 comments 0 reactions 1 assignee View on GitHub

@shemogumbe is already working on this.

Since Sep 23, 2024.

type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug
When using the client library (v5.36.0) and serializing the ExpirationDateTime property of Subscription class the result in value which is not accepted by the endpoint. The response error message indicates that expiration date is not provided at all: 400 expirationDateTime is a required property for subscription creation.

To Reproduce
Steps to reproduce the behavior:

  1. Create C# project and instanciate new GraphServiceClient
  2. Instanciate new Subscription object and provide valid value for ExpirationDateTime (e.g. DateTimeOffset.UtcNow.AddMinutes(60))
  3. Call graphClient.Subscriptions.PostAsync(subscription) method
  4. Error response is returned

Expected behavior
New subscription is created succesfully.

Screenshots
Using logger handler I can see the payload generated by the library:
image

Desktop (please complete the following information):

  • OS: Win11
  • Browser Edge
  • Version 120.0.2210.91

Additional context
Leaving the ExpirationDateTime property unset (null) result into the same error message. Same request is issued using a postman - expectedly the same error occur. However, ammending the postman payload from 2023-12-28T18:23:45.9356913+00.00 to 2023-12-28T18:23:45.9356913Z is now accepted by the endpoint and processed as expected. Same behavior is observed when renewing subscription.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.