错误码说明
大约 2 分钟
错误码说明
状态码 | 异常信息 | 说明 |
---|---|---|
501 | appSecret error | 不存在 appSecret |
502 | timestamp timeout | 请求时间戳超时 |
503 | name is empty | 任务名称为空 |
504 | executor error | 执行人解析异常 |
505 | executor is empty | 执行人为空 |
506 | data is empty | 添加任务 data 信息为空 |
507 | data size big | data 大小过大 |
508 | no exist userName | 存在执行人信息不存在 |
509 | customer group is null | 客群信息存在为空 |
510 | customer group key error | 客群 key 信息错误 |
511 | customer group value error | 客群 value 信息错误 |
512 | send type == 1 and startTime is not null | 立即发送指定发送时间 |
513 | start time is error | 发送时间解析异常 |
514 | content is null | 任务发送内容为空 |
515 | file is null | 任务不存在文件信息 |
516 | main userId is null | 主账号信息不存在 |
517 | database error | 数据库异常 |
518 | timestamp is null | 时间戳为空 |
519 | timestamp is error | 时间戳解析异常 |
520 | send interval is null | 不存在发送间隔时间 |
521 | task name repetition | 任务名称存在重复 |
522 | accessToken is error | accessToken 信息错误 |
523 | tenantId is null | 公司 id 为空 |
524 | userName is null | 管理员名称为空 |
525 | token is null | token 为空 |
526 | createTime is null | 创建时间为空 |
527 | group is error | 客群群聊类型解析异常 |
528 | group is null | 客群群信息不存在 |
529 | Non-professional Edition | 非专业版 |
530 | action username error | userName 不存在 |
531 | userName is error | data 中 userName 不存在 |
532 | customer whats id is null | friendWhatsId 客服号不存在 |
533 | extended field format error | 扩展字段格式异常 |
534 | whatsid list null | whatsid 列表为空 |
536 | groupLinkList is null | groupLinkList 列表为空 |
537 | groupLink is not exist . Please reload it ! | groupLink 未发现.请重新导入 |
538 | parsing group link. Please try again later | groupLink 解析中,请稍后再试 |
旧的 token 生成规则
md5(tenantId + userName+ createTime + ApiKey),32 位小写 。
userName 为客户管理员账户,**tenantId、ApiKey 获取方式请联系管理员。
createTime 为接口的请求时间(格式 yyyy-mm-dd HH:mm:ss)
package main
import (
"bytes"
"crypto/md5"
"fmt"
"io/ioutil"
"net/http"
)
func MD5(str string) string {
data := []byte(str)
has := md5.Sum(data)
md5str := fmt.Sprintf("%x", has)
return md5str
}
func main() {
url := "https://www.socialscrm.com/wscrm-bus-api/customer/api/import"
method := "PUT"
tenantId := "1"
userName := "WhatsApp"
apiKey := "QOEAcPj6Tb8XRhwFvYih"
createTime := "2023-06-01 12:12:12"
genToken := MD5(tenantId + userName + createTime + apiKey)
data := "[{\"whatsApp\":\"15266667779\",\"friendName\":\"lee\",\"sex\":\"male\",\"birthday\":\"2020/03/08\",\"address\":\"beijing\",\"email\":\"223@gmail.com\",\"profession\":\"good day\",\"income\":\"100$\",\"desc\":\"\",\"tabName\":\"GoodMan\",\"stage\":\"New Customer\",\"source\":\"System\",\"languageTag\":\"Auto\",\"welcome\":\"hello\"}]"
token := genToken
post := "{\"tenantId\":\"" + tenantId +
"\",\"userName\":\"" + userName +
"\",\"data\":" + data +
",\"token\":\"" + token +
"\",\"createTime\":\"" + createTime +
"\"}"
fmt.Printf("\n\n%s\n\n", post)
var jsonStr = []byte(post)
req, err := http.NewRequest(method, url, bytes.NewBuffer(jsonStr))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
// Response Body: {"code":-1,"message":"Admin Cannot import data","data":""}
fmt.Printf("%s", body)
}