# 车场入场信息上报

最新更新时间:2023.06.13

车辆驶入停车场时向开放平台传递车辆驶入记录。

# 接口说明

请求URL: https://{domain}/os-park/ospark/open/api/v2/uploadDriveIn

请求方式: POST

公共请求参数

参数名 必填 类型 说明
access_id string 开发者唯一标识
sign_type string 固定传RSA2
time_stamp long 请求时间,Linux时间戳,单位毫秒
sign string 签名结果
data string 将业务参数转为JSON字符串,然后使用BASE64编码的数据

详细签名方法请阅读接口加密方案

请求参数

名称 必填 类型 说明
osStoreCode string 备案系统中停车场编码(开放平台门店Code)
carPlate string 车牌号,无牌车统一设置为 "无牌车"
carPlateColor int 车牌颜色 1-蓝色 2-黄色 3-白色 4-黑色 5-绿色 6-黄绿双拼色 常量定义在SDK的TyhConstants.CarPlateColor中
orderId string 订单记录号(车辆在停车场唯一停车订单编号,支持数字 字母 _ -,最大长度32),车场方生成
inTime long 进场时间,unix时间戳格式,精确到毫秒,如1631602583000
inChannel string 进场通道,如A1、A2、东入口、西入口

SDK方法

// 创建上传数据client
TyhUploadClient client = TyhUploadClient.create(TyhOptions.builder()
    .accessId(ACCESS_ID)
    .secretKey(SECRET_KEY)
    .build());
    
// 车辆入场
OpenParkingDriveInCmd cmd = OpenParkingDriveInCmd.builder()
    .osStoreCode(OS_STORE_CODE)
    .carPlate("皖Axxxxx")
    .carPlateColor(TyhConstants.CarPlateColor.BLUE)
    .orderId("order123456662")
    .inTime(inTime)
    .inChannel("东入口")
    .build();
    
// 发送请求 result.ifSuccess()表示请求成功
Results result = client.uploadDriveIn(cmd);

入参格式

{
  "osStoreCode" : "30000000000001",
  "carPlate": "皖A12345",
  "carPlateColor": 1,
  "orderId": "order123456662",
  "inTime": 1631602583000,
  "inChannel": "东入口"
}

出参格式

 { "code":8888, "msg":"success", "data": "json数据"}

code 为 8888 表示操作成功,其它值则为失败,具体内容参见错误码说明。