Microsoft Graph API getPtsnCalls failing

Michael Cooper 0 Reputation points
2024-04-12T18:45:45.7866667+00:00

I get the following error ( it looks like the call is not handling both parameters correctly):

Error:

BadRequest The DateTimeOffset text '2024-04-04T00:00:00' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.

When making the following call in Python:

from_dt = sd.strftime("%Y-%m-%dT%H:%M:%S")

    to_dt   = ed.strftime("%Y-%m-%dT%H:%M:%S")

    records = await  self.app_client.communications.call_records.microsoft_graph_call_records_get_pstn_calls_with_from_date_time_with_to_date_time(from_dt, to_dt).get()
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,006 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Cooper 0 Reputation points
    2024-04-12T19:18:56.21+00:00

    added UTC Zero - still errors, but slightly different message

    BadRequest The DateTimeOffset text '2024-04-04T00:00:00ZtoDateTime=2024-04-05T00:00:00Z' should be in format 'yyyy-mm-ddThh:mm:ss('.'s+)?(zzzzzz)?' and each field value is within valid range.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.