百度统计Tongji API可以为网站接入者提供便捷的获取网站流量数据的通道, 从而使网站接入者可向网站帐号提供数据分析、运营监控、网站推广等服务。该用户手册分为三册,全集包含 1.接口概述、2. 接口列表、3.常见问题
本期主要讲解第三部分:常见问题
本期主要讲解第三部分:常见问题
统计常见问题说明
一、百度商业账号常见问题
没有传递基础用户信息
没有传递token
{ "header": { "desc": "system failure", "failures": [
{ "code": 8401, "message": "Token is not set in request header.please check the request json.sn:8000000000011", "position": "_user", "content": "id:1729958695803217792"
}
], "status": 3
}
}
没有传递用户名
{ "header": { "desc": "system failure", "failures": [
{ "code": 8101, "message": "Username is not set in request header. sn:8000000000006", "position": "_user", "content": "id:1152934993558650368"
}
], "status": 3
}
}
传递的基础用户信息不正确
{ "header": { "desc": "system failure", "failures": [
{ "code": 8402, "message": "The token is invalid, please contact administrator. sn:1730240170806668544", "position": "_user"
}
], "status": 3
}
}
或者
{ "header": { "desc": "system failure", "failures": [
{ "code": 8414, "message": "The token is invalid, please contact administrator. sn:1153920156013435392", "position": "_user"
}
], "status": 3
}
}
没有传递站点id或没有权限
{ "header": { "desc": "failure", "failures": [
{ "code": 9101, "message": "Invalid Site Or No Permission"
}
], "oprs": 1, "succ": 0, "oprtime": 0, "quota": 0, "rquota": 49915, "status": 2
}, "body": {}
}
二、百度账号常见问题
在请求出现错误时,系统会返回对应的错误状态码。其中返回格式样例如下:
{ "error_code": "123", "error_message": "Unknown Error"}
对应的错误信息及其含义如下:
错误信息 | 含义 | 说明 |
---|---|---|
Access token invalid or no longer valid | ACCESS_TOKEN无效 | ACCESS_TOKEN不正确或者已经过了有效期 |
Unknown Error | 未知错误 | 系统处理过程中出现的未知错误 |
Invalid User | 无效的用户 | 用户id在系统内不存在或者用户没有接受协议 |
Invalid Site Or No Permission | 无效的站点 | 请求的站点id为无效的id或者不属于该用户 |
Invalid Parameter | 无效的参数 | 请求的参数错误,或者请求的参数是无效的 |