Difference between revisions of "丰富版生活指数接口"
Ringsaturn (talk | contribs) |
Ringsaturn (talk | contribs) |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
==授权与认证== | ==授权与认证== | ||
请先至彩云开放平台[https://dashboard.caiyunapp.com/user/sign_up/ 注册],注册后可以获得 token 。 | 请先至彩云开放平台[https://dashboard.caiyunapp.com/user/sign_up/ 注册],注册后可以获得 token 。 | ||
| Line 11: | Line 9: | ||
== 请求样例 == | == 请求样例 == | ||
| − | |||
| + | [http://api.caiyunapp.com/v1/lifeindex/?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594 <code>http://api.caiyunapp.com/v1/lifeindex/?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594</code>] | ||
| − | + | === 返回结构和说明 === | |
| + | <syntaxhighlight lang="json">{ | ||
| + | "status": "ok", | ||
| + | "result": { | ||
| + | "meta": { | ||
| + | "created_at": 1619078405 | ||
| + | }, | ||
| + | "$LifeIndex": [ | ||
| + | { | ||
| + | "datetime": "2021-04-22T00:00+08:00", | ||
| + | "level": 1, | ||
| + | "desc": "适宜", | ||
| + | "detail": "描述..." | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | }</syntaxhighlight> | ||
| − | + | 其中 <code>$LifeIndex</code> 支持类型如下: | |
| − | |||
| − | |||
* <code>AirConditionerIndex</code>: 空调指数 | * <code>AirConditionerIndex</code>: 空调指数 | ||
| Line 49: | Line 61: | ||
* <code>WashClothesIndex</code>: 洗衣指数 | * <code>WashClothesIndex</code>: 洗衣指数 | ||
* <code>WindColdIndex</code>: 风寒指数 | * <code>WindColdIndex</code>: 风寒指数 | ||
| + | |||
| + | <code>meta</code> 字段用于描述一些基本元数据,目前 <code>created_at</code> 表示当前请求的生活指数数据的生成时间 | ||
Latest revision as of 08:27, 22 April 2021
授权与认证
请先至彩云开放平台注册,注册后可以获得 token 。
使用本接口,开发者token需要额外开通权限,请联系商务:api@caiyunapp.com
把您的 token 拼到 API 请求的 URL 中,如: http://api.caiyunapp.com/v1/lifeindex?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594
其中 TAkhjf8d1nlSlspN 就是一个共用测试 token 。不要把私有token 告诉任何人!
请求样例
http://api.caiyunapp.com/v1/lifeindex/?token=TAkhjf8d1nlSlspN&lng=110.8840&lat=21.6594
返回结构和说明
{
"status": "ok",
"result": {
"meta": {
"created_at": 1619078405
},
"$LifeIndex": [
{
"datetime": "2021-04-22T00:00+08:00",
"level": 1,
"desc": "适宜",
"detail": "描述..."
}
]
}
}
其中 $LifeIndex 支持类型如下:
-
AirConditionerIndex: 空调指数 -
AllergyIndex: 过敏指数 -
AnglingIndex: 钓鱼指数 -
AQIIndex: 空气污染扩散条件指数 -
BoatingIndex: 划船指数 -
CarWashingIndex: 洗车指数 -
ColdRiskIndex: 感冒指数 -
ComfortIndex: 舒适度指数 -
DatingIndex: 约会指数 -
DressingIndex: 穿衣指数 -
DrinkingIndex: 啤酒指数 -
DryingIndex: 晾晒指数 -
HairdressingIndex: 美发指数 -
HeatstrokeIndex: 中暑指数 -
KiteIndex: 放风筝指数 -
MakeUpIndex: 化妆指数 -
MoodIndex: 心情指数 -
MorningExerciseIndex: 晨练指数 -
NightLifeIndex: 夜生活指数 -
RainGearIndex: 雨具指数 -
RoadConditionIndex: 路况指数 -
ShoppingIndex: 逛街指数 -
SportIndex: 运动指数 -
TrafficIndex: 路况指数 -
TravelIndex: 旅游指数 -
UltravioletIndex: 紫外线指数/防晒指数 -
WashClothesIndex: 洗衣指数 -
WindColdIndex: 风寒指数
meta 字段用于描述一些基本元数据,目前 created_at 表示当前请求的生活指数数据的生成时间