Forum Discussion
StefanFried
Mar 03, 2020Steel Contributor
PSTN Call Statistics - API
hi i'm heavily looking for a way to retrieve PSTN data in an automatic way. I can't find anything in terms of Graph HOWEVER i have seen a vendor which can pull this data "somehow". So i'm wondering...
MrDeanoB
Jan 19, 2021Copper Contributor
Appreciate this reply may be a little late (and may have been solved) but I've only just come across this thread.
I've been looking into this myself and have solved - or, at least, have found a way of doing this with the beta graph APIs. First, I pull the SKUs to understand how many business voice licenses exist to determine total call minutes available. I then use the API:
/communications/callRecords/getPstnCalls
to look for any call type that matches and outbound call and then total the duration for each matching record. From this, you end up with total minutes available for the tenant and total minutes used. If you want an example then let me know.
The getPstnCalls takes a date range so you can specify the window you want data for. From this, you could choose to run when needed. As an example, we use this data to provide our customers will daily updates on their calling credits.
- Prachi_JainMay 22, 2023Copper Contributor
- NickK890May 23, 2023Brass Contributor
Prachi_Jain , Not really.
I believe following is the method but haven't had chance to properly test it yet.
https://learn.microsoft.com/en-us/graph/api/callrecords-callrecord-getpstncalls?view=graph-rest-beta&tabs=http
Thanks ! Nick.
- Prachi_JainMay 28, 2023Copper Contributor
Thank you so much for response