Question

Call recordings to Onedrive (Via Make.com/Zapier/Tray.io, etc)

  • 21 December 2022
  • 1 reply
  • 343 views

I'm looking to use a PnP API connection tool such as Make/Zapier, etc to try and automate a daily call recording file transfer from our call logs, to a Sharepoint/Onedrive location in our O365 cloud.

I can connect to my account, retrieve the call logs, but it seems there is a missing connector to "store" the file, as the token doesn't get shared from RingCentral, and I basically end up with a text file which contains:

"errorCode" : "AGW-401", "message" : "Authorization header is not specified"

Has anyone successfully created a process using a tool such as this, which would allow a scheduled dump of calls (based on the call log for the previous day - this part has been tested)

I am using a re-branded version of RingCentral through Telus Business Connect and so far, the API calls don't seem to be any different, so I don't think that will have any effect on what I am trying to accomplish. TIA, much appreciate for any direction.


1 reply

Userlevel 1

I am not familiar with the tool you are using. But you need to set a valid access token (the token you use to read the same call log record that gives you the call recording contentUri) to the HTTP Authorization header. Here is an example how I set it in Node JS.

const download_new = function(domain, path, accessToken, dest, cb) {
    var file = fs.createWriteStream(dest);
    var options = {
          host: domain,
          path: path,
          method: "GET",
          headers: {
            Authorization: `Bearer ${accessToken}`
          }
      }
    const req = https.request(options, res => {
    console.log(`statusCode: ${res.statusCode}`)
    res.pipe(file);
    file.on('finish', function() {
        file.close(cb);
    });
  })
  req.on('error', error => {
    console.error(error)
  })
  req.end()
}

Where the domain and path is taken from the contentUri

domain: media.ringcentral.com

path: /restapi/v1.0/account/xxxx/recording/xxxxxxxx/content

Reply