Skip to content

获取authinfo接口

建议authinfo每1小时内获取一次,否则当设备断网且恰好authinfo过期,则会导致设备不可用。

请求参数类型描述
jsonobject声明请求的JSON数据结构
sp_appidstring服务商公众号appid
sub_appidstring子商户公众号appid
sub_mchidstring子商户商户号
device_idstring设备id
raw_datastring原始数据
organization_idstring机构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));
返回字典类型描述
authinfostring授权信息

参阅 官方文档

Published on the GitHub by TheNorthMemory