teams report pstncalls [options]
Get details about PSTN calls made within a given time period
| Option | Description |
| ----------------------- | ----------------------------------------- |
| --fromDateTime <fromDateTime> | The start of time range to query. UTC, inclusive. |
| --toDateTime [toDateTime] | The end time range to query. UTC, inclusive. Defaults to current DateTime if omitted |
| -o, --output [output] | Output type. json,text. Default text |
| --verbose | Runs command with verbose logging |
| --debug | Runs command with debug logging |
GET https://graph.microsoft.com/beta/communications/callRecords/getPstnCalls(fromDateTime=2019-11-01,toDateTime=2019-12-01)CallRecords.Read.All Application permissionHi All - I am happy to take this on as my first issue. Might need a little hand holding if I get stuck - but hopefully the first of many contributions.
Awesome 馃槑 Thanks for your help @leeford 馃憤馃徎
It鈥檚 all yours, feel free to reach out if you have any questions 馃憤馃徎
Hey @leeford, are you still working on this? Can we help with anything? 馃檪
Hey @waldekmastykarz. Apologies I haven't gotten to it yet. Everything has been a bit full on. Hoping to get to it in the next few days - if that is OK?
Totally! Thanks for the update 馃憤
Following the closure of https://github.com/microsoftgraph/microsoft-graph-docs/pull/9859 the permission required for this endpoint is now CallRecords.Read.All.
I'll add the permission to our AAD app after the PR is approved. Until then, in dev, you can use a custom AAD app with this permission @leeford
Thank you, planning to start on it shortly :-)
Sorry, finally getting around to working on this now...
For the fromDateTime and toDateTime options in the table above, should I be using <option> or [option] as they are different. Does [option] signify optional?
No problem, thank you for getting back to us. I've updated the spec so that we use the actual option's name rather than [option]. Square brackets [] indicate an optional value whereas angle brackets <> indicate a required value. Thank you for checking 馃憤
Hi All,
Using a cert managed to connect via custom AAD App and can pull the data from Graph.
A couple of questions:

The reason I ask is, looking at another Teams report (m365 teams report useractivitycounts), the JSON was minified - do I need to do the same?


(I also noticed some text reports seemed to be in csv format, again, is that what is required?
Sorry for all the questions :-)
These are all valid questions: @leeford. Let's take them one by one:
id, calleeNumber, callerNumber, startDateTime (in this order)?Thanks for clearing that up. Will get back to work!
Hey @leeford, are you still working on this?
Apologies, I am - sorry, been a fair bit going on!
No problem. Do you want to still work on it or shall we mark it as available and let others pick it up?
No problem. Do you want to still work on it or shall we mark it as available and let others pick it up?
I am happy to work on it, will be working on it today :-)
Awesome! Appreciate your help!
Update:

I have reduced the columns in text output and the JSON is prettified. I have also added ISO date validation from the existing Utils file.
One thing I have noticed is that you cannot report on a period greater than 90 days on a single Graph call... I am thinking we should be checking for this so will add it in as an extra validation step to avoid a 406 - agree @waldekmastykarz?
I think the only parts left after that are the tests and documentation
Thank you for the update @leeford 馃憤馃徎
One thing I have noticed is that you cannot report on a period greater than 90 days on a single Graph call...
Sounds sensible, we should certainly validate a maximum date range to ensure the command behaves consistently and in a user friendly way.
Nothing in the docs about a 90 day limit, just that calls are returned in pages of 1000, maybe something we should feed back to the Graph team.
Nothing in the docs about a 90 day limit, just that calls are returned in pages of 1000, maybe something we should feed back to the Graph team.
I've submitted a PR for the docs - https://github.com/microsoftgraph/microsoft-graph-docs/pull/10883
Great move @leeford. Let's indeed include validation to help users do the right thing 馃憤
Most helpful comment
Hi All - I am happy to take this on as my first issue. Might need a little hand holding if I get stuck - but hopefully the first of many contributions.