/// <summary>The method to remove territories from record</summary> /// <param name="moduleAPIName">string</param> /// <param name="id">long?</param> /// <param name="request">Instance of BodyWrapper</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> RemoveTerritoriesFromRecord(string moduleAPIName, long?id, BodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, id.ToString()); apiPath = string.Concat(apiPath, "/actions/remove_territories"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.ModuleAPIName = moduleAPIName; Utility.GetFields(moduleAPIName, handlerInstance); return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to delete record using external id</summary> /// <param name="externalFieldValue">string</param> /// <param name="moduleAPIName">string</param> /// <param name="paramInstance">Instance of ParameterMap</param> /// <param name="headerInstance">Instance of HeaderMap</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> DeleteRecordUsingExternalId(string externalFieldValue, string moduleAPIName, ParameterMap paramInstance, HeaderMap headerInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, externalFieldValue.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.CategoryMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.Param = paramInstance; handlerInstance.Header = headerInstance; Utility.GetFields(moduleAPIName, handlerInstance); return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to delete photo</summary> /// <param name="id">long?</param> /// <param name="moduleAPIName">string</param> /// <returns>Instance of APIResponse<FileHandler></returns> public APIResponse <FileHandler> DeletePhoto(long?id, string moduleAPIName) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, id.ToString()); apiPath = string.Concat(apiPath, "/photo"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.CategoryMethod = Constants.REQUEST_METHOD_DELETE; Utility.GetFields(moduleAPIName, handlerInstance); return(handlerInstance.APICall <FileHandler>(typeof(FileHandler), "application/json")); }
/// <summary>The method to send mail</summary> /// <param name="recordId">long?</param> /// <param name="moduleAPIName">string</param> /// <param name="request">Instance of BodyWrapper</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> SendMail(long?recordId, string moduleAPIName, BodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, recordId.ToString()); apiPath = string.Concat(apiPath, "/actions/send_mail"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_CREATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.MandatoryChecker = true; return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to get field attachments</summary> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> GetFieldAttachments() { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.recordId.ToString()); apiPath = string.Concat(apiPath, "/actions/download_fields_attachment"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; handlerInstance.AddParam(new Param <long?>("fields_attachment_id", "com.zoho.crm.api.FieldAttachments.GetFieldAttachmentsParam"), this.fieldsAttachmentId); return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/x-download")); }
/// <summary>The method to add contact role to deal</summary> /// <param name="contactId">long?</param> /// <param name="dealId">long?</param> /// <param name="request">Instance of RecordBodyWrapper</param> /// <returns>Instance of APIResponse<RecordActionHandler></returns> public APIResponse <RecordActionHandler> AddContactRoleToDeal(long?contactId, long?dealId, RecordBodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/Deals/"); apiPath = string.Concat(apiPath, dealId.ToString()); apiPath = string.Concat(apiPath, "/Contact_Roles/"); apiPath = string.Concat(apiPath, contactId.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_PUT; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; return(handlerInstance.APICall <RecordActionHandler>(typeof(RecordActionHandler), "application/json")); }
/// <summary>The method to update blueprint</summary> /// <param name="request">Instance of BodyWrapper</param> /// <returns>Instance of APIResponse<ActionResponse></returns> public APIResponse <ActionResponse> UpdateBlueprint(BodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.recordId.ToString()); apiPath = string.Concat(apiPath, "/actions/blueprint"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_PUT; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.MandatoryChecker = true; return(handlerInstance.APICall <ActionResponse>(typeof(ActionResponse), "application/json")); }
/// <summary>The method to get related records</summary> /// <param name="paramInstance">Instance of ParameterMap</param> /// <param name="headerInstance">Instance of HeaderMap</param> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse<ResponseHandler> GetRelatedRecords(ParameterMap paramInstance, HeaderMap headerInstance) { CommonAPIHandler handlerInstance=new CommonAPIHandler(); string apiPath=""; apiPath=string.Concat(apiPath, "/crm/v2/"); apiPath=string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath=string.Concat(apiPath, "/"); apiPath=string.Concat(apiPath, this.recordId.ToString()); apiPath=string.Concat(apiPath, "/"); apiPath=string.Concat(apiPath, this.relatedListAPIName.ToString()); handlerInstance.APIPath=apiPath; handlerInstance.HttpMethod=Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod=Constants.REQUEST_CATEGORY_READ; handlerInstance.Param=paramInstance; handlerInstance.Header=headerInstance; Utility.GetRelatedLists( this.relatedListAPIName, this.moduleAPIName, handlerInstance); return handlerInstance.APICall<ResponseHandler>(typeof(ResponseHandler), "application/json"); }
/// <summary>The method to search records</summary> /// <param name="moduleAPIName">string</param> /// <param name="paramInstance">Instance of ParameterMap</param> /// <param name="headerInstance">Instance of HeaderMap</param> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> SearchRecords(string moduleAPIName, ParameterMap paramInstance, HeaderMap headerInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/search"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; handlerInstance.Param = paramInstance; handlerInstance.Header = headerInstance; Utility.GetFields(moduleAPIName); handlerInstance.ModuleAPIName = moduleAPIName; return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/json")); }
/// <summary>The method to get attachments</summary> /// <param name="paramInstance">Instance of ParameterMap</param> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> GetAttachments(ParameterMap paramInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.recordId.ToString()); apiPath = string.Concat(apiPath, "/Attachments"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; handlerInstance.Param = paramInstance; return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/json")); }
/// <summary>The method to remove tags from record</summary> /// <param name="recordId">long?</param> /// <param name="moduleAPIName">string</param> /// <param name="paramInstance">Instance of ParameterMap</param> /// <returns>Instance of APIResponse<RecordActionHandler></returns> public APIResponse <RecordActionHandler> RemoveTagsFromRecord(long?recordId, string moduleAPIName, ParameterMap paramInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, recordId.ToString()); apiPath = string.Concat(apiPath, "/actions/remove_tags"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_CREATE; handlerInstance.MandatoryChecker = true; handlerInstance.Param = paramInstance; return(handlerInstance.APICall <RecordActionHandler>(typeof(RecordActionHandler), "application/json")); }
/// <summary>The method to get related records</summary> /// <param name="recordId">long?</param> /// <param name="paramInstance">Instance of ParameterMap</param> /// <param name="headerInstance">Instance of HeaderMap</param> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> GetRelatedRecords(long?recordId, ParameterMap paramInstance, HeaderMap headerInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, recordId.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.relatedListAPIName.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; handlerInstance.AddHeader(new Header <string>("X-EXTERNAL", "com.zoho.crm.api.RelatedRecords.GetRelatedRecordsHeader"), this.xExternal); handlerInstance.Param = paramInstance; handlerInstance.Header = headerInstance; Utility.GetRelatedLists(this.relatedListAPIName, this.moduleAPIName, handlerInstance); return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/json")); }
/// <summary>The method to download attachment</summary> /// <param name="id">long?</param> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> DownloadAttachment(long?id) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.recordId.ToString()); apiPath = string.Concat(apiPath, "/Attachments/"); apiPath = string.Concat(apiPath, id.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/x-download")); }
/// <summary>The method to update record</summary> /// <param name="id">long?</param> /// <param name="moduleAPIName">string</param> /// <param name="request">Instance of BodyWrapper</param> /// <param name="headerInstance">Instance of HeaderMap</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> UpdateRecord(long?id, string moduleAPIName, BodyWrapper request, HeaderMap headerInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, id.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_PUT; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.Header = headerInstance; Utility.GetFields(moduleAPIName); handlerInstance.ModuleAPIName = moduleAPIName; return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to delete record</summary> /// <param name="id">long?</param> /// <param name="moduleAPIName">string</param> /// <param name="paramInstance">Instance of ParameterMap</param> /// <param name="headerInstance">Instance of HeaderMap</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> DeleteRecord(long?id, string moduleAPIName, ParameterMap paramInstance, HeaderMap headerInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, id.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.CategoryMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.Param = paramInstance; handlerInstance.Header = headerInstance; return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to mass update records</summary> /// <param name="moduleAPIName">string</param> /// <param name="request">Instance of MassUpdateBodyWrapper</param> /// <returns>Instance of APIResponse<MassUpdateActionHandler></returns> public APIResponse <MassUpdateActionHandler> MassUpdateRecords(string moduleAPIName, MassUpdateBodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/actions/mass_update"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.MandatoryChecker = true; Utility.GetFields(moduleAPIName); handlerInstance.ModuleAPIName = moduleAPIName; return(handlerInstance.APICall <MassUpdateActionHandler>(typeof(MassUpdateActionHandler), "application/json")); }
/// <summary>The method to upload photo</summary> /// <param name="id">long?</param> /// <param name="moduleAPIName">string</param> /// <param name="request">Instance of FileBodyWrapper</param> /// <returns>Instance of APIResponse<FileHandler></returns> public APIResponse <FileHandler> UploadPhoto(long?id, string moduleAPIName, FileBodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, id.ToString()); apiPath = string.Concat(apiPath, "/photo"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_CREATE; handlerInstance.ContentType = "multipart/form-data"; handlerInstance.Request = request; handlerInstance.MandatoryChecker = true; Utility.VerifyPhotoSupport(moduleAPIName); return(handlerInstance.APICall <FileHandler>(typeof(FileHandler), "application/json")); }
/// <summary>The method to convert lead</summary> /// <param name="id">long?</param> /// <param name="request">Instance of ConvertBodyWrapper</param> /// <returns>Instance of APIResponse<ConvertActionHandler></returns> public APIResponse <ConvertActionHandler> ConvertLead(long?id, ConvertBodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/Leads/"); apiPath = string.Concat(apiPath, id.ToString()); apiPath = string.Concat(apiPath, "/actions/convert"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_CREATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.MandatoryChecker = true; Utility.GetFields("Deals"); return(handlerInstance.APICall <ConvertActionHandler>(typeof(ConvertActionHandler), "application/json")); }
/// <summary>The method to upload attachment</summary> /// <param name="request">Instance of FileBodyWrapper</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> UploadAttachment(FileBodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.recordId.ToString()); apiPath = string.Concat(apiPath, "/Attachments"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_CREATE; handlerInstance.ContentType = "multipart/form-data"; handlerInstance.Request = request; handlerInstance.MandatoryChecker = true; return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to delete related record using external id</summary> /// <param name="externalFieldValue">string</param> /// <param name="externalValue">string</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> DeleteRelatedRecordUsingExternalId(string externalFieldValue, string externalValue) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, externalValue.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.relatedListAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, externalFieldValue.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.CategoryMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.AddHeader(new Header <string>("X-EXTERNAL", "com.zoho.crm.api.RelatedRecords.DeleteRelatedRecordUsingExternalIDHeader"), this.xExternal); Utility.GetRelatedLists(this.relatedListAPIName, this.moduleAPIName, handlerInstance); return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to upload link attachment</summary> /// <param name="paramInstance">Instance of ParameterMap</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> UploadLinkAttachment(ParameterMap paramInstance) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.recordId.ToString()); apiPath = string.Concat(apiPath, "/Attachments"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_CREATE; handlerInstance.MandatoryChecker = true; handlerInstance.Param = paramInstance; return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to update related records</summary> /// <param name="recordId">long?</param> /// <param name="request">Instance of BodyWrapper</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> UpdateRelatedRecords(long?recordId, BodyWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, recordId.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.relatedListAPIName.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_PUT; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_UPDATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.AddHeader(new Header <string>("X-EXTERNAL", "com.zoho.crm.api.RelatedRecords.UpdateRelatedRecordsHeader"), this.xExternal); Utility.GetRelatedLists(this.relatedListAPIName, this.moduleAPIName, handlerInstance); return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to delete attachment</summary> /// <param name="id">long?</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> DeleteAttachment(long?id) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, this.recordId.ToString()); apiPath = string.Concat(apiPath, "/Attachments/"); apiPath = string.Concat(apiPath, id.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_DELETE; handlerInstance.CategoryMethod = Constants.REQUEST_METHOD_DELETE; return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to get photo</summary> /// <param name="id">long?</param> /// <param name="moduleAPIName">string</param> /// <returns>Instance of APIResponse<DownloadHandler></returns> public APIResponse <DownloadHandler> GetPhoto(long?id, string moduleAPIName) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/"); apiPath = string.Concat(apiPath, moduleAPIName.ToString()); apiPath = string.Concat(apiPath, "/"); apiPath = string.Concat(apiPath, id.ToString()); apiPath = string.Concat(apiPath, "/photo"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; Utility.GetFields(moduleAPIName, handlerInstance); return(handlerInstance.APICall <DownloadHandler>(typeof(DownloadHandler), "application/x-download")); }
/// <summary>The method to merge tags</summary> /// <param name="id">long?</param> /// <param name="request">Instance of MergeWrapper</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse <ActionHandler> MergeTags(long?id, MergeWrapper request) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2/settings/tags/"); apiPath = string.Concat(apiPath, id.ToString()); apiPath = string.Concat(apiPath, "/actions/merge"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_POST; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_CREATE; handlerInstance.ContentType = "application/json"; handlerInstance.Request = request; handlerInstance.MandatoryChecker = true; return(handlerInstance.APICall <ActionHandler>(typeof(ActionHandler), "application/json")); }
/// <summary>The method to delink record</summary> /// <param name="relatedRecordId">long?</param> /// <param name="headerInstance">Instance of HeaderMap</param> /// <returns>Instance of APIResponse<ActionHandler></returns> public APIResponse<ActionHandler> DelinkRecord(long? relatedRecordId, HeaderMap headerInstance) { CommonAPIHandler handlerInstance=new CommonAPIHandler(); string apiPath=""; apiPath=string.Concat(apiPath, "/crm/v2/"); apiPath=string.Concat(apiPath, this.moduleAPIName.ToString()); apiPath=string.Concat(apiPath, "/"); apiPath=string.Concat(apiPath, this.recordId.ToString()); apiPath=string.Concat(apiPath, "/"); apiPath=string.Concat(apiPath, this.relatedListAPIName.ToString()); apiPath=string.Concat(apiPath, "/"); apiPath=string.Concat(apiPath, relatedRecordId.ToString()); handlerInstance.APIPath=apiPath; handlerInstance.HttpMethod=Constants.REQUEST_METHOD_DELETE; handlerInstance.CategoryMethod=Constants.REQUEST_METHOD_DELETE; handlerInstance.Header=headerInstance; return handlerInstance.APICall<ActionHandler>(typeof(ActionHandler), "application/json"); }
/// <summary>The method to get contact role of deal</summary> /// <param name="contactId">long?</param> /// <param name="dealId">long?</param> /// <returns>Instance of APIResponse<RecordResponseHandler></returns> public APIResponse <RecordResponseHandler> GetContactRoleOfDeal(long?contactId, long?dealId) { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/Deals/"); apiPath = string.Concat(apiPath, dealId.ToString()); apiPath = string.Concat(apiPath, "/Contact_Roles/"); apiPath = string.Concat(apiPath, contactId.ToString()); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; handlerInstance.ModuleAPIName = "Contacts"; Utility.GetFields("Contacts", handlerInstance); return(handlerInstance.APICall <RecordResponseHandler>(typeof(RecordResponseHandler), "application/json")); }
/// <summary>The method to get email addresses</summary> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> GetEmailAddresses() { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/settings/emails/actions/from_addresses"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/json")); }
/// <summary>The method to get organization</summary> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> GetOrganization() { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/org"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/json")); }
/// <summary>The method to get assignment rules</summary> /// <returns>Instance of APIResponse<ResponseHandler></returns> public APIResponse <ResponseHandler> GetAssignmentRules() { CommonAPIHandler handlerInstance = new CommonAPIHandler(); string apiPath = ""; apiPath = string.Concat(apiPath, "/crm/v2.1/settings/automation/assignment_rules"); handlerInstance.APIPath = apiPath; handlerInstance.HttpMethod = Constants.REQUEST_METHOD_GET; handlerInstance.CategoryMethod = Constants.REQUEST_CATEGORY_READ; return(handlerInstance.APICall <ResponseHandler>(typeof(ResponseHandler), "application/json")); }