Getting a page of call reports

Here is an example sh script that will retrieve the first page of 2 calls using your babelforce account API credentials, i.e. it will return the most recent 2 completed call records:

ACCESS_ID='yourlongbabelforceapiaccessidgoeshere'
TOKEN='yourlongbabelforceapitokengoeshere'

ENDPOINT="https://services.babelforce.com/api/v2/calls/reporting?max=2&page=1"

curl $ENDPOINT \
-H "X-Auth-Access-Id: $ACCESS_ID" \
-H "X-Auth-Access-Token: $TOKEN" \

 

Running the above on the command line will give output like this:

 

{

  "items" : [ {

    "id" : "31110b60-ccf4-4e79-a016-6re095ff1239",

    "dateCreated" : "2015-02-20T06:43:58.000Z",

    "lastUpdated" : "2015-02-20T06:44:25.000Z",

    "state" : "COMPLETED",

    "from" : "491511234567",

    "to" : "493091111222",

    "type" : "INBOUND",

    "source" : "QUEUE",

    "domain" : "EXTERNAL",

    "duration" : 27608,

    "anonymous" : true,

    "recordings" : [ {

      "id" : "714c0e2b-2375-40db-8932-c83952362a9e",

      "duration" : 3800,

      "url" : "https://services-pp.babelforce.com/recording/b65a79hj-a6fd-4c33-945d-58a32f1cfe66/714c0e2b-2375-40db-8932-c67952362a9e/stream.wav",

      "tags" : [ ]

    } ],

    "_url" : "/api/v2/calls/31110b54-ccd1-4e79-a016-6ce095ff1239"

  }, {

    "id" : "74c37322-88f7-4e07-a9c4-fef6365bbef0",

    "dateCreated" : "2015-02-20T06:42:40.000Z",

    "lastUpdated" : "2015-02-20T06:43:23.000Z",

    "state" : "COMPLETED",

    "from" : "4915133344555",

    "to" : "4930927987897",

    "type" : "INBOUND",

    "source" : "QUEUE",

    "domain" : "EXTERNAL",

    "duration" : 43237,

    "anonymous" : true,

    "recordings" : [ {

      "id" : "def0f1b9-f434-4741-9765-074023fc7d56",

      "duration" : 23960,

      "url" : "https://services-pp.babelforce.com/recording/b65a79eg-a6fd-4c33-945d-58a32f1cfe66/def0f1b9-f574-4741-9215-074023fc7d56/stream.wav",

      "tags" : [ ]

    } ],

    "_url" : "/api/v2/calls/74c37402-88f7-4e07-e4c4-fef6365bbef0"

  } ],

  "pagination" : {

    "pages" : 961,

    "total" : 1921,

    "current" : 1,

    "max" : 2,

    "next" : "/api/v2/calls?page=2&max=2"

  },

  "_meta" : {

    "count" : 2,

    "totalCount" : 1921

  },

  "success" : true

}

 

 

Have more questions? Submit a request