Exemplo n.º 1
0
        //public BulkAPIResponse<ZCRMRecord> InsertInvestor(InvestorModel investor)
        //{

        //    ZCRMRestClient.Initialize(config);
        //    ZohoOAuthClient client = ZohoOAuthClient.GetInstance();
        //    string refreshToken = "1000.354c162c19b5da4fc4053bc4e38dd27f.1e548f961cc913acbacd82fbad0a3387";
        //    string userMailId = "*****@*****.**";
        //    ZohoOAuthTokens tokens = client.GenerateAccessTokenFromRefreshToken(refreshToken, userMailId);
        //    List<ZCRMRecord> records = new List<ZCRMRecord>();
        //    ZCRMRecord record1 = new ZCRMRecord("accounts"); //module api name

        //    record1.SetFieldValue("Account_Name", investor.UserName);
        //    record1.SetFieldValue("Email", investor.UserName);
        //    record1.SetFieldValue("Username", investor.UserName);
        //    record1.SetFieldValue("Industry", "1");
        //    record1.SetFieldValue("Status", "1");
        //    record1.SetFieldValue("Phone", investor.MobileNumber);
        //    record1.SetFieldValue("Fax", investor.MobileNumber);
        //    record1.SetFieldValue("Employees", 1);
        //    record1.SetFieldValue("Age", investor.Age);
        //    record1.SetFieldValue("Gender", investor.Gender);
        //    record1.SetFieldValue("NRIC_Number", investor.NRIC_Number);
        //    record1.SetFieldValue("Passport_Number", investor.PassportNumber);
        //    record1.SetFieldValue("Date_Of_Birth", investor.DateOfBirth.Value);
        //    record1.SetFieldValue("Sign_Up_Date", investor.DateCreated.Value.Date.ToString());
        //    record1.SetFieldValue("Total_Invested", investor.TotalInvestedAmount);
        //    record1.SetFieldValue("Admin_Verification", investor.AdminVerification);
        //    record1.SetFieldValue("Number_Of_Delinquent_Off_Note", investor.numofdelinquent);
        //    record1.SetFieldValue("Number_Of_Fully_Paid_Note", investor.NumberOfFullyPaidNotes);
        //    record1.SetFieldValue("Number_of_Close_Off_Note", investor.NumOfCloseOff);
        //    record1.SetFieldValue("Qualified_Date", investor.QualifiedDate.Value.Date.ToString());
        //    if (investor.LastLogin == null)
        //    {
        //        investor.LastLogin = investor.DateCreated;
        //    }
        //    record1.SetFieldValue("Last_Login", investor.LastLogin.Value.Date.ToString());
        //    record1.SetFieldValue("Number_Of_Deliquent_Note", investor.numofdelinquent);
        //    record1.SetFieldValue("Sum_of_Number_Invested_Note", investor.NumberOfInvested);
        //    record1.SetFieldValue("Current_in_Funding_Amount", investor.CurrentInFunding);
        //    record1.SetFieldValue("Sum_of_Ledge_Amount", investor.ActualAmount);
        //    record1.SetFieldValue("Total_Amount_Received", investor.TotalAmountReceived);
        //    record1.SetFieldValue("Total_Delinquent_Amount", investor.outstandingPI);
        //    record1.SetFieldValue("Outstanding_L", investor.outstanding_I);
        //    record1.SetFieldValue("Outstanding_P", investor.outstanding_P);
        //    record1.SetFieldValue("Principal_Received", investor.PaidP);
        //    record1.SetFieldValue("Interest_Received", investor.PaidI);
        //    record1.CreatedTime = DateTime.UtcNow.Ticks.ToString();
        //    records.Add(record1);


        //    ZCRMModule moduleIns = ZCRMModule.GetInstance("accounts"); //module api name
        //    BulkAPIResponse<ZCRMRecord> response = moduleIns.CreateRecords(records); //records - list of ZCRMRecord instances filled with required data for upsert.
        //    List<ZCRMRecord> insertedRecords = response.BulkData; //upsertedRecords - list of ZCRMRecord instance
        //    foreach (var entityID in response.BulkData)
        //    {
        //        var newID = new tbl_CheckID
        //        {
        //            IDZoho = entityID.EntityId,
        //            EmailMS = investor.UserName
        //        };
        //        dbzoho.tbl_CheckID.Add(newID);
        //        dbzoho.SaveChanges();
        //    }

        //    List<EntityResponse> entityResponses = response.BulkEntitiesResponse; //entityResponses - list of EntityResponses instance
        //    return response;
        //}
        public void UpdateIssuer(IssuerModel issuer)
        {
            var id = dbzoho.tbl_CheckID.FirstOrDefault(p => p.EmailMS == issuer.UserName);

            ZCRMRestClient.Initialize(config);
            ZohoOAuthClient   client       = ZohoOAuthClient.GetInstance();
            string            refreshToken = "1000.354c162c19b5da4fc4053bc4e38dd27f.1e548f961cc913acbacd82fbad0a3387";
            string            userMailId   = "*****@*****.**";
            ZohoOAuthTokens   tokens       = client.GenerateAccessTokenFromRefreshToken(refreshToken, userMailId);
            List <ZCRMRecord> records      = new List <ZCRMRecord>();
            ZCRMRecord        record1      = new ZCRMRecord("accounts"); //module api name

            record1.EntityId = id.IDZoho;
            record1.SetFieldValue("id", id.IDZoho);
            record1.SetFieldValue("Account_Name", issuer.UserName);
            record1.SetFieldValue("Full_Name", issuer.FullName);
            record1.SetFieldValue("Username", issuer.UserName);
            record1.SetFieldValue("Industry", "1");
            record1.SetFieldValue("Company_Name", issuer.BusinessName.ToString());
            record1.SetFieldValue("Phone", issuer.MobileNumber);
            record1.SetFieldValue("Fax", issuer.MobileNumber);
            record1.SetFieldValue("Employees", 1);
            record1.SetFieldValue("Total_Amount_Disbursed", issuer.totaldisbursed);
            record1.SetFieldValue("Last_Repayment_Date", issuer.LastRepaymentDate.Value.ToString());
            record1.SetFieldValue("Days_Overdue", issuer.daysoverdue);
            record1.SetFieldValue("Issuer_Account_Balance", issuer.ActualAmount);
            record1.SetFieldValue("Outstanding_Amount_with_Late_Fee", issuer.outamountwithlf);
            record1.SetFieldValue("Outstanding_Amount_no_Late_Fee", issuer.outamountwithoutlf);
            record1.SetFieldValue("Outstanding_Late_Fee", issuer.outstandinglf);
            record1.SetFieldValue("Total_Amount_Overdue", issuer.overdueamount);
            record1.SetFieldValue("Total_Principle_Paid", issuer.totalpaidprincipal);
            record1.SetFieldValue("Total_Interest_Paid", issuer.totalpaidinterest);
            record1.SetFieldValue("Total_Late_Fee_Paid", issuer.paidlatefees);
            record1.SetFieldValue("Total_Late_Interest_Paid", issuer.totalpaidlateinterest);
            record1.SetFieldValue("Total_Paid_Amount", issuer.TotalPaidAmount);
            records.Add(record1);


            ZCRMModule moduleIns = ZCRMModule.GetInstance("accounts");                   //module api name
            BulkAPIResponse <ZCRMRecord> responseIns = moduleIns.UpdateRecords(records); //To call the Update record method

            Console.WriteLine("HTTP Status Code:" + responseIns.HttpStatusCode);         //To get Update record http response code
            foreach (EntityResponse response in responseIns.BulkEntitiesResponse)
            {
                Console.WriteLine("Status:" + response.Status);        //To get Update record response status
                Console.WriteLine("Message:" + response.Message);      //To get Update record response message
                Console.WriteLine("Details:" + response.ResponseJSON); //To get Update record response details
                ZCRMRecord record11 = (ZCRMRecord)response.Data;
                Console.WriteLine(record11.EntityId);                  //To get inserted record id
                Console.WriteLine(record11.CreatedTime);
                Console.WriteLine(record11.ModifiedTime);
                ZCRMUser CreatedBy = record11.CreatedBy;
                if (CreatedBy != null)
                {
                    Console.WriteLine(CreatedBy.Id);
                    Console.WriteLine(CreatedBy.FullName);
                }
                ZCRMUser ModifiedBy = record1.ModifiedBy;
                if (ModifiedBy != null)
                {
                    Console.WriteLine(ModifiedBy.Id);
                    Console.WriteLine(ModifiedBy.FullName);
                }
            }
        }
Exemplo n.º 2
0
        public void UpdateInvestor(InvestorModel investor)
        {
            var id = dbzoho.tbl_CheckID.FirstOrDefault(p => p.EmailMS == investor.UserName);

            ZCRMRestClient.Initialize(config);
            ZohoOAuthClient   client       = ZohoOAuthClient.GetInstance();
            string            refreshToken = "1000.354c162c19b5da4fc4053bc4e38dd27f.1e548f961cc913acbacd82fbad0a3387";
            string            userMailId   = "*****@*****.**";
            ZohoOAuthTokens   tokens       = client.GenerateAccessTokenFromRefreshToken(refreshToken, userMailId);
            List <ZCRMRecord> records      = new List <ZCRMRecord>();
            ZCRMRecord        record1      = new ZCRMRecord("accounts"); //module api name

            record1.EntityId = id.IDZoho;
            record1.SetFieldValue("id", id.IDZoho);
            record1.SetFieldValue("Account_Name", investor.UserName);
            record1.SetFieldValue("Email", investor.UserName);
            record1.SetFieldValue("Username", investor.UserName);
            record1.SetFieldValue("Industry", "1");
            record1.SetFieldValue("Status", "1");
            record1.SetFieldValue("Phone", investor.MobileNumber);
            record1.SetFieldValue("Fax", investor.MobileNumber);
            record1.SetFieldValue("Employees", 1);
            record1.SetFieldValue("Age", investor.Age);
            record1.SetFieldValue("Gender", investor.Gender);
            record1.SetFieldValue("NRIC_Number", investor.NRIC_Number);
            record1.SetFieldValue("Passport_Number", investor.PassportNumber);
            record1.SetFieldValue("Date_Of_Birth", investor.DateOfBirth.Value);
            record1.SetFieldValue("Sign_Up_Date", investor.DateCreated.Value.Date.ToString());
            record1.SetFieldValue("Total_Invested", investor.TotalInvestedAmount);
            record1.SetFieldValue("Admin_Verification", investor.AdminVerification);
            record1.SetFieldValue("Number_Of_Delinquent_Off_Note", investor.numofdelinquent);
            record1.SetFieldValue("Number_Of_Fully_Paid_Note", investor.NumberOfFullyPaidNotes);
            record1.SetFieldValue("Number_of_Close_Off_Note", investor.NumOfCloseOff);
            record1.SetFieldValue("Qualified_Date", investor.QualifiedDate.Value.Date.ToString());
            if (investor.LastLogin == null)
            {
                investor.LastLogin = investor.DateCreated;
            }
            record1.SetFieldValue("Number_Of_Deliquent_Note", investor.numofdelinquent);
            record1.SetFieldValue("Last_Login", investor.LastLogin.Value.Date.ToString());
            record1.SetFieldValue("Sum_of_Number_Invested_Note", investor.NumberOfInvested);
            record1.SetFieldValue("Current_in_Funding_Amount", investor.CurrentInFunding);
            record1.SetFieldValue("Sum_of_Ledge_Amount", investor.ActualAmount);
            record1.SetFieldValue("Total_Amount_Received", investor.TotalAmountReceived);
            record1.SetFieldValue("Total_Delinquent_Amount", investor.outstandingPI);
            record1.SetFieldValue("Outstanding_L", investor.outstanding_I);
            record1.SetFieldValue("Outstanding_P", investor.outstanding_P);
            record1.SetFieldValue("Principal_Received", investor.PaidP);
            record1.SetFieldValue("Interest_Received", investor.PaidI);
            records.Add(record1);


            ZCRMModule moduleIns = ZCRMModule.GetInstance("accounts");                   //module api name
            BulkAPIResponse <ZCRMRecord> responseIns = moduleIns.UpdateRecords(records); //To call the Update record method

            Console.WriteLine("HTTP Status Code:" + responseIns.HttpStatusCode);         //To get Update record http response code
            foreach (EntityResponse response in responseIns.BulkEntitiesResponse)
            {
                Console.WriteLine("Status:" + response.Status);        //To get Update record response status
                Console.WriteLine("Message:" + response.Message);      //To get Update record response message
                Console.WriteLine("Details:" + response.ResponseJSON); //To get Update record response details
                ZCRMRecord record11 = (ZCRMRecord)response.Data;
                Console.WriteLine(record11.EntityId);                  //To get inserted record id
                Console.WriteLine(record11.CreatedTime);
                Console.WriteLine(record11.ModifiedTime);
                ZCRMUser CreatedBy = record11.CreatedBy;
                if (CreatedBy != null)
                {
                    Console.WriteLine(CreatedBy.Id);
                    Console.WriteLine(CreatedBy.FullName);
                }
                ZCRMUser ModifiedBy = record1.ModifiedBy;
                if (ModifiedBy != null)
                {
                    Console.WriteLine(ModifiedBy.Id);
                    Console.WriteLine(ModifiedBy.FullName);
                }
            }
        }
Exemplo n.º 3
0
        private ZCRMRecord InsertZohoLeadOffer(ZohoLead lead)
        {
            try
            {
                ZCRMRecord record = ZCRMRecord.GetInstance("Leads", null); //To get ZCRMRecord instance

                if (lead.Offers.Count > 0)
                {
                    Offer leadOffer = lead.Offers.First();
                    record.SetFieldValue("Offer_Amount1", leadOffer.OfferAmount);
                    record.SetFieldValue("Offer_Expiration", new DateTime(leadOffer.OfferExpirationDate.Year, leadOffer.OfferExpirationDate.Month, leadOffer.OfferExpirationDate.Day, leadOffer.OfferExpirationDate.Hour, leadOffer.OfferExpirationDate.Minute, leadOffer.OfferExpirationDate.Second));
                }

                //lead.StockNumber = "2168";
                if (!String.IsNullOrEmpty(lead.StockNumber))
                {
                    record.SetFieldValue("Stock_Number", lead.StockNumber);

                    ZCRMModule module = ZCRMModule.GetInstance("Contacts");
                    BulkAPIResponse <ZCRMRecord> response = module.SearchByCriteria("(Cust_ID:equals:" + lead.StockNumber + ")");
                    List <ZCRMRecord>            contacts = response.BulkData;

                    if (contacts != null)
                    {
                        if (contacts.Count > 0)
                        {
                            JObject customerId = new JObject()
                            {
                                { "id", contacts.First().EntityId }
                            };
                            record.SetFieldValue("Stock_Nbr", customerId);
                        }
                    }
                }

                if (lead.PageViews != null)
                {
                    record.SetFieldValue("Page_Views", lead.PageViews);
                }

                if (lead.Watchers != null)
                {
                    record.SetFieldValue("Current_Watchers", lead.Watchers.ToString());
                }

                if (!String.IsNullOrEmpty(lead.VehicleYear))
                {
                    record.SetFieldValue("Year_of_Unit", lead.VehicleYear);
                }

                if (!String.IsNullOrEmpty(lead.PhoneNumber))
                {
                    record.SetFieldValue("Phone_Number", lead.PhoneNumber);
                }
                if (!String.IsNullOrEmpty(lead.VehicleMake))
                {
                    record.SetFieldValue("Year_Make_Model", lead.VehicleMake + " " + lead.VehicleModel);
                    record.SetFieldValue("Year_Make_Model1", lead.VehicleMake + " " + lead.VehicleModel);
                }

                record.SetFieldValue("Item_Number", lead.EbayItemId);

                if (!String.IsNullOrEmpty(lead.City))
                {
                    record.SetFieldValue("Bidders_City", lead.City);
                }
                if (!String.IsNullOrEmpty(lead.State))
                {
                    record.SetFieldValue("Bidders_State", lead.State);
                }
                record.SetFieldValue("Last_Name", lead.LastName);
                record.SetFieldValue("Name1", lead.FullName);
                record.SetFieldValue("Email_provided", lead.Email);

                record.SetFieldValue("Ebay_User_ID", lead.UserId);

                JObject layout = new JObject()
                {
                    { "id", 4212012000003357243 }
                };
                //string layout = "{\"name\", \"Ebay Offer\",\"id\", \4212012000003357243\"}";

                record.SetFieldValue("Layout", layout);

                return(record);
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.Message);
                throw ex;
            }
        }
Exemplo n.º 4
0
        private ZCRMRecord InsertZohoLeadMessage(ZohoLead lead)
        {
            try
            {
                ZCRMRecord record = ZCRMRecord.GetInstance("Leads", null); //To get ZCRMRecord instance

                //lead.StockNumber = "2168";
                if (!String.IsNullOrEmpty(lead.StockNumber))
                {
                    record.SetFieldValue("Stock_Number", lead.StockNumber);

                    ZCRMModule module = ZCRMModule.GetInstance("Contacts");
                    BulkAPIResponse <ZCRMRecord> response = module.SearchByCriteria("(Cust_ID:equals:" + lead.StockNumber + ")");
                    List <ZCRMRecord>            contacts = response.BulkData;

                    if (contacts != null)
                    {
                        if (contacts.Count > 0)
                        {
                            JObject customerId = new JObject()
                            {
                                { "id", contacts.First().EntityId }
                            };
                            record.SetFieldValue("Stock_Nbr", customerId);
                        }
                    }
                }

                if (lead.PageViews != null)
                {
                    record.SetFieldValue("Page_Views", lead.PageViews);
                }

                if (!String.IsNullOrEmpty(lead.StockNumber))
                {
                    record.SetFieldValue("Registered_Watchers", lead.Watchers);
                }

                if (!String.IsNullOrEmpty(lead.MemberMessage))
                {
                    record.SetFieldValue("Description", lead.MemberMessage);
                }

                if (!String.IsNullOrEmpty(lead.VehicleYear))
                {
                    record.SetFieldValue("Year_of_Unit", lead.VehicleYear);
                }

                if (!String.IsNullOrEmpty(lead.PhoneNumber))
                {
                    record.SetFieldValue("Phone_Number", lead.PhoneNumber);
                }

                if (!String.IsNullOrEmpty(lead.VehicleMake))
                {
                    record.SetFieldValue("Year_Make_Model", lead.VehicleMake + " " + lead.VehicleModel);
                    record.SetFieldValue("Year_Make_Model1", lead.VehicleMake + " " + lead.VehicleModel);
                }

                if (!String.IsNullOrEmpty(lead.EbayItemId))
                {
                    record.SetFieldValue("Item_Number", lead.EbayItemId);
                }

                if (!String.IsNullOrEmpty(lead.City))
                {
                    record.SetFieldValue("Bidders_City", lead.City);
                }

                if (!String.IsNullOrEmpty(lead.State))
                {
                    record.SetFieldValue("Bidders_State", lead.State);
                }

                record.SetFieldValue("Last_Name", lead.LastName);
                record.SetFieldValue("First_Name", lead.FirstName);
                record.SetFieldValue("Name1", lead.FullName);
                record.SetFieldValue("Name2", lead.FullName);
                record.SetFieldValue("Email", lead.Email);
                record.SetFieldValue("Email_provided", lead.Email);
                record.SetFieldValue("Ebay_User_ID", lead.UserId);

                JObject layout = new JObject()
                {
                    { "id", 4212012000003357573 }
                };

                record.SetFieldValue("Layout", layout);

                return(record);
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.Message);
                throw ex;
            }
        }
Exemplo n.º 5
0
        public BulkAPIResponse <ZCRMRecord> CreateRecords(List <ZCRMRecord> records, List <string> trigger, string lar_id)
        {
            try
            {
                if (records.Count > 100)
                {
                    throw new ZCRMException(APIConstants.API_MAX_RECORDS_MSG);
                }

                requestMethod = APIConstants.RequestMethod.POST;

                urlPath = module.ApiName;

                JObject requestBodyObject = new JObject();

                JArray dataArray = new JArray();

                foreach (ZCRMRecord record in records)
                {
                    if (record.EntityId == null)
                    {
                        dataArray.Add(EntityAPIHandler.GetInstance(record).GetZCRMRecordAsJSON());
                    }
                    else
                    {
                        throw new ZCRMException("Entity ID Must be null/empty for CreateRecords operation.");
                    }
                }

                requestBodyObject.Add(APIConstants.DATA, dataArray);

                if (trigger != null && trigger.Count > 0)
                {
                    requestBodyObject.Add("trigger", JArray.FromObject(trigger));
                }

                if (lar_id != null)
                {
                    requestBodyObject.Add("lar_id", lar_id);
                }

                requestBody = requestBodyObject;

                BulkAPIResponse <ZCRMRecord> response = APIRequest.GetInstance(this).GetBulkAPIResponse <ZCRMRecord>();

                List <ZCRMRecord> createdRecords = new List <ZCRMRecord>();

                List <EntityResponse> responses = response.BulkEntitiesResponse;

                int responseSize = responses.Count;

                for (int i = 0; i < responseSize; i++)
                {
                    EntityResponse entityResponse = responses[i];

                    if (entityResponse.Status.Equals(APIConstants.CODE_SUCCESS))
                    {
                        JObject responseData = entityResponse.ResponseJSON;

                        JObject recordDetails = (JObject)responseData[APIConstants.DETAILS];

                        ZCRMRecord newRecord = records[i];

                        EntityAPIHandler.GetInstance(newRecord).SetRecordProperties(recordDetails);

                        createdRecords.Add(newRecord);

                        entityResponse.Data = newRecord;
                    }
                    else
                    {
                        entityResponse.Data = null;
                    }
                }

                response.BulkData = createdRecords;

                return(response);
            }
            catch (Exception e) when(!(e is ZCRMException))
            {
                ZCRMLogger.LogError(e);

                throw new ZCRMException(APIConstants.SDK_ERROR, e);
            }
        }
Exemplo n.º 6
0
        public BulkAPIResponse <ZCRMRecord> GetRecords(long?cvId, string sortByField, CommonUtil.SortOrder?sortOrder, int page, int perPage, string modifiedSince, string isConverted, string isApproved, List <string> fields)
        {
            try
            {
                requestMethod = APIConstants.RequestMethod.GET;

                urlPath = module.ApiName;

                if (cvId != null)
                {
                    requestQueryParams.Add("cvid", cvId.ToString());
                }

                if (sortByField != null)
                {
                    requestQueryParams.Add("sort_by", sortByField);
                }

                if (sortOrder != null)
                {
                    requestQueryParams.Add("sort_order", sortOrder.ToString());
                }

                requestQueryParams.Add(APIConstants.PAGE, page.ToString());

                requestQueryParams.Add(APIConstants.PER_PAGE, perPage.ToString());

                if (isApproved != null && isApproved != "")
                {
                    requestQueryParams.Add("approved", isApproved);
                }

                if (isConverted != null && isConverted != "")
                {
                    requestQueryParams.Add("converted", isConverted);
                }

                if (fields != null)
                {
                    requestQueryParams.Add("fields", CommonUtil.CollectionToCommaDelimitedString(fields));
                }

                if (modifiedSince != null && modifiedSince != "")
                {
                    requestHeaders.Add("If-Modified-Since", modifiedSince);
                }

                BulkAPIResponse <ZCRMRecord> response = APIRequest.GetInstance(this).GetBulkAPIResponse <ZCRMRecord>();

                List <ZCRMRecord> records = new List <ZCRMRecord>();

                JObject responseJSON = response.ResponseJSON;

                if (responseJSON.ContainsKey(APIConstants.DATA))
                {
                    JArray recordsArray = (JArray)responseJSON[APIConstants.DATA];

                    foreach (JObject recordDetails in recordsArray)
                    {
                        ZCRMRecord record = ZCRMRecord.GetInstance(module.ApiName, Convert.ToInt64(recordDetails["id"]));

                        EntityAPIHandler.GetInstance(record).SetRecordProperties(recordDetails);

                        records.Add(record);
                    }
                }

                response.BulkData = records;

                return(response);
            }
            catch (Exception e) when(!(e is ZCRMException))
            {
                ZCRMLogger.LogError(e);

                throw new ZCRMException(APIConstants.SDK_ERROR, e);
            }
        }
Exemplo n.º 7
0
        public BulkAPIResponse <ZCRMRecord> MassUpdateRecords(List <long> entityIds, string fieldAPIName, Object value)
        {
            try
            {
                if (entityIds.Count > 100)
                {
                    throw new ZCRMException(APIConstants.API_MAX_RECORDS_MSG);
                }

                //NOTE: null value is not converted to JObject of type null;
                requestMethod = APIConstants.RequestMethod.PUT;

                urlPath = module.ApiName;

                JObject requestBodyObject = new JObject();

                JArray dataArray = new JArray();

                foreach (long id in entityIds)
                {
                    JObject updateJSON = new JObject
                    {
                        { fieldAPIName, JToken.FromObject(EntityAPIHandler.GetInstance(new ZCRMRecord(module.ApiName)).ObjectToJSONData(value)) },
                        { "id", Convert.ToString(id) }
                    };

                    dataArray.Add(updateJSON);
                }

                requestBodyObject.Add(APIConstants.DATA, dataArray);

                requestBody = requestBodyObject;

                BulkAPIResponse <ZCRMRecord> response = APIRequest.GetInstance(this).GetBulkAPIResponse <ZCRMRecord>();

                List <ZCRMRecord> updatedRecords = new List <ZCRMRecord>();

                List <EntityResponse> responses = response.BulkEntitiesResponse;

                foreach (EntityResponse entityResponse in responses)
                {
                    if (entityResponse.Status.Equals(APIConstants.CODE_SUCCESS))
                    {
                        JObject responseData = entityResponse.ResponseJSON;

                        JObject recordDetails = (JObject)responseData[APIConstants.DETAILS];

                        ZCRMRecord updatedRecord = ZCRMRecord.GetInstance(module.ApiName, Convert.ToInt64(recordDetails["id"]));

                        EntityAPIHandler.GetInstance(updatedRecord).SetRecordProperties(recordDetails);

                        updatedRecords.Add(updatedRecord);

                        entityResponse.Data = updatedRecord;
                    }
                    else
                    {
                        entityResponse.Data = null;
                    }
                }

                response.BulkData = updatedRecords;

                return(response);
            }
            catch (Exception e) when(!(e is ZCRMException))
            {
                ZCRMLogger.LogError(e);

                throw new ZCRMException(APIConstants.SDK_ERROR, e);
            }
        }