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.

What about a back-end application querying the API on behalf of a user? Surely admin accounts should be able to view call records of any device in the CloudLink account.

Hi @andrew! You need to keep in mind that CloudLink was designed to be used just by Mitel applications initially, so when we add functionality we’re usually limiting to the specific use case for that application. In the case of call records, Mitel doesn’t have a back-end application that tracks call history for all users (that runs off CloudLink services), just client ones that pull their own call history.

That said, I can raise this up as a feature request for you. I’ll just need some more context about what you’re trying to do and why, feel free to email or PM me the details if you don’t want to share it publicly.

Hey Budd

A feature request would be great, thank you.

The use case is sever-based applications. On top of the presence app, I’m also building a reception call control app. This app allows our team to control a Mitel 6930 desk phone from their computer, along with a presence view of over 100 extensions per location (~14,000 in total).

To view call records at present, I’d have to somehow:

  1. Authenticate my users into the application using my current authentication method and;
  2. Authenticate the user to CloudLink to view the records of the phone they’re trying to control.

Our reception phones are shared, there might be 4-5 receptionists that work over a 7-day period. To achieve Step 2 of above, I’d need to share the reception phones auth information between 4-5 accounts in my app. Why do that when I could be obtaining the call records server-side using an API user with access to all phones?


Hi Andrew,

I’ll raise this up as a feature request for you. While this behaviour is unlikely to change as this limitation of access to call records is by design for security reasons, we can look at the possibility of adding a new user role that grants more access to other user’s data.

I’m also still actively working on your other open issues, thank you for being so patient. If you can send me another set of CL Gateway logs, I would also appreciate that! Some of the scenarios we’re looking at for you aren’t covered by the last batch you sent.

Hi Budd,

Any update on this - we are also looking at a way to have a user with elevated permission which will allow us to view other user’s call history.

Hi @rey.visns!

Adding this kind of role would require significant effort as there isn’t the kind of access policy framework in place that is necessary for this feature in CloudLink. As such, it’s not currently included on the roadmap. I will add your organization to this feature request in the hopes that it will elevate its priority.

1 Like