Can't get calls log using REST Api

Hello,

We are using FreePBX 13.0.194.5. We have bought and installed commercial module “Customer Relationship Management”.

Now I’m trying to get a list of calls using Rest API (REST API - PBX GUI - Documentation)

This is my code

but I get an empty array, although the data actually exists (I can see this in CDR Report).

that’s what I get in browser :
Screenshot_9

What am I doing wrong?

Thanks in advance!

The API is working for me. I would make sure you are using the latest CRM module (now 13.0.4.34), make sure the the API is enabled (Settings, CRM API Settings) and test from the pbx bash prompt:

[root@34693894 asterisk]# curl -H "Token: token_goes_here_xxxxxxxxxxxxxxxxxxxxxxxxx"  http://localhost/admin/api/sangomacrm/rest/calls/list/both | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 62226    0 62226    0     0   622k      0 --:--:-- --:--:-- --:--:--  626k
{
    "data": [
        {
            "calldate": "1516841910",
            "cnam": "",
            "cnum": "",
            "destination": "920xxxyyyy",
            "direction": "outbound",
            "exttocall": null,
            "owner": "",
            "recordingfile": "",
            "source": "5002",
            "type": "START",
            "uuid": "1516841910.23",
            "voicemailfile": null,
            "zulu_type": null
        },
1 Like

Thanks for your answer, it’s works, the API was disabled…

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.