question

matt-spinks avatar image
matt-spinks asked ·

How can a fax "to" be null?

We are processing a lot of fax messages from the RingCentral api. Recently, we discovered a lot of the records in the fax log api have no recipient. For example:

{
  "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/2793220020/extension/2793222020/message-store?messageType=Fax&availability=Alive&dateFrom=2019-12-02T07:19:11.000Z&dateTo=2019-12-02T23:59:59.000Z&page=1&perPage=100",
  "records" : [ {
    "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/2793220020/extension/2793222020/message-store/1098879326020",
    "id" : 1098879326020,
    "from" : {
      "phoneNumber" : "+17323901763",
      "location" : "South River, NJ"
    },
    "type" : "Fax",
    "creationTime" : "2019-12-02T18:00:40.000Z",
    "readStatus" : "Unread",
    "priority" : "Normal",
    "attachments" : [ {
      "id" : 1098879326020,
      "uri" : "https://media.ringcentral.com/restapi/v1.0/account/2793220020/extension/2793222020/message-store/1098879326020/content/1098879326020",
      "type" : "RenderedDocument",
      "contentType" : "application/pdf"
    } ],
    "direction" : "Inbound",
    "availability" : "Alive",
    "subject" : "+19089410855",
    "messageStatus" : "Received",
    "faxResolution" : "High",
    "faxPageCount" : 1,
    "lastModifiedTime" : "2019-12-02T18:00:40.769Z"
  }, {
    "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/2793220020/extension/2793222020/message-store/1098877522020",
    "id" : 1098877522020,
    "from" : {
      "phoneNumber" : "+17323900896",
      "location" : "South River, NJ"
    },
    "type" : "Fax",
    "creationTime" : "2019-12-02T17:49:41.000Z",
    "readStatus" : "Unread",
    "priority" : "Normal",
    "attachments" : [ {
      "id" : 1098877522020,
      "uri" : "https://media.ringcentral.com/restapi/v1.0/account/2793220020/extension/2793222020/message-store/1098877522020/content/1098877522020",
      "type" : "RenderedDocument",
      "contentType" : "application/pdf"
    } ],
    "direction" : "Inbound",
    "availability" : "Alive",
    "subject" : "+19083157235",
    "messageStatus" : "Received",
    "faxResolution" : "High",
    "faxPageCount" : 1,
    "lastModifiedTime" : "2019-12-02T17:49:41.658Z"
  } ],
  "paging" : {
    "page" : 1,
    "totalPages" : 1,
    "perPage" : 100,
    "totalElements" : 2,
    "pageStart" : 0,
    "pageEnd" : 1
  },
  "navigation" : {
    "firstPage" : {
      "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/2793220020/extension/2793222020/message-store?messageType=Fax&availability=Alive&dateFrom=2019-12-02T07:19:11.000Z&dateTo=2019-12-02T23:59:59.000Z&page=1&perPage=100"
    },
    "lastPage" : {
      "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/2793220020/extension/2793222020/message-store?messageType=Fax&availability=Alive&dateFrom=2019-12-02T07:19:11.000Z&dateTo=2019-12-02T23:59:59.000Z&page=1&perPage=100"
    }
  }
}

As you can see, the "to" field is completely missing. How is this possible? The status shows that the message was sent successfully. But according to this, it went nowhere! Is this a bug? We've seen a lot of these lately. We are attempting to assign these messages to a user extension, but we have no data to show what extension it was sent to.

Further, the subject field contains a phone number. I find that very odd as well.


fax api
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

· Write an Answer
Phong Vu avatar image
Phong Vu answered ·

Is the response original or cut? It looks corrupted to me as it is mixing between Pager, Fax, SMS and Voicemail

"pgToDepartment": false,
"smsDeliveryTime": null,
"smsSendingAttemptsCount": null,
"subject": "+14149304071",
"to": null,
"type": "Fax",
"vmTranscriptionStatus": null

Can you read again with the messageType set to "Fax" only?

3 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi Phong, thanks for the response. Yes, this is cut. It's also merged into my model, which combines SMS and Faxes. I just updated my question with a better example. It is plain raw data without any merging, and I used Fax only.

As you can see, there is no "to" field at all, and the subject field still has a phone number for some reason. It's almost like some fields got transposed. And just to be clear, with this latest example, I am pulling the raw text directly from the api. No transformations, no merging of any sort. It's just the raw text I received back from my api call.

0 Likes 0 · ·

Hi Matt,

As you can see, it is an inbound fax message, and in this case, the "subject" field is the "to" number. I am not sure why it is placed in the "subject" field but it seems it is by design.

If it is an Outbound fax message, you will get the "to" field as shown in the example below

to:
   [ { phoneNumber: '+1650XXXXXXX',
       name: 'San Francisco',
       location: 'San Mateo, CA',
       messageStatus: 'Sent' } ],
...

For outbound fax, the subject is not present at all either.

My suggestion is to work around this by checking the fax direction then parse the data accordingly.

Let me know.

0 Likes 0 · ·

If fact, that's what we've done (parse out the direction and detect if the "to" field is null, and then also determine if the subject field matches the phone number format. I was hoping there was some better explanation, though. I don't see anything like this at all in the api docs.

Thanks for the feedback, though.

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.