用php调用服务端api接口,格式如下:
$query_data = [
'access_token' =>"xxxxxxx",
'touser' => "xxxxxx",
'template_id' => 'DtX8AQY0PJnp21o_oTskbG_Kw8AcSoa7IX2E2OgcEHE',
'page' => 'pages/shop-cart/index',
'data' => [
'number1' => ["value" => "111"],
'number4' => ["value" => "4444"],
'thing10' => ["value" => "aaa"],
'thing7' => ["value" => "bbb"]
]
];
调用返回错误信息
{"errcode":47001,"errmsg":"data format error hint: [5BPxuA04704128]"}
不知道正确的格式怎么写?
json_encode后提示
{"errcode":41001,"errmsg":"access_token missing hints: [jGLFXEPce-mA.q8!]"}
官方是不是应该提供一些demo代码呢
外面再json_encode一下
序列化了么?
{"errcode":41001,"errmsg":"access_token missing hints: [jGLFXEPce-mA.q8!]"}
$query_data = [
'access_token' =>"xxxxxxx",
'touser' => "xxxxxx",
'template_id' => 'DtX8AQY0PJnp21o_oTskbG_Kw8AcSoa7IX2E2OgcEHE',
'page' => 'pages/shop-cart/index',
'data' => json_encode([
'number1' => ["value" => "111"],
'number4' => ["value" => "4444"],
'thing10' => ["value" => "aaa"],
'thing7' => ["value" => "bbb"]
])
];