Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

使用Conversation\Client时无法发送钉钉消息 #40

Closed
wishxupanpan opened this issue May 23, 2019 · 2 comments
Closed

使用Conversation\Client时无法发送钉钉消息 #40

wishxupanpan opened this issue May 23, 2019 · 2 comments

Comments

@wishxupanpan
Copy link

`
$params = [
'agent_id'=> 'xxxxx',
'userid_list' => 'xxxxxx',
'msg'=> json_encode(['msgtype'=> "text", 'text'=>['content'=> '测试 ']])
];

$res = $app->conversation->sendCorporationMessage($params);
print_r($res);
`
得到的结果:
array:3 [
"errcode" => 41
"errmsg" => "Invalid arguments:msg"
"request_id" => "skkfp0mdzlns"
]

image

将其中的postJson改为post即可

@mingyoung
Copy link
Owner

已修复,升级到 2.0.5+ 即可

@smartymoon
Copy link

这里有点奇怪,我认为应该用 postJson, @wishxupanpan 用的示例是
'msg'=> json_encode(['msgtype'=> "text", 'text'=>['content'=> '测试 ']])
如果取消掉 json_encode ,直接用 'msg'=>['msgtype'=> "text", 'text'=>['content'=> '测试 ']] 是可用的,
这里加 json_encode 是不合理的

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants