接口不接受参数
发布于 6 年前 作者 junxu 14757 次浏览 来自 问答

https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/ThirdParty/token/api_authorizer_token.html

请求代码guzzle,post params和query里都放了还是返回我参数少了component_appid,

$response = $client->request(
            'POST',
            sprintf(
                'https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token?component_access_token=%s&component_appid=%s&authorizer_appid=%s&authorizer_refresh_token=%s',
                $token,
                'wxb1b9ba72147a3103',
                "wxd4e41d3291f82a78",
                'refresh_token_value'
            ),
            [
                'form_params' => [
                    'component_access_token' => $token,
                    'component_appid' => 'wxb1b9ba72147a3103',
                    'authorizer_appid' => "wxd4e41d3291f82a78", 
                    "authorizer_refresh_token" => 'refresh_token_value',
                ],
                // note: 有的参数不放query里就传不过去...腾讯官方文档里没写
                'query' => [
                    'component_access_token' => $token,
                    'component_appid' => 'wxb1b9ba72147a3103',
                    'authorizer_appid' => "wxd4e41d3291f82a78", 
                    "authorizer_refresh_token" => 'refresh_token_value',
                ],
            ]
        );

返回报错

{"errcode":41018,"errmsg":"missing component_appid rid: 60a666d0-15b52b91-732227a6"}
回到顶部