As far as I know, the API does not currently support the expirationDateTime
parameter, and similar questions have been raised before.
Unable send a file sharing invitation via graph api with expirationDateTime present
Andrew Omondi
246
Reputation points Microsoft Employee
Hey,
Sending the following request via graph explorer results to (400) invalid request.
POST https://graph.microsoft.com/v1.0/drive/items/{item-id}/invite
{
"recipients": [
{
"email": "EmilyB@M365B154026.OnMicrosoft.com"
}
],
"message": "Here's the file that we're collaborating on.",
"requireSignIn": true,
"sendInvitation": true,
"roles": [
"read"
],
"expirationDateTime": "2021-07-15T14:00:00.000Z"
}
However, when I remove the expirationDateTime property, the request works.
What is the correct format for expirationDateTime? I am unable to make a successful request with various formats.
The documentation states the type is DateTimeOffset(see here) while the graph metadata states that the type should be string(screemshot below).
Accepted answer
-
CarlZhao-MSFT 36,896 Reputation points
2021-07-16T07:12:32.01+00:00