Glip Compliance Export in C#

  • 1
  • Question
  • Updated 2 weeks ago
I want to create Data Export Compliance task but I can't find Rc.Restapi().Glip().DataExport(). I dev on C# with Winform frame work. Please help me !!
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb

Posted 2 months ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,568 Points 5k badge 2x thumb
https://github.com/ringcentral/RingCentral.Net/blob/master/samples.md#create-data-export-task

RingCentral.Net is the new RingCentral SDK to replace ringcentral-csharp-client. We are going to announce it next week.  Please have a try: https://www.nuget.org/packages/RingCentral.Net/
(Edited)
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
Ok, thanks very much !!
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
I follow you and I get taskId and archiveId. But when I using Rc.Restapi().Glip().DataExport(taskId).Archive(archiveId).Get() I receive error:

Response:
StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Connection: keep-alive
  RoutingKey: SJC11P01
  RCRequestId: 8ade8990-3caf-11e9-9acd-005056bba449
  Date: Sat, 02 Mar 2019 05:53:45 GMT
  Server: nginx
  Content-Length: 83
  Content-Type: application/json
}
Content: {
  "errorCode" : "AGW-404",
  "message" : "Resource not found",
  "errors" : [ ]
}

Request:
Method: GET, RequestUri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/glip/data-export/238074004-238074004-486026144...', Version: 1.1, Content: <null>, Headers:
{
  User-Agent: RingCentral.Net
  Authorization: Bearer U0pDMTFQMDFQQVMwMHxBQURiejVrdDM5blBqZ19TLVhhTkFOM1VpZ0N3RGRWMVhjdzBzQzZFYlFZVEtFbnBGTk95cFFWUVQ3ZjB1em9ZVWdSNF9QWWRPMEVYNEhPV3FzbEwwTUtuOTJiWmRXWlJvTkk4RWFEc3FFZ0lVQmgzY3pudlk1OWFBbWVIcmFfcmdxaDdhQ0I5Z3h4WXhuV3ZhcUZpUW1vV2dYbkRfUlFVSmR4eTd2U25rWDM3aXRJdWQ4dnU2dlFab1Zibk5Na0JfOFBrcTVKMHBheFR5N2JSdmNKRHVkWEd8anA2YzNnfElMUnEzZHl0SURsLWJPb3VoQWV1Y3d8QUE
}

I check on the status of an Export Task, I receive "Completed" status. Why message is "Resourcec not found" ?
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
Make sure both IDs are correct. (how did you find them?)

There might be a little delay, could you please try again now?
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
I get taskId by "var result = await rc.Restapi(apiVersion).Glip().DataExport().Post(createDataExportTaskRequest)", then I use "var result = await rc.Restapi(apiVersion).Glip().DataExport(taskId).Get()" and I receive uri : "https://media.devtest.ringcentral.com/restapi/v1.0/glip/data-export/238074004-238074004-4860261447dc..." I think archiveId is "1"
(Edited)
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
I don't think archieveId is "1". Because "1" is too special to be valid.
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
"var result = await rc.Restapi(apiVersion).Glip().DataExport(taskId).Get()" result is

https://github.com/ringcentral/RingCentral.Net/blob/master/RingCentral.Net/Definitions/DataExportTas...


It has a property named "result" with type:

https://github.com/ringcentral/RingCentral.Net/blob/master/RingCentral.Net/Definitions/ExportTaskRes...

And there you can find the uri to download.

Let me know if you cannot download it.
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
How to using uri to download if I want to download by .Net SDK ?
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
Thanks, but I have uri : https://media.devtest.ringcentral.com/restapi/v1.0/glip/data-export/137242004-137242004-5ba9ab0c5086...
When I using uri follow you, rc.Get<byte[]>(uri), I receive error message :
StatusCode: 404, ReasonPhrase: 'Not Found', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Connection: keep-alive
  Date: Thu, 07 Mar 2019 00:39:05 GMT
  Server: nginx
  Content-Length: 0
}
Content: 

Request:
Method: GET, RequestUri: 'https://platform.devtest.ringcentral.com/https://media.devtest.ringcentral.com/restapi/v1.0/glip/dat...', Version: 1.1, Content: <null>, Headers:
{
  User-Agent: RingCentral.Net
  Authorization: Bearer U0pDMTFQMDFQQVMwMHxBQURpYmpaVmdaMmt1T1BycnBOdlgtcVljZnBKeThCU1FzSUhxOEpjdjdpQ3pFcFpZcWlCUmE4NFJXc25tWURzLTZWNF9QWWRPMEVYNEhPV3FzbEwwTUtuQUZxSklfb3N0SGM4RWFEc3FFZ0lVQ2owVVJmMW5QLVdVdVlzVUZvaG1LQm40MkJ4Rzk3azloeWJRcmgzaVRlX25KWjNSWGl2d041eTd2U25rWDM3aXRfaGtyQmpKSFhZdm5HYXE0Q2tnMWstQk9RMnRLRkpIRC0wOTFXRkJfODl8eUxKMG1RfHA0R0dqdUtCWndxMjhYcklnUzZqVmd8QUE
}
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
I think it is a bug on our side. I will escalate this issue
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
Thanks, I hope this issue can handle as soon as you can !
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
I will get back to you as soon as I can.
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
I am still investigating. 

Did read this article: https://medium.com/ringcentral-developers/glip-compliance-exports-api-for-ediscovery-gdpr-and-analyt...?

Could you please check the export status via GUI?    Like this: https://cdn-images-1.medium.com/max/800/1*LDER__SASp1NUwpgH5-gfQ.png

Just to do troubleshooting. Thank you.
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
When I create task, I recieve task id, then i use this task id and call var result = await rc.Restapi(apiVersion).Glip().DataExport(taskId).Get() to check status, and I recive status = Completed. 
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
Upgrade to RingCentral.Net latest version. We published a new version to fixed the issue.


Root cause is 'https://platform.devtest.ringcentral.com/https://media.devtest.ringcentral.com/restapi/v1.0/glip/dat...', 

it should be 'https://media.devtest.ringcentral.com/restapi/v1.0/glip/dat...', 

Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
Ok, I will upragde and test it now. Thanks
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
Hi, thank you about your help for me. I downloaded zip file but when I extract zip file then I don't recieve folder and file which same  folder and file I recieved in Ringcentral APP. I can't use them
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
Could you please be more specific?  
According to https://medium.com/ringcentral-developers/glip-compliance-exports-api-for-ediscovery-gdpr-and-analyt...

There should be three files in the zip file: guests/guests_1.json  members/members_1.json and request_info.json

Is it not the same in your case?
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
When I create report in Ringcentral App them I reieved People_And_Groups, People_Chats, Team_Chats, Teams but when I using API then I reieved chats, events, files, guests, members, notes, posts, task, and request_info.json. I can't work with them
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
OK, I will escalate this issue and keep you updated.
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
Thanks, I look forward to hearing from you soon !
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
Hi Hai,

I double checked with my colleagues and we knew that the results between APP and API are different and it is probably by design.

Question for you: is there important data missing ? If yes what data that you need but the API doesn't return?  If no could you please adjust your code to handle data from API?
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
Hello, after analysise data structure. I confuse  mentions__id ,mentions__type,attachments__id, attachments__type in posts.json. Can you explain my confuse ?
Photo of Tyler Long

Tyler Long, Official Rep

  • 9,406 Points 5k badge 2x thumb
Are you talking about the app or the API? And what is the confusion? Could you please be more specific? For example, what values of "mentions__id ,mentions__type,attachments__id, attachments__type" make you confused?
Photo of Hai Nguyen

Hai Nguyen

  • 240 Points 100 badge 2x thumb
I'm talking about API, I'm need explain meaning about mentions__id ,mentions__type,attachments__id, attachments__type