| func (c EspoCRMAPIConfig) apiLeadURL() string { | func (c EspoCRMAPIConfig) apiLeadURL() string { | ||||
| return c.apiURL("Lead") | return c.apiURL("Lead") | ||||
| } | } | ||||
| func (c EspoCRMAPIConfig) apiAuthURL() string { | |||||
| return c.apiURL("App/user") | |||||
| } | |||||
| func (c EspoCRMAPIConfig) apiUploadAttachmentURL() string { | |||||
| return c.apiURL("Attachment/action/upload") | |||||
| } |
| } | } | ||||
| func crmUploadAttachmentURL() string { | func crmUploadAttachmentURL() string { | ||||
| return CRMConfig.BaseURL + "api/v1/Attachment/action/upload" | |||||
| return CRMConfig.apiUploadAttachmentURL() | |||||
| } | } | ||||
| func crmAuthHeader() string { | func crmAuthHeader() string { | ||||
| } | } | ||||
| func crmAttachmentMetaURL(fileID string) string { | func crmAttachmentMetaURL(fileID string) string { | ||||
| //return "https://c.hitxy.org.au/api/v1/Attachment/" + fileID | |||||
| return CRMConfig.BaseURL + "api/v1/Attachment/" + fileID | |||||
| return CRMConfig.apiEntityURL("Attachment", fileID) | |||||
| } | } | ||||
| type attachmentInfo struct { | type attachmentInfo struct { |
| func crmSearchEntity(entityType string, filters []crmdSearchFilter) (result crmdSearchResult, err error) { | func crmSearchEntity(entityType string, filters []crmdSearchFilter) (result crmdSearchResult, err error) { | ||||
| url := CRMConfig.BaseURL + "api/v1/" + entityType | |||||
| url := CRMConfig.apiURL(entityType) | |||||
| req, err := http.NewRequest("GET", url, nil) | req, err := http.NewRequest("GET", url, nil) | ||||
| if err != nil { | if err != nil { | ||||
| log.Println("crmGetRecord: cannot form good http Request") | log.Println("crmGetRecord: cannot form good http Request") |