e货运开放平台 宠物托运API

Version: 1.0.3

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
POST /pets

发布新宠物托运信息

PUT /pets

更新已发布的宠物托运信息

GET /pets

当前用户所发布的宠物托运信息

GET /pets/{shipmentId}

按宠物托运信息编号查找宠物

GET /pets/{shipmentId}/complete

完成宠物托运

GET /pets/{shipmentId}/cancel

取消宠物托运

GET /pets/{shipmentId}/carrier

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

Tag: 报价

Operation Description
GET /bids/shipment/{shipmentId}

获取托运信息的报价

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/{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 /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

当前用户所发布的宠物托运信息

GET /pets

Tags: 宠物

获取当前用户所发布的宠物托运信息

Authorization

Bearer Access Token

header string
Member

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

header integer (int64)

application/json

200 OK

成功返回查询的宠物托运信息

Pet
ehy_auth pets_read
发布新宠物托运信息

POST /pets

Tags: 宠物

application/json

要发布的宠物托运信息

Pet
Authorization

Bearer Access Token

header string

application/json

200 OK

宠物托运信息编号

Id
405 Method Not Allowed

无效的宠物托运信息

ehy_auth pets_write
更新已发布的宠物托运信息

PUT /pets

Tags: 宠物

application/json

要更新宠物托运信息

Pet
Authorization

Bearer Access Token

header string

application/json

200 OK

宠物托运信息编号

Id
400 Bad Request

宠物托运编号不正确

404 Not Found

没找到要宠物托运信息

405 Method Not Allowed

无效的宠物托运信息

ehy_auth pets_write
按宠物托运信息编号查找宠物

GET /pets/{shipmentId}

Tags: 宠物

返回指定托运编号的宠物托运信息

Authorization

Bearer Access Token

header string
shipmentId

要查找的宠物托运编号

path integer (int64)

application/json

200 OK

成功返回查找到的宠物托运信息

Pet
400 Bad Request

提供的宠物托运编号不正确

404 Not Found

没查到想对应编号的宠物托运信息

ehy_auth pets_read
取消宠物托运

GET /pets/{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 pets_write , pets_read
获得接受报价托运公司的联系方式

GET /pets/{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 pets_write , pets_read
完成宠物托运

GET /pets/{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 pets_write , pets_read

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 }

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)

修改时间

Pet:

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

petType: PetType DOG

宠物种类

breed: integer

宠物品种编号

breedName: string

宠物品种名称

petName: string

宠物名字

vaccination: boolean true

是否有检疫证书,且尚未过期

inKennel: boolean

是否已经有笼子

pickupService: boolean

是否需要上门提货服务

deliveryService: boolean

是否需要送货到家服务

PetType: string , x ∈ { DOG , CAT , LIVE_FISH , OTHER }

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 }