|
|
|
@@ -52,12 +52,15 @@ func crmPrepareAttachmentHTTPHeader(fileInfo crmFileInfo) (headers map[string]st |
|
|
|
} |
|
|
|
|
|
|
|
func crmUploadAttachmentURL() string { |
|
|
|
return "https://c.hitxy.org.au/api/v1/Attachment/action/upload" |
|
|
|
|
|
|
|
return CRMConfig.BaseURL + "api/v1/Attachment/action/upload" |
|
|
|
} |
|
|
|
|
|
|
|
func crmAuthHeader() string { |
|
|
|
//return "Basic cGF0cmljazpiNjFmYWRlMTM5OWYwY2ZjNmZjZjcxNTU0OTljNTNkOQ==" |
|
|
|
return "Basic cGF0cmljazp3b3JraGFyZA==" |
|
|
|
s := CRMConfig.UserName + ":" + CRMConfig.UserPass |
|
|
|
r := base64.StdEncoding.EncodeToString([]byte(s)) |
|
|
|
return "Basic " + r |
|
|
|
} |
|
|
|
|
|
|
|
//crmFileDataString, encode a base64 string of the given file |
|
|
|
@@ -93,7 +96,8 @@ func crmUploadAttachmentMeta(fileID string, fileInfo crmFileInfo) (resp string, |
|
|
|
} |
|
|
|
|
|
|
|
func crmAttachmentMetaURL(fileID string) string { |
|
|
|
return "https://c.hitxy.org.au/api/v1/Attachment/" + fileID |
|
|
|
//return "https://c.hitxy.org.au/api/v1/Attachment/" + fileID |
|
|
|
return CRMConfig.BaseURL + "api/v1/Attachment/" + fileID |
|
|
|
} |
|
|
|
|
|
|
|
type attachmentInfo struct { |