Working with Media Content

A number of RingCentral APIs make available to developers access to media files that one may want to download, stream or embed somewhere. Here are a few examples of such media files:

  • Call Recordings
  • Voicemails
  • Fax Documents
  • MMS attachments
  • Greetings

Media/Download URLs

All media files can be accessed via a URL returned via an API Call. For example, the following shows a response payload from the RingCentral Message Store which refers to a received fax document that a developer can download. It has been truncated for brevity.

  "uri" : "\
  "records" : [ ... ,
      "uri": "\
      "id": 5209304004,
      "from": {
        "phoneNumber": "+15555287464"
      "type": "Fax",
      "creationTime": "2018-10-08T09:17:27.000Z",
      "readStatus": "Unread",
      "priority": "Normal",
      "attachments": [
          "id": 5209304004,
          "uri": "\
          "type": "RenderedDocument",
          "contentType": "application/pdf"
      "direction": "Inbound",
      "availability": "Alive",
      "subject": "+15556009976",
      "messageStatus": "Received",
      "faxResolution": "High",
      "faxPageCount": 1,
      "lastModifiedTime": "2018-10-08T09:17:27.227Z"
  ... ],
  "paging" : {
    // snipped
  "navigation" : {
    // snipped

Building media content URLs

While media content URLs all end predictably in /content, developers should not build these URLs manually. Content URLs should be fetched a response payload directly as they are subject to change.

Downloading Partial Content

There are times you may need to download large files in pieces. Perhaps your HTTP client has an aggressive timeout, or it would be a more efficient use of resources. Regardless, one can download any media resource within RingCentral in pieces by passing HTTP Range headers in their request.

GET /account/230919004/extension/230919004/message-store/5209304004/content/5209304004 HTTP/1.1
Range: bytes=0-1023

HTTP 206 Partial

Developers should also be aware of the potential that the server may respond with a 206 Partial response code indicating that only part of the file is being returned. In the event you received this header, you will need to download the file in chunks according to the standard.