func (c *API) DeleteRecords(module Module, ids []string) (data DeleteRecordsResponse, err error) {
	if len(ids) == 0 {
		return DeleteRecordsResponse{}, fmt.Errorf("Failed to delete records, must provide at least 1 ID")
	}
	endpoint := zoho.Endpoint{
		Name:         "records",
		URL:          fmt.Sprintf("https://www.zohoapis.%s/crm/v2/%s", c.ZohoTLD, module),
		Method:       zoho.HTTPDelete,
		ResponseData: &DeleteRecordsResponse{},
		URLParameters: map[string]zoho.Parameter{
			"ids": func() zoho.Parameter {
				idStr := ""
				for i, a := range ids {
					idStr += a
					if i < len(ids)-1 {
						idStr += ","
					}
				}
				return zoho.Parameter(idStr)
			}(),
		},
	}
	err = c.Zoho.HTTPRequest(&endpoint)
	if err != nil {
		return DeleteRecordsResponse{}, fmt.Errorf("Failed to insert records of %s: %s", module, err)
	}
	if v, ok := endpoint.ResponseData.(*DeleteRecordsResponse); ok {
		return *v, nil
	}
	return DeleteRecordsResponse{}, fmt.Errorf("Data returned was nil")
}
DeleteRecords will delete the records in the ids in the specified module
https://www.zoho.com/crm/help/api/v2/#delete-bulk-records
package crm
import (
	"fmt"
	zoho "github.com/schmorrison/Zoho"
	"time"
)
func (c *API) ListRecords(request interface{}, module Module, params map[string]zoho.Parameter) (data interface{}, err error) {
	endpoint := zoho.Endpoint{
		Name:         "records",
		URL:          fmt.Sprintf("https://www.zohoapis.%s/crm/v2/%s", c.ZohoTLD, module),
		Method:       zoho.HTTPGet,
		ResponseData: request,
		URLParameters: map[string]zoho.Parameter{
			"fields":     "",
			"sort_order": "",
			"sort_by":    "",
			"converted":  "",
			"approved":   "",
			"page":       "",
			"per_page":   "200",
			"cvid":       "",
		},
	}
	for k, v := range params {
		endpoint.URLParameters[k] = v
	}
	err = c.Zoho.HTTPRequest(&endpoint)
	if err != nil {
		return nil, fmt.Errorf("Failed to retrieve records of %s: %s", module, err)
	}
	if endpoint.ResponseData != nil {
		return endpoint.ResponseData, nil
	}
	return nil, fmt.Errorf("Data returned was nil")
}
func (c *API) InsertRecords(request InsertRecordsData, module Module) (data InsertRecordsResponse, err error) {
	endpoint := zoho.Endpoint{
		Name:         "records",
		URL:          fmt.Sprintf("https://www.zohoapis.%s/crm/v2/%s", c.ZohoTLD, module),
		Method:       zoho.HTTPPost,
		ResponseData: &InsertRecordsResponse{},
		RequestBody:  request,
	}
	err = c.Zoho.HTTPRequest(&endpoint)
	if err != nil {
		return InsertRecordsResponse{}, fmt.Errorf("Failed to insert records of %s: %s", module, err)
	}
	if v, ok := endpoint.ResponseData.(*InsertRecordsResponse); ok {
		return *v, nil
	}
	return InsertRecordsResponse{}, fmt.Errorf("Data returned was nil")
}
type UpdateRecordsResponseData struct {
	Message string `json:"message,omitempty"`
	Details struct {
		ExpectedDataType string `json:"expected_data_type,omitempty"`
		APIName          string `json:"api_name"`
	} `json:"details,omitempty"`
	Status string `json:"status,omitempty"`
	Code   string `json:"code,omitempty"`
}
type InsertRecordsData struct {
	Data    interface{} `json:"data,omitempty"`
	Trigger []string    `json:"trigger,omitempty"`
}
type InsertRecordsResponseData struct {
	Message string `json:"message,omitempty"`
	Details struct {
		CreatedBy struct {
			ID   string `json:"id,omitempty"`
			Name string `json:"name,omitempty"`
		} `json:"created_by,omitempty"`
		ID         string `json:"id,omitempty"`
		ModifiedBy struct {
			ID   string `json:"id,omitempty"`
			Name string `json:"name,omitempty"`
		} `json:"modified_by,omitempty"`
		ModifiedTime time.Time `json:"modified_time,omitempty"`
		CreatedTime  time.Time `json:"created_time,omitempty"`
	} `json:"details,omitempty"`
	Status string `json:"status,omitempty"`
	Code   string `json:"code,omitempty"`
}
type InsertRecordsResponse struct {
	Data []InsertRecordsResponseData `json:"data,omitempty"`
}
func (c *API) UpdateRecords(request UpdateRecordsData, module Module) (data UpdateRecordsResponse, err error) {
	endpoint := zoho.Endpoint{
		Name:         "records",
		URL:          fmt.Sprintf("https://www.zohoapis.%s/crm/v2/%s", c.ZohoTLD, module),
		Method:       zoho.HTTPPut,
		ResponseData: &UpdateRecordsResponse{},
		RequestBody:  request,
	}
	err = c.Zoho.HTTPRequest(&endpoint)
	if err != nil {
		return UpdateRecordsResponse{}, fmt.Errorf("Failed to insert records of %s: %s", module, err)
	}
	if v, ok := endpoint.ResponseData.(*UpdateRecordsResponse); ok {
		return *v, nil
	}
	return UpdateRecordsResponse{}, fmt.Errorf("Data returned was nil")
}
type UpdateRecordsData = InsertRecordsData
type UpdateRecordsResponse struct {
	Data []UpdateRecordsResponseData `json:"data,omitempty"`
}
func (c *API) UpsertRecords(request UpsertRecordsData, module Module, duplicateFieldsCheck []string) (data UpsertRecordsResponse, err error) {
	endpoint := zoho.Endpoint{
		Name:         "records",
		URL:          fmt.Sprintf("https://www.zohoapis.%s/crm/v2/%s/upsert", c.ZohoTLD, module),
		Method:       zoho.HTTPPost,
		ResponseData: &UpsertRecordsResponse{},
		RequestBody:  request,
		URLParameters: map[string]zoho.Parameter{
			"duplicate_field_check": func() zoho.Parameter {
				if len(duplicateFieldsCheck) > 0 {
					fields := ""
					for i, a := range duplicateFieldsCheck {
						fields += a
						if i < len(duplicateFieldsCheck)-1 {
							fields += ","
						}
					}
					return zoho.Parameter(fields)
				}
				return ""
			}(),
		},
	}
	err = c.Zoho.HTTPRequest(&endpoint)
	if err != nil {
		return UpsertRecordsResponse{}, fmt.Errorf("Failed to insert records of %s: %s", module, err)
	}
	if v, ok := endpoint.ResponseData.(*UpsertRecordsResponse); ok {
		return *v, nil
	}
	return UpsertRecordsResponse{}, fmt.Errorf("Data returned was nil")
}
type UpsertRecordsData struct {
	Data    interface{} `json:"data,omitempty"`
	Trigger []string    `json:"trigger,omitempty"`
}
type UpsertRecordsResponse struct {
	Data []struct {
		Message string `json:"message,omitempty"`
		Details struct {
			CreatedBy struct {
				ID   string `json:"id,omitempty"`
				Name string `json:"name,omitempty"`
			} `json:"created_by,omitempty"`
			ID         string `json:"id,omitempty"`
			ModifiedBy struct {
				ID   string `json:"id,omitempty"`
				Name string `json:"name,omitempty"`
			} `json:"modified_by,omitempty"`
			ModifiedTime time.Time `json:"modified_time,omitempty"`
			CreatedTime  time.Time `json:"created_time,omitempty"`
		} `json:"details,omitempty"`
		Status         string `json:"status,omitempty"`
		DuplicateField string `json:"duplicate_field,omitempty"`
		Action         string `json:"action,omitempty"`
		Code           string `json:"code,omitempty"`
	} `json:"data,omitempty"`
}