Zoho Analytics Bulk Api Import json Data

Zoho Analytics Bulk Api Import json Data

HI,

I’m trying to bulk-update rows in Zoho Analytics, and below are the request and response details. I’d like to understand the required parameters for constructing a bulk API request to import or update data in a table using Deluge. Any guidance on this would be greatly appreciated.


  1. workspace_id = vars_map.get("workspace_id");
  2. payments_table_id = vars_map.get("payment_view_id");
  3. org_id = vars_map.get("org_id");
  4. info "Preparing to bulk update " + updated_payments_list.size() + " payment records in analytics table";
  5. // Prepare bulk update data
  6. update_rows_list = List();
  7. for each  payment_map in updated_payments_list
  8. {
  9. paystand_payment_id = payment_map.get("paystand_payment_id");
  10. deposit_id = payment_map.get("deposit_id");
  11. transfer_id = payment_map.get("transfer_id");
  12. // Build update row
  13. update_row = Map();
  14. update_row.put("Paystand Payment ID",paystand_payment_id);
  15. update_row.put("QB Deposit ID",deposit_id);
  16. update_row.put("Paystand Transfer_ID",transfer_id);
  17. update_rows_list.add(update_row);
  18. }
  19. // Execute bulk update
  20. analytics_headers = Map();
  21. analytics_headers.put("ZANALYTICS-ORGID",org_id);
  22. //analytics_headers.put("Content-Type","multipart/form-data");
  23. analytics_headers.put("Content-Type","application/json");
  24. analytics_headers.put("Accept","application/json");
  25. // Prepare bulk import config
  26. configMap = Map();
  27. configMap.put("importType","updateadd");
  28. configMap.put("fileType","json");
  29. configMap.put("autoIdentify",true);
  30. configMap.put("onError","skiprow");
  31. match_columns = List();
  32. match_columns.add("Paystand Payment ID");
  33. configMap.put("matchingColumns",match_columns);
  34. encodedJson = zoho.encryption.urlEncode(configMap.toString());
  35. // Convert rows data to JSON string
  36. payloadMap = Map();
  37. payloadMap.put("data",update_rows_list);
  38. //fileObject = payloadMap.toFile("data.json");
  39. analytics_url = "https://analyticsapi.zoho.com/restapi/v2/workspaces/" + workspace_id + "/views/" + payments_table_id + "/data?CONFIG=" + encodedJson;
  40. info "Sending bulk update payload to analytics";
  41. info payloadMap;
  42. response_map.put("analytics_update_input",payloadMap);
  43. max_retries3 = {1,2,3};
  44. success3 = false;
  45. update_response = null;
  46. for each  retry in max_retries3
  47. {
  48. try 
  49. {
  50. update_response = invokeurl
  51. [
  52. url :analytics_url
  53. type :POST
  54. parameters:payloadMap.toString()
  55. headers:analytics_headers
  56. connection:"paystand_analytics"
  57. ];
  58. success3 = true;
  59. info "Analytics bulk update response";
  60. info update_response;
  61. }
  62. catch (e)
  63. {
  64. info "in exception" + e.toString();
  65. }
  66. if(!success3)
  67. {
  68. info "Retrying ";
  69. }
  70. else
  71. {
  72. break;
  73. }
  74. }


  1. {
  2.    status : "failure",
  3.    summary : "COMMON_INTERNAL_SERVER_ERROR",
  4.    data : {
  5.       errorCode : 7005,
  6.       errorMessage : "Sorry, an unexpected error occurred when performing this operation. The error has been logged and will be looked into.\n\nIt would be of great help if you could provide us with additional information using the ''Feedback'' link."
  7.    }
  8. }

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ




                                ご検討中の方