获取authinfo接口
建议authinfo每1小时内获取一次,否则当设备断网且恰好authinfo过期,则会导致设备不可用。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
sp_appid | string | 服务商公众号appid |
sub_appid | string | 子商户公众号appid |
sub_mchid | string | 子商户商户号 |
device_id | string | 设备id |
raw_data | string | 原始数据 |
organization_id | string | 机构id |
php
$instance->v3->offlineface->authinfo->postAsync([
'json' => [
'sp_appid' => '',
'sub_appid' => '',
'sub_mchid' => '',
'device_id' => '',
'raw_data' => '',
'organization_id' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/offlineface/authinfo')->postAsync([
'json' => [
'sp_appid' => '',
'sub_appid' => '',
'sub_mchid' => '',
'device_id' => '',
'raw_data' => '',
'organization_id' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/offlineface/authinfo']->postAsync([
'json' => [
'sp_appid' => '',
'sub_appid' => '',
'sub_mchid' => '',
'device_id' => '',
'raw_data' => '',
'organization_id' => '',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->offlineface->authinfo->post([
'json' => [
'sp_appid' => '',
'sub_appid' => '',
'sub_mchid' => '',
'device_id' => '',
'raw_data' => '',
'organization_id' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/offlineface/authinfo')->post([
'json' => [
'sp_appid' => '',
'sub_appid' => '',
'sub_mchid' => '',
'device_id' => '',
'raw_data' => '',
'organization_id' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/offlineface/authinfo']->post([
'json' => [
'sp_appid' => '',
'sub_appid' => '',
'sub_mchid' => '',
'device_id' => '',
'raw_data' => '',
'organization_id' => '',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
authinfo | string | 授权信息 |
参阅 官方文档