Call Records API returing 401


I’m trying to get all the call records using the Call Records API. We’re working on a new version of our call reporter application and was wondering if the call records would include internal calls (since the PBX call records don’t support these). But I keep getting a 401 unauthorized when trying to fetch the call records.

Steps to reproduce:

  1. Get token using the password OAuth Flow

  2. Make a GET request to {{media_url}}/calls/records

Interesting, I’m getting the same results. I will discuss with the team here and reply as soon as I have more information.

1 Like

It looks like the issue here is that the $filter query parameter is required, and it has to take the format off $filter=contains(principal,'{principalId}) where the {principalID} is the UserId for the user, however you can only filter for your own call records. If you leave out the filter or try to filter on a principalId for another user, it will return a 401 unauthorized error because it knows who you are based on the token.

The purpose of the /calls/records path is primarily to return your own call history. For example if you click on the ‘Call History’ area of MOWA, it’s populated by making a call to that path.