在调用微信公众号预览接口【订阅号与服务号认证后均可用】时,报错:errcode:40132,errmsg:invalid username rid: 60dac95d-5c42d192-50f09436 的排查分析

1、查看开发文档,预览接口【订阅号与服务号认证后均可用】。如图1

图1

2、实际调用后,响应报错:errcode:40132,errmsg:invalid username rid: 60dac95d-5c42d192-50f09436。

Array
(
    [code] => 200
    [status] => OK
    [responseline] => HTTP/1.0 200 OK
    [headers] => Array
        (
            [Connection] => close
            [Content-Type] => application/json; encoding=utf-8
            [Date] => Tue, 29 Jun 2021 07:18:54 GMT
            [Content-Length] => 77
        )

    [content] => {"errcode":40132,"errmsg":"invalid username rid: 60dac95d-5c42d192-50f09436"}
    [meta] => HTTP/1.0 200 OK
Connection: close
Content-Type: application/json; encoding=utf-8
Date: Tue, 29 Jun 2021 07:18:54 GMT
Content-Length: 77

{"errcode":40132,"errmsg":"invalid username rid: 60dac95d-5c42d192-50f09436"}
)

3、查看返回码说明,原因为:微信号不合法。如图2

图2

4、查看请求参数,touser=13980000000,即手机号。如图3

图3

5、修改请求参数,touser=shuijingsewwwwqnwq66tt,即微信号。响应成功。如图4

图4

Array
(
    [code] => 200
    [status] => OK
    [responseline] => HTTP/1.0 200 OK
    [headers] => Array
        (
            [Connection] => close
            [Content-Type] => application/json; encoding=utf-8
            [Date] => Tue, 29 Jun 2021 07:31:01 GMT
            [Content-Length] => 40
        )

    [content] => {"errcode":0,"errmsg":"preview success"}
    [meta] => HTTP/1.0 200 OK
Connection: close
Content-Type: application/json; encoding=utf-8
Date: Tue, 29 Jun 2021 07:31:01 GMT
Content-Length: 40

{"errcode":0,"errmsg":"preview success"}
)
永夜