The error message is misleading.
Unfortunately, there is no API to read the message store at the company level. You have to login your app with an admin user, read all extensions to get the extensions' id, then ready the user message store one by one using the extension id. Here is some sample code in Node JS. Hope this helps
var extensionList = []
async function get_extensions() {
try {
var resp = await platform.get('/restapi/v1.0/account/~/extension')
var jsonObj = await resp.json
for (var record of jsonObj.records){
extensionList.push(record.id)
}
readExtensionMessageStore()
}catch(e){
console.log(e.message)
}
}
async function readExtensionMessageStore(){
async.each(extensionList,
async function(extensionId, callback){
var endpoint = '/restapi/v1.0/account/~/extension/'+ extensionId +'/message-store'
try {
var resp = await platform.get(endpoint, {
dateFrom: '2018-01-01T00:00:00.000Z',
dateTo: '2018-07-31T23:59:59.999Z',
messageType: 'Fax'
})
var jsonObj = await resp.json()
if (jsonObj.records.length){
console.log(extensionId)
console.log("=========== EXTENSION MESSAGE STORE ===========")
console.log(JSON.stringify(jsonObj.records
console.log("+++++++++++++++++++++++++++++++++++++")
callback("err", null)
}
}catch(e){
console.log(e.message)
}
}
)
}