先看图
用的是最严密的authorization code模式,登录还是没搞定, 希望大佬摸手.抓的包就不发上来了.
部分API
获取accessToken
请求
POST http://api.xchanger.cn/auth/account/token?identity_type=lid
参数
{
"redirectUri":"http://www.abcde.com",
"authCode":"742464028621668352"
}
这里面的authCode死活找不到是如何获取的
响应
{
"code":1000,
"message":null,
"hint":null,
"data":
{
"expiresIn":7200,
"deviceType":"mobile",
"clientId":"xxx",
"idToken":"",
"resultCode":"0",
"alias":"",
"accessToken":"xxx",
"tcToken":"",
"resultMessage":"Success",
"userId":"1231609",
"refreshToken":"xxx="
},
"success":true
刷新accessToken
请求
PUT http://api.xchanger.cn/auth/account/token
Headers
{
"x-operator-code" : "LYNKCO",
"X-APP-ID" : "lynkco",
"authorization" : 当前authorization
}
参数
{"refreshToken":"xxx"}
这个必须要当前authorization和refreshToken配合使用
获取车辆信息
请求
Headers
{
"x-operator-code" : "LYNKCO",
"authorization" : token
}
GET http://api.xchanger.cn/geelyTCAccess/tcservices/vehicle/status/车架号?userId=用户ID&latest=false&target=more%2Cbasic
响应
{
{
"code": "1000",
"data": {
"result": {
"serviceResult": {
"error": {
"code": 0,
"message": "query m2mdm success"
},
"operationResult": 0
},
"vin": "车架号",
"sessionId": "d6b57dea429a4cb2826cbb889daa0f59",
"serviceId": "RVS"
},
"platform": "csp",
"vehicleStatus": {
"basicVehicleStatus": {
"keyStatus": "NO_KEY_INSERTED",
"engineBlockedStatus": "UNBLOCKED",
"usageMode": 1,
"engineStatus": "ENGINE_OFF",
"position": {
"altitude": 15,
"latitude": 维度, //坐标的值都需要/3600000, 群内高手zip瞬间破解^_^
"posCanBeTrusted": false,
"carLocatorStatUploadEn": true,
"marsCoordinates": false,
"longitude": 经度
},
"extPosition": {
"altitude": 15,
"latitude": 维度,
"posCanBeTrusted": false,
"sysTimestamp": 1597062290325,
"carLocatorStatUploadEn": true,
"marsCoordinates": false,
"longitude": 经度
},
"extSpeed": {
"sysTimestamp": 1597062290325,
"speed": 0.0
},
"distanceToEmpty": 550,
"speed": 0.0,
"direction": 0
},
"updateTime": 1597062290325,
"additionalVehicleStatus": {
"maintenanceStatus": {
"engineHrsToService": 379,
"daysToService": 278,
"odometer": 33253,
"brakeFluidLevelStatus": 0,
"mainBatteryStatus": {
"stateOfCharge": 1,
"chargeLevel": 0,
"stateOfHealth": 0,
"voltage": 12.0
},
"tyrePreWarningDriver": 0,
"distanceToService": 6274,
"tyrePreWarningPassengerRear": 0,
"tyreStatusPassenger": 179.0,
"tyreStatusPassengerRear": 176.0,
"serviceWarningTrigger": 0,
"tyreStatusDriverRear": 175.0,
"tyreStatusDriver": 180.0,
"serviceWarningStatus": 0,
"tyrePreWarningPassenger": 0,
"tyrePreWarningDriverRear": 0,
"washerFluidLevelStatus": 0
},
"extEcuWarningMessages": [],
"electricVehicleStatus": {
"emsCBRemainingLife": 0,
"chargerState": 0,
"chargeLevel": 0,
"statusOfChargerConnection": 0,
"ems48vPackTemp1": 0,
"distanceToEmptyOnBatteryOnly": 0,
"emsRBSModeDisplay": 0,
"emsOVPActive": 0,
"ems48vPackTemp2": 0,
"timeToFullyCharged": 0
},
"signals": [],
"drivingBehaviourStatus": {
"cruiseControlStatus": 0,
"brakePedalDepressed": false,
"transimissionGearPostion": 240,
"engineSpeed": 0.0
},
"ecuWarningMessages": [],
"runningStatus": {
"fuelLevelStatus": 6,
"aveFuelConsumptionInLatestDrivingCycle": 165,
"engineOilPressureWarning": 0,
"fuelLevel": 49.0,
"bulbStatus": 0,
"engineCoolantTemperature": 77.0,
"engineCoolantLevelStatus": 0,
"engineOilLevelStatus": 0,
"tripMeter1": 3254,
"tripMeter2": 12,
"aveFuelConsumption": 9.0,
"avgSpeed": 37
},
"climateStatus": {
"interiorTemp": 0,
"winStatusDriverRear": 2,
"sunroofOpenStatus": 1,
"winStatusPassenger": 2,
"ventilateStatus": 0,
"winStatusDriver": 2,
"winStatusPassengerRear": 2,
"preClimateActive": false,
"exteriorTemp": 29
},
"drivingSafetyStatus": {
"doorLockStatusDriverRear": 1,
"centralLockingStatus": 0,
"doorOpenStatusPassengerRear": 0,
"seatBeltStatusDriver": false,
"srsStatus": "SRS_NOT_DEPLOYED",
"doorLockStatusPassenger": 1,
"doorOpenStatusDriver": 0,
"seatBeltStatusPassenger": false,
"trunkLockStatus": 1,
"electricParkBrakeStatus": 0,
"doorLockStatusDriver": 1,
"engineHoodOpenStatus": 0,
"seatBeltStatusDriverRear": false,
"doorOpenStatusDriverRear": 0,
"handBrakeStatus": 1,
"seatBeltStatusPassengerRear": false,
"doorOpenStatusPassenger": 0,
"doorLockStatusPassengerRear": 1,
"vehicleAlarm": 6,
"trunkOpenStatus": 0
},
"pollutionStatus": {
"interiorPM25": 65535,
"exteriorPM25": 65535
}
}
}
},
"success": true,
"httpStatus": "OK",
"message": "............"
}
车辆远程操作
请求
Headers
{
"x-operator-code" : "LYNKCO",
"X-APP-ID" : "lynkco",
"authorization" : token
}
PUT http://api.xchanger.cn/geelyTCAccess/tcservices/vehicle/telematics/车架号
参数
{
"command":"start",//车辆启动是start, 熄火是stop
"creator":"tc",
"operationScheduling":{
"duration":0,
"interval":0,
"occurs":1,
"recurrentOperation":false
},
"serviceId":"RDU",//操控指令( RDU:解锁, RDL:上锁,启停:RES,闪灯鸣笛:RHL
"serviceParameters":[//启停指令不需要这个参数
{
"key":"time.window",//当闪灯鸣笛操作时key是 rhl,解锁时是time.window解锁窗口期
"value":"1"//当闪灯鸣笛操作时value有三种情况(horn-light-flash,light-flash,horn-flash),解锁指令时数值是分钟
}
],
"timestamp":时间戳,
"userId":userID}
还有个物联网卡的信息获取
请求
GET http://api.xchanger.cn/api/v1/flowinfo?type=iccid&iccid=SIM卡号
响应
{
"sum": 3145728,
"left": 3074339,
"used": 71389,
"basic_package": {
"auth_time": 1530770944000,
"start_time": 1530770944000,
"limit_time": 1688537344000,
"available_days": 1058
},
"increase_package": {
"package": [{
"voiceMinute_init": 700,
"usedSMSNumber": 21,
"productId": "800720",
"SMSNumber_init": 450,
"dataVolume_init": 31415728,
"orderId": "R2F202007310242732188DVPALP",
"usedDataVolume": 71389,
"usedVoiceMinute": 0,
"SMSNumber": 49,
"dataVolume": 3074339,
"voiceMinute": 700,
"activeDate": "20200731024724",
"expireDate": "20200831235959"
}]
},
"timestamp": 1597070724
}
付上流程, 在初始化里面填入抓取到的信息,填入后执行一次.
flows.json (11.4 KB)
希望有大佬能够帮忙把登录部分研究一下.