e货运开放平台 轿车托运API

Version: 1.0.4

e货运开放平台 API,包括用户管理、托运信息发布、报价管理

Default response content-types: application/json
Schemes: http

Summary

Tag: 安全验证

Operation Description
POST /oauth/token?grant_type=client_credentials

获得车商 Access Token

POST /oauth/token?grant_type=password

获得用户的 Access Token

POST /oauth/token?grant_type=refresh_token

刷新 Access Token

Tag: 用户

Operation Description
POST /members

注册用户

PUT /members

更新已注册的用户信息

GET /members

返回当前第三方平台注册的用户列表

GET /members/{memberId}

按用户编号查找用户

GET /members/current

得到当前用户信息

Tag: 价格

Operation Description
GET /cars/quote

试算轿车托运价格

Tag: 查找

Operation Description
GET /cars/search/{first}/{startCitys}/{endCitys}/{maxNum}

查找轿车托运信息

Tag: 轿车

Operation Description
POST /cars

发布新轿车托运信息

PUT /cars

更新已发布的轿车托运信息

GET /cars

当前用户所发布的轿车托运信息

GET /cars/{shipmentId}

按轿车托运信息编号查找轿车

GET /cars/{shipmentId}/complete

完成轿车托运

GET /cars/{shipmentId}/cancel

取消轿车托运

GET /cars/{shipmentId}/paid

轿车托运已支付定金

GET /cars/{shipmentId}/carrier

获得接受报价托运公司的联系方式

Tag: 报价

Operation Description
GET /bids/shipment/{shipmentId}/deposit/{value}

获取托运信息的定金

GET /bids/shipment/{shipmentId}

获取托运信息的报价

GET /bids/shipment/{shipmentId}/{bidId}

获取单个报价

GET /bids/{bidId}/accept

接受报价

GET /bids/{bidId}/reject/{bidStatus}

拒绝报价

Security

ehy_auth

authorizationUrl: http://api.ehuoyun.com/oauth
flow: implicit
scopes: [object Object]

Paths

获取托运信息的报价

GET /bids/shipment/{shipmentId}

Tags: 报价

按托运信息编号获取报价数据.

Authorization

Bearer Access Token

header string
shipmentId

托运信息编号

path integer (int64)

application/json

200 OK

返回对应轿车托运的详细报价列表

400 Bad Request

提供的轿车托运编号不正确

ehy_auth bids_read
获取托运信息的定金

GET /bids/shipment/{shipmentId}/deposit/{value}

Tags: 报价

按托运信息编号获取定金数据.

Authorization

Bearer Access Token

header string
shipmentId

托运信息编号

path integer (int64)
value

出价值

path number (float)

application/json

200 OK

返回对应轿车托运的定金

获取单个报价

GET /bids/shipment/{shipmentId}/{bidId}

Tags: 报价

获取指定报价信息.

Authorization

Bearer Access Token

header string
shipmentId

托运信息编号

path integer (int64)
bidId

报价编号

path integer (int64)

application/json

200 OK

成功返回查找到的报价信息

400 Bad Request

提供的报价编号不正确

401 Unauthorized

当前用户没登录

404 Not Found

没查到想对应编号的报价信息

ehy_auth bids_read
接受报价

GET /bids/{bidId}/accept

Tags: 报价

接受托运信息的指定报价.

Authorization

Bearer Access Token

header string
bidId

报价编号

path integer (int64)

application/json

200 OK

成功接受报价

401 Unauthorized

当前用户没登录

拒绝报价

GET /bids/{bidId}/reject/{bidStatus}

Tags: 报价

拒绝托运信息的指定报价.

Authorization

Bearer Access Token

header string
bidId

报价编号

path integer (int64)
bidStatus

新的报价状态,也就是拒绝报价的原因

path string

application/json

200 OK

成功拒绝报价

401 Unauthorized

当前用户没登录

当前用户所发布的轿车托运信息

GET /cars

Tags: 轿车

获取当前用户所发布的轿车托运信息

Authorization

Bearer Access Token

header string
Member

如果是第三方平台Access Token,一定要传入Member Id参数,否则可以省略。

header integer (int64)

application/json

200 OK

成功返回查询的轿车托运信息

Car
ehy_auth cars_read
发布新轿车托运信息

POST /cars

Tags: 轿车

application/json

要发布的轿车托运信息

Car
Authorization

Bearer Access Token

header string

application/json

200 OK

轿车托运信息编号

Id
405 Method Not Allowed

无效的轿车托运信息

ehy_auth cars_write
更新已发布的轿车托运信息

PUT /cars

Tags: 轿车

application/json

要更新轿车托运信息

Car
Authorization

Bearer Access Token

header string

application/json

200 OK

轿车托运信息编号

Id
400 Bad Request

轿车托运编号不正确

404 Not Found

没找到要轿车托运信息

405 Method Not Allowed

无效的轿车托运信息

ehy_auth cars_write
试算轿车托运价格

GET /cars/quote

Tags: 价格

通过传入的起始城市编码和目的城市编码试算两城市之间的轿车托运价格

Authorization

Bearer Access Token

header string
startCity

起始城市编码,每个城市的编码请参考城市编码表.

query integer (int32)
endCity

目的城市编码,每个城市的编码请参考城市编码表.

query integer (int32)

Uses default content-types: application/json

200 OK

返回试算轿车托运价格结果

查找轿车托运信息

GET /cars/search/{first}/{startCitys}/{endCitys}/{maxNum}

Tags: 查找

按起始城市编码和目的城市编码查找轿车托运信息

Authorization

Bearer Access Token

header string
first

启始记录位置.

path integer (int32)
startCitys

起始城市编码,每个城市的编码请参考城市编码表.

path string
endCitys

目的城市编码,每个城市的编码请参考城市编码表.

path string
maxNum

一次最多返回多少条记录.

path integer (int32)

Uses default content-types: application/json

200 OK

成功返回查询的轿车托运信息

Car
按轿车托运信息编号查找轿车

GET /cars/{shipmentId}

Tags: 轿车

返回指定托运编号的轿车托运信息

Authorization

Bearer Access Token

header string
shipmentId

要查找的轿车托运编号

path integer (int64)

application/json

200 OK

成功返回查找到的轿车托运信息

Car
400 Bad Request

提供的轿车托运编号不正确

404 Not Found

没查到想对应编号的轿车托运信息

ehy_auth cars_read
取消轿车托运

GET /cars/{shipmentId}/cancel

Tags: 轿车

取消指定托运编号的轿车托运信息

Authorization

Bearer Access Token

header string
shipmentId

要取消的轿车托运编号

path integer (int64)

application/json

200 OK

成功取消轿车托运信息

400 Bad Request

提供的轿车托运编号不正确

404 Not Found

没查到想对应编号的轿车托运信息

ehy_auth cars_write , cars_read
获得接受报价托运公司的联系方式

GET /cars/{shipmentId}/carrier

Tags: 轿车

只有接受报价后,才可以返回托运公司的联系方式

Authorization

Bearer Access Token

header string
shipmentId

要查找托运公司联系方式的轿车托运编号

path integer (int64)

application/json

200 OK

成功返回轿车托运公司的联系方式

400 Bad Request

提供的轿车托运编号不正确

404 Not Found

没查到想对应编号的轿车托运信息

ehy_auth cars_write , cars_read
完成轿车托运

GET /cars/{shipmentId}/complete

Tags: 轿车

把指定托运编号的轿车托运信息设置为已完成托运状态

Authorization

Bearer Access Token

header string
shipmentId

要完成的轿车托运编号

path integer (int64)

application/json

200 OK

成功完成轿车托运信息

400 Bad Request

提供的轿车托运编号不正确

404 Not Found

没查到想对应编号的轿车托运信息

ehy_auth cars_write , cars_read
轿车托运已支付定金

GET /cars/{shipmentId}/paid

Tags: 轿车

设置指定托运编号的轿车托运信息已支付过定金

Authorization

Bearer Access Token

header string
shipmentId

已支付定金的轿车托运编号

path integer (int64)

application/json

200 OK

成功设置已支付定金

400 Bad Request

提供的轿车托运编号不正确

404 Not Found

没查到想对应编号的轿车托运信息

ehy_auth cars_write , cars_read
返回当前第三方平台注册的用户列表

GET /members

Tags: 用户

分批次每次返回50个用户列表, 如果返回的用户数不足50个,代表没有更多记录。

Authorization

Bearer Access Token

header string
Start

用户记录起始位置。

header integer (int32)

application/json

200 OK

成功返回用户信息

ehy_auth members_read
注册用户

POST /members

Tags: 用户

调用该API注册新用户,调用此API时,request header 必须包含api key.

要注册的用户数据

Authorization

Bearer Access Token

header string

application/json

200 OK

返回成功注册的用户编号

Id
ehy_auth members_write
更新已注册的用户信息

PUT /members

Tags: 用户

application/json

要更新用户信息

Authorization

Bearer Access Token

header string

application/json

200 OK

成功更新用户编号

400 Bad Request

用户信息不正确

ehy_auth members_write
得到当前用户信息

GET /members/current

Tags: 用户

返回当前用户编号的用户信息

Authorization

Bearer Access Token

header string

application/json

200 OK

成功返回查找到的用户信息

ehy_auth members_read
按用户编号查找用户

GET /members/{memberId}

Tags: 用户

返回指定用户编号的用户信息

Authorization

Bearer Access Token

header string
memberId

要查找的用户编号

path integer (int64)

application/json

200 OK

成功返回查找到的用户信息

400 Bad Request

提供的用户编号不正确

404 Not Found

没查到想对应编号的用户信息

ehy_auth members_read
获得车商 Access Token

POST /oauth/token?grant_type=client_credentials

Tags: 安全验证

用车商申请的Client Id 和 Client Secret 换 Access Token, 此 Access Token 用于代客户注册用户.

grant_type

client_credentials

query string client_credentials
client_id

e货运开放平台为第三方应用分配的 client id

query string
client_secret

e货运开放平台为第三方应用分配的 client secret

query string
scope

申请的访问权限,如:members_read

query string

application/json

default

Access Token

获得用户的 Access Token

POST /oauth/token?grant_type=password

Tags: 安全验证

用车用户注册时的电话号码或邮件地址及密码换 Access Token, 此 Access Token 可发布轿车托运信息.

grant_type

password

query string password
client_id

e货运开放平台为第三方应用分配的 client id

query string
client_secret

e货运开放平台为第三方应用分配的 client secret

query string
username

登录的用户名

query string
password

登录的密码

query string
scope

申请的访问权限,如:members_read

query string

application/json

default

Access Token

刷新 Access Token

POST /oauth/token?grant_type=refresh_token

Tags: 安全验证

用 Refresh Token 刷新 Access Token.

grant_type

refresh_token

query string refresh_token
client_id

e货运开放平台为第三方应用分配的 client id

query string
client_secret

e货运开放平台为第三方应用分配的 client secret

query string
refresh_token

Refresh Token

query string

application/json

default

Access Token

Schema definitions

BidDetail: object

托运报价详细信息

id: integer (int64)

报价编号

bidOn: integer (int64)

给报价的托运信息编号

companyId: integer (int64)

报价托运公司编号

companyName: string

报价托运公司名称

companyScore: number (float)

报价托运公司的信誉评分

companyReviews: integer

报价托运公司收到的评价总个数

companyStatus: CompanyStatus

报价托运公司状态

companyCert: boolean

报价托运公司是否经过认证

value: number (float)

报价价格

deposit: number (float)

应支付定金

transportType: TransportType

托运方式

truckType: TruckType

轿运车类型

pickupDateType: DateType

启运日期类型

pickupDays: integer

车主接受报价之后多少天提车

pickupDate1: string (date)

计算提车日期的第一个时间点

pickupDate2: string (date)

计算提车日期的第二个时间点

deliveryDateType: DateType

送达日期类型

deliveryDays: integer

提车之后多少天送达

deliveryDate1: string (date)

计算送达日期的第一个时间点

deliveryDate2: string (date)

计算送达日期的第二个时间点

description: string

报价描述

insurance: boolean

报价是否包含保险

insuranceType: InsuranceType

是全额保还只是包含基本保险

status: BidStatus

报价状态

expireDate: string (date)

信息过期时间

createDate: string (date)

创建时间

editDate: string (date)

修改时间

BidStatus: string , x ∈ { NEW , EXPIRED , CANCELED , MATCHED , COMPLETED , DECLINED_PRICE_TOO_HIGH , DECLINED_DATES_NOT_COMPATIBLE , DECLINED_INSUFFICIENT_FEEDBACK , DECLINED_ACCOUNT_SUSPENDED , DECLINED_ACCEPTED_ANOTHER , DECLINED_OTHER }

Car:

轿车托运信息,它将包含Shipment对象里所有属性

series: integer

车型编号

working: boolean true

是否能开

convertible: boolean

是不是敞篷车

modified: boolean

是不是改装车

value: integer

轿车估值,单位为万元

Company: object

托运公司信息

id: integer (int64)

托运公司编号

name: string

托运公司名称

contact: Contact

托运公司的联系人信息

CompanyStatus: string , x ∈ { NEW , PUBLISHED , SUSPENDED , OBSERVING , VERIFIED }

Contact: object

联系人信息

id: integer (int64)

联系人编号

name: string

联系人称呼

phone: string

联系电话

DateType: string , x ∈ { FREE , ON , BEFORE , AFTER , BETWEEN , DAYS_OF_BOOKING , DAYS_OF_PICKUP }

Id: object

注册用户,发布轿车时返回的Id

id: integer (int64)

编号

InsuranceType: string , x ∈ { BASIC , FULL }

Member: object

注册用户信息

id: integer (int64)

用户编号

name: string

用户名称

email: string

邮件地址

phoneNumber: string

电话号码

password: string (password)

登录密码

lastLogin: string (date)

最后登录时间

createDate: string (date)

创建时间

editDate: string (date)

修改时间

QuoteResult: object

包含托运价格查询结果信息

value: number (float)
bidNumber: integer

Shipment: object

托运信息基本属性

id: integer (int64)

托运信息编号

client: integer (int64)

车商编号

name: string

托运信息名称

description: string

托运信息描述

listBy: integer (int64)

发布托运信息的用户编号

contact: Contact

发布托运信息的联系人信息

total: integer 1

要托运货物的总个数

startCity: integer

起始城市编码

startCounty: integer

起始区县编码

endCity: integer

目的城市编码

endCounty: integer

目的区县编码

distance: number (float)

托运线路参考距离

pickupDateType: DateType

启运日期类型

pickupDays: integer

期望接受报价之后多少天提车

pickupDate1: string (date)

计算提车日期的第一个时间点

pickupDate2: string (date)

计算提车日期的第二个时间点

deliveryDateType: DateType

送达日期类型

deliveryDays: integer

期望提车之后多少天送达

deliveryDate1: string (date)

计算送达日期的第一个时间点

deliveryDate2: string (date)

计算送达日期的第二个时间点

bidNumber: integer

收到的报价总数

status: ShipmentStatus NEW

当前状态

paid: boolean

是否已支付定金

targetPrice: number (float)

目标价格

expireDate: string (date)

信息过期时间

createDate: string (date)

创建时间

editDate: string (date)

修改时间

ShipmentStatus: string , x ∈ { NEW , EXPIRED , CANCELED , MATCHED , COMPLETED , BOOKED , BOOK_COMPLETED , DISPATCHED , PICKED_UP , DELIVERED , INVALID }

TransportType: string , x ∈ { TRUCKING , AIR , RAIL , OCEAN , INTERMODAL }

TruckType: string , x ∈ { OPEN , SEMI_CLOSED , ENCLOSED , TOW }