question

justin-nguyen11499 avatar image
justin-nguyen11499 asked justin-nguyen11499 commented

403 Fobiden Compliance Api

I use Compliance API daily to run report. But today and yesterday I get error "403 Fobiden", so I can't make report. Please check and let me now this issue.

forbiden403complianceapi
1 |1000

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

Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered

403 means forbidden permission which means you are not authorized or allowed. This happens when you get with wrong credentials like client id or client secret or wrong phone number or extension etc or particular permission is missing.

Make sure if anything changed. Check with devsupport@ringcentral.com team providing them full details of your Api and environment

1 |1000

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

justin-nguyen11499 avatar image
justin-nguyen11499 answered

Compliance Api don't work. I get taskId successfull, Then I using taskId to get report.zip file but taskId return reult is null. Please check, it still work very good in 2019.

1 |1000

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

Phong Vu avatar image
Phong Vu answered

I run my test code and it works well today. Can you try this Node JS code on your machine, just make sure you have installed the RingCentral JS SDK and replace the app and user login credentials

var rcsdk = new SDK({
      server: RINGCENTRAL_SERVER,
      appKey: RINGCENTRAL_CLIENTID,
      appSecret: RINGCENTRAL_CLIENTSECRET
  });
var platform = rcsdk.platform();
platform.login({
      username: RINGCENTRAL_USERNAME,
      password: RINGCENTRAL_PASSWORD,
      extension: RINGCENTRAL_EXTENSION
      })
      .then(function(resp) {
          create_glip_compliance_export_task()
      });
 
function create_glip_compliance_export_task(){
    console.log("Create export task.")
    var endpoint = "/restapi/v1.0/glip/data-export"
    var params = {
        timeFrom: "2019-08-01T00:00:00.000Z",
        timeTo: "2020-01-15T23:59:59.999Z",
      }
    platform.post(endpoint, params)
      .then(function(resp){
          var json = resp.json()
          console.log(JSON.stringify(json))
          get_glip_compliance_export_task(json.id)
      })
      .catch(function(e){
          console.log(e)
      })
}
 
function get_glip_compliance_export_task(taskId){
    console.log("Check export task status ...")
    var endpoint = "/restapi/v1.0/glip/data-export/" + taskId
    platform.get(endpoint)
      .then(function(resp){
          var json = resp.json()
          if (json.status == "Completed"){
            console.log(JSON.stringify(json))
              for (var i=0; i<json.datasets.length; i++){
                var fileName = "glip-export-reports/" + json.creationTime + "_" + i + ".zip"
                console.log(json.datasets[i].uri)
                get_glip_report_archived_content(json.datasets[i].uri, fileName)
              }
          }else if (json.status == "Accepted" || json.status == "InProgress") {
              setTimeout(function(){
                get_glip_compliance_export_task(taskId)
              }, 5000);
          }else
              console.log(json.status)
      })
      .catch(function(e){
          console.log(e)
      })
}
 
function get_glip_report_archived_content(contentUri, fileName){
    var uri = platform.createUrl(contentUri, {addToken: true});
    download(uri, fileName, function(){
        console.log("Save report zip file to the local machine. " + fileName)
    })
}
 
const download = function(uri, dest, cb) {
    var file = fs.createWriteStream(dest);
    var request = https.get(uri, function(response) {
        response.pipe(file);
        file.on('finish', function() {
            file.close(cb);
        });
    });
}


1 |1000

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

justin-nguyen11499 avatar image
justin-nguyen11499 answered justin-nguyen11499 commented

Thanks, It work when I run your NodeJS code. But my application with .net SDK still error =))

2 comments
1 |1000

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

Phong Vu avatar image Phong Vu ♦♦ commented ·

There were changes to the Glip compliance export endpoint and we did communicated the impact of the changes to user accounts who use the API. Not sure how and why you might not receive it. Anyway, can you make sure that you have the latest .NET SDK which released a couple weeks ago and has the update for supporting the new Glip compliance export enpoint.

0 Likes 0 ·
justin-nguyen11499 avatar image justin-nguyen11499 Phong Vu ♦♦ commented ·

Thanks, I got it

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.