返回值结构

最近更新时间:2019-09-11 10:09:16

如无特别说明,每次请求的返回值中,都会包含下面的字段:

名称 类型 描述
code Int 返回结果的错误码,0表示成功,其它值表示失败。具体错误码的含义可以参考 错误码 页面
message String 请求结果

例如:
使用公共参数部分的示例请求:

 https://wenzhi.api.qcloud.com/v2/index.php?
    Action=LexicalAnalysis
    &Nonce=345122
    &Region=sz
    &SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3gnPhESA
    &Timestamp=1408704141
    &Signature=HgIYOPcx5lN6gz8JsCFBNAWp2oQ
    &text=我爱洗澡
    &code=2097152

可能的返回结果如下:

{
        "code": 0,
        "message": "",
        "combtokens": [
            {
                "cls": "短语",
                "pos": 0,
                "wlen": "8",
                "word": "我爱洗澡"
            }
        ],
        "tokens": [
            {
                "pos": 0,
                "wlen": "2",
                "word": "我",
                "wtype": "代词",
                "wtype_pos": 27
            },
            {
                "pos": 2,
                "wlen": "2",
                "word": "爱",
                "wtype": "动词",
                "wtype_pos": 31
            },
            {
                "pos": 4,
                "wlen": "4",
                "word": "洗澡",
                "wtype": "动词",
                "wtype_pos": 31
            }
        ]
}