Why am I getting SendingFailed, Callfailed when the fax is sent?
Why is only the cover page being received?
Even from the API Explorer, I receive a notification a fax was received however I only get the cover page.
For my test I'm sending a fax to my RingCentral test fax number, but once received the message store shows a status of SendingFailed, with a faxErrorCode of CallFailed.
Sending a fax via https://developers.ringcentral.com/api-reference/Fax/createFaxMessage
Request
// https://developers.ringcentral.com/my-account.html#/applications
// Find your credentials at the above url, set them as environment variables, or enter them below
// PATH PARAMETERS
const accountId = '<ENTER VALUE>';
const extensionId = '<ENTER VALUE>';
const recipient = '<ENTER VALUE>';
const SDK = require('ringcentral');
const rcsdk = new SDK({ server: process.env.serverURL, appKey: process.env.clientId, appSecret: process.env.clientSecret});
const platform = rcsdk.platform();
var FormData = require('form-data');
formData = new FormData();
formData.append('json', new Buffer(JSON.stringify({
to: [ { 'phoneNumber': recipient} ],
faxResolution: 'High',
coverPageText: "This is a demo Fax page from Node JS"
})), {
filename: 'request.json',
contentType: 'application/json'
});
formData.append('attachment', require('fs').createReadStream('fax.jpg'));
platform.login({ username: process.env.username, extension: process.env.extension, password: process.env.password }).then(() => {
platform.post(`/restapi/v1.0/account/${ accountId}/extension/${ extensionId}/fax`, formData).then((r) => {
// HANDLE REPONSE
});
});
Response
{
"id": 9227927004,
"to": [
{
"phoneNumber": "<My RingCentral Test Fax #>",
"location": "<My City/State>",
"messageStatus": "Queued"
}
],
"type": "Fax",
"creationTime": "2021-03-26T17:01:26.000Z",
"readStatus": "Unread",
"priority": "Normal",
"attachments": [
{
"id": 9227927004,
"type": "RenderedDocument",
"contentType": "application/pdf"
}
],
"direction": "Outbound",
"availability": "Alive",
"messageStatus": "Queued",
"faxResolution": "High",
"faxPageCount": 0,
"lastModifiedTime": "2021-03-26T17:01:26.273Z",
"coverIndex": 3
}
Then after I receive the email from RingCentraly telling me the fax was received I use the following call to get that messages status from the message store list
https://developers.ringcentral.com/api-reference/Message-Store/listMessages
{
"records": [
{
"id": 9227927004,
"extensionId": "288824004",
"to": [
{
"phoneNumber": "<My RingCentral FAX#>",
"location": "<My City/State>",
"messageStatus": "SendingFailed",
"faxErrorCode": "CallFailed"
}
],
"type": "Fax",
"creationTime": "2021-03-26T17:01:26.000Z",
"readStatus": "Unread",
"priority": "Normal",
"attachments": [
{
"id": 9227927004,
"type": "RenderedDocument",
"contentType": "application/pdf"
}
],
"direction": "Outbound",
"availability": "Alive",
"messageStatus": "SendingFailed",
"faxResolution": "High",
"faxPageCount": 5,
"lastModifiedTime": "2021-03-26T17:10:27.131Z",
"coverIndex": 3
},
,
Why am I getting SendingFailed, Callfailed when the fax is sent?
Why is only the cover page being received?
Even from the API Explorer, I receive a notification a fax was received however I only get the cover page.
For my test I'm sending a fax to my RingCentral test fax number, but once received the message store shows a status of SendingFailed, with a faxErrorCode of CallFailed.
Sending a fax via https://developers.ringcentral.com/api-reference/Fax/createFaxMessage
Request
// https://developers.ringcentral.com/my-account.html#/applications
// Find your credentials at the above url, set them as environment variables, or enter them below
// PATH PARAMETERS
const accountId = '<ENTER VALUE>';
const extensionId = '<ENTER VALUE>';
const recipient = '<ENTER VALUE>';
const SDK = require('ringcentral');
const rcsdk = new SDK({ server: process.env.serverURL, appKey: process.env.clientId, appSecret: process.env.clientSecret});
const platform = rcsdk.platform();
var FormData = require('form-data');
formData = new FormData();
formData.append('json', new Buffer(JSON.stringify({
to: [ { 'phoneNumber': recipient} ],
faxResolution: 'High',
coverPageText: "This is a demo Fax page from Node JS"
})), {
filename: 'request.json',
contentType: 'application/json'
});
formData.append('attachment', require('fs').createReadStream('fax.jpg'));
platform.login({ username: process.env.username, extension: process.env.extension, password: process.env.password }).then(() => {
platform.post(`/restapi/v1.0/account/${ accountId}/extension/${ extensionId}/fax`, formData).then((r) => {
// HANDLE REPONSE
});
});
Response
{
"id": 9227927004,
"to": [
{
"phoneNumber": "<My RingCentral Test Fax #>",
"location": "<My City/State>",
"messageStatus": "Queued"
}
],
"type": "Fax",
"creationTime": "2021-03-26T17:01:26.000Z",
"readStatus": "Unread",
"priority": "Normal",
"attachments": [
{
"id": 9227927004,
"type": "RenderedDocument",
"contentType": "application/pdf"
}
],
"direction": "Outbound",
"availability": "Alive",
"messageStatus": "Queued",
"faxResolution": "High",
"faxPageCount": 0,
"lastModifiedTime": "2021-03-26T17:01:26.273Z",
"coverIndex": 3
}
Then after I receive the email from RingCentraly telling me the fax was received I use the following call to get that messages status from the message store list
https://developers.ringcentral.com/api-reference/Message-Store/listMessages
{
"records": [
{
"id": 9227927004,
"extensionId": "288824004",
"to": [
{
"phoneNumber": "<My RingCentral FAX#>",
"location": "<My City/State>",
"messageStatus": "SendingFailed",
"faxErrorCode": "CallFailed"
}
],
"type": "Fax",
"creationTime": "2021-03-26T17:01:26.000Z",
"readStatus": "Unread",
"priority": "Normal",
"attachments": [
{
"id": 9227927004,
"type": "RenderedDocument",
"contentType": "application/pdf"
}
],
"direction": "Outbound",
"availability": "Alive",
"messageStatus": "SendingFailed",
"faxResolution": "High",
"faxPageCount": 5,
"lastModifiedTime": "2021-03-26T17:10:27.131Z",
"coverIndex": 3
},