以CSV格式备份ZOHO CRM中的所有表

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了以CSV格式备份ZOHO CRM中的所有表相关的知识,希望对你有一定的参考价值。

fill your username and password
  1. #!/usr/bin/perl
  2. use strict;
  3. use LWP::UserAgent;
  4. my $silent = 0; # set to 1 for no output on stdout
  5. my $logindata = {
  6. 'j_username' => 'fill in your username (email)',
  7. 'j_password' => 'fill in your password',
  8. 'j_remember' => 'on',
  9. };
  10. my $loginurl = 'http://crm.zoho.com/crm/zohologin';
  11. my $backupurl = 'http://crm.zoho.com/crm/ExportEntity.do';
  12. my @backuptables = qw{Users Leads Accounts Contacts Potentials Campaigns Tasks Events Notes Competitors Products PriceBooks Cases Solutions Forecasts Vendors Quotes SalesOrders PurchaseOrders Invoices};
  13.  
  14. my $ua = LWP::UserAgent->new;
  15. $ua->cookie_jar({ file => "cookies.txt" });
  16.  
  17. print qq{get cookie from frontpage...} unless $silent;
  18. my $devnull = $ua->get('http://crm.zoho.com/crm/login.sas'); #get cookie
  19. print qq{done. } unless $silent;
  20.  
  21. print qq{login as $$logindata{'j_username'}...} unless $silent;
  22. my $loginresponse = $ua->post($loginurl, $logindata);
  23. print qq{done. } unless $silent;
  24.  
  25. foreach my $whichtable (@backuptables) {
  26. print qq{exporting $whichtable.csv...} unless $silent;
  27. my $backupdata = {
  28. 'module' => $whichtable,
  29. };
  30. my $backuptable = $ua->post($backupurl, $backupdata);
  31. open (KI, ">$whichtable.csv");
  32. print KI $backuptable->content;
  33. close (KI);
  34. print qq{done. } unless $silent;
  35. }

以上是关于以CSV格式备份ZOHO CRM中的所有表的主要内容,如果未能解决你的问题,请参考以下文章

如何在 zoho crm 中将沙盒编辑代码部署到生产环境

如何使用 php 代码将 ZOHO CRM 与 Zapier 连接?

Angular 应用授权和 Zoho CRM 的问题

使用 'mysqldump' 以 CSV 格式转储所有表

使用 Angular 制作 Zoho CRM 扩展

使用http电话登录Zoho CRM