Don't get Bulk Write API to work

Don't get Bulk Write API to work

Hi everyone,

I'm facing current problem.
I have csv files (+500 row) which I push into a custom module (each row is one entry).

I thought its a good idea to use the Bulk Write API (https://www.zoho.com/crm/developer/docs/api/v6/bulk-write/overview.html)

Uploading of the file was easy but I don't get the 2. step "WriteCreate Bulk Write Job" to work.bulk. I always get this error code
{"code":"INVALID_REQUEST","details":{},"message":"unable to process your request. please verify whether you have entered proper method name, parameter and parameter values.","status":"error"}


Here my code:
  1. //uploadZip is the invoke of https://content.zohoapis.com/crm/v6/upload
  2. fileID = uploadZip.get("details").get("file_id");

  3. bulkMap = Map();
  4. bulkMap.put("operation","insert");
  5. bulkMap.put("ignore_empty",true);
  6. resourceList = List();
  7. resourceMap = Map();
  8. resourceMap.put("type","data");
  9. moduleMap = Map();
  10. moduleMap.put("api_name","CustomModuleXYZ");
  11. resourceMap.put("module",moduleMap);
  12. resourceMap.put("file_id",fileID);
  13. fileNameList = List();
  14. fileNameList.add(filenname);
  15. resourceMap.put("file_names",fileNameList);
  16. fieldMappingList = List();
  17. importDateiNameMap = Map();
  18. importDateiNameMap.put("api_name","Name");
  19. importDateiNameMap.put("index",0);
  20. fieldMappingList.add(importDateiNameMap);
  21. gridSupplyMap = Map();
  22. gridSupplyMap.put("api_name","FieldX");
  23. gridSupplyMap.put("index",16);
  24. fieldMappingList.add(gridSupplyMap);
  25. gridWithdrawalMap = Map();
  26. gridWithdrawalMap.put("api_name","FieldY");
  27. gridWithdrawalMap.put("index",17);
  28. fieldMappingList.add(gridWithdrawalMap);
  29. usageMap = Map();
  30. usageMap.put("api_name","FieldZ");
  31. usageMap.put("index",18);
  32. fieldMappingList.add(usageMap);
  33. ownerConsumptionMap = Map();
  34. ownerConsumptionMap.put("api_name","FieldXY");
  35. ownerConsumptionMap.put("index",20);
  36. fieldMappingList.add(ownerConsumptionMap);
  37. pvEnergyMap = Map();
  38. pvEnergyMap.put("api_name","FieldXZ");
  39. pvEnergyMap.put("index",64);
  40. fieldMappingList.add(pvEnergyMap);

  41. //default field values link to the related file upload
  42. dataImportMap = Map();
  43. dataImportMap.put("api_name","LookupField1");
  44. dataImportMap.put("find_by","id");
  45. dataImportDVMap = Map();
  46. dataImportDVMap.put("value",dataImportID);
  47. dataImportMap.put("defaultValue",dataImportDVMap);
  48. fieldMappingList.add(dataImportMap);

  49. resourceMap.put("field_mappings",fieldMappingList);
  50. resourceList.add(resourceMap);
  51. bulkMap.put("resource",resourceList);
  52. info "bulkMap: " + bulkMap;
  53. createBulkAction = invokeurl
  54. [
  55.       url :"https://www.zohoapis.eu/crm/bulk/v6/write"
  56.       type :POST
  57.       parameters:bulkMap
  58.       connection:"bulkconnection"
  59. ];
  60. info "bulk:" + createBulkAction;

Does someone has an idea how to solve my problem

Best
Markus

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now