智能客服
你问我答,随时在线为你解决问题

























HMS Core
重写instanceId对应的登机牌个人化实例。
开发者可以调用该API,全量更新instanceId对应的登机牌个人化实例。除了passTypeIdentifier、organizationPassId和serialNumber(instanceId),其余字段均可更新。可以将passStyleIdentifier(modelId)修改为属于同一个passTypeIdentifier的另一个登机牌模板的ID。
需在华为AGC网站上创建应用并申请卡券对应的服务。只能更新已添加到华为服务器的卡券实例。
承载协议 | HTTPS PUT |
|---|---|
接口方向 | 开发者服务器->华为钱包服务器 |
接口URL | {url}/hmspass/v1/flight/instance/{instanceId} {url}变量需要开发者根据服务器所属区域自行选择,请参见钱包服务器地址。 |
数据格式 | 请求消息:Content-Type: application/json 响应消息:Content-Type: application/json |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
instanceId | 是 | String | 个人化实例的唯一标识符。这个ID在同一个appId下唯一。这个ID只能包含字母、数字和(.)、(-)、(_)。 |
Request Header:
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
Authorization | 是 | String | 鉴权码。获取方式详见基于OAuth 2.0开放鉴权,请使用“客户端模式”。“client_id”和“client_secret”即为开发者在华为AGC网站上创建应用后获取的“App ID”和“App key”。将获取到的“access_token”的值拼接在字符串“Bearer”之后,以空格符相隔,组成“Authorization”参数的值。 |
Content-Type | 是 | String | 固定值:“application/json;charset=utf-8”。 |
Accept | 是 | String | 固定值:“application/json;charset=utf-8”。 |
Request Body:
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
详见HwWalletObject参数描述 | 是 | 待更新的卡券实例 |
- PUT /hmspass/v1/flight/instance/20001 HTTP/1.1
- Content-Type: application/json;charset=utf-8
- Authorization: Bearer ***
- Accept: application/json;charset=utf-8
- Host: wallet-passentrust-drcn.cloud.huawei.com.cn
- {
- "organizationPassId": "5623489692",
- "passTypeIdentifier": "hwpass.com.huawei.wallet.flight.test",
- "passStyleIdentifier": "flightModelTest",
- "serialNumber": "20001",
- "fields": {
- "status": {
- "state": "active",
- "effectTime": "2019-11-13T00:00:00.111Z",
- "expireTime": "2020-11-20T00:00:00.111Z"
- },
- "barCode": {
- "text": "5623489692",
- "type": "qrCode",
- "value": "5623489692",
- "encoding": "UTF-8"
- },
- "commonFields": [
- {
- "key": "seatNumber",
- "value": "15B"
- },
- {
- "key": "passengerName",
- "value": "Wang Xiao"
- },
- {
- "key": "boardingSequence",
- "value": "2"
- },
- {
- "key": "flightClass",
- "value": "Business Class"
- }
- ],
- "appendFields": [
- {
- "key": "confirmationNumber",
- "value": "ITK919"
- }
- ]
- }
- }
- HTTP/1.1 200 OK
- Content-Type: application/json
- {
- "organizationPassId": "5623489692",
- "passTypeIdentifier": "hwpass.com.huawei.wallet.flight.test",
- "passStyleIdentifier": "flightModelTest",
- "serialNumber": "20001",
- "fields": {
- "status": {
- "state": "active",
- "effectTime": "2019-11-13T00:00:00.111Z",
- "expireTime": "2020-11-20T00:00:00.111Z"
- },
- "barCode": {
- "text": "5623489692",
- "type": "qrCode",
- "value": "5623489692",
- "encoding": "UTF-8"
- },
- "commonFields": [
- {
- "key": "seatNumber",
- "value": "15B"
- },
- {
- "key": "passengerName",
- "value": "Wang Xiao"
- },
- {
- "key": "boardingSequence",
- "value": "2"
- },
- {
- "key": "flightClass",
- "value": "Business Class"
- }
- ],
- "appendFields": [
- {
- "key": "confirmationNumber",
- "value": "ITK919"
- }
- ]
- }
- }
详见错误码。
- public HwWalletObject fullUpdateWalletInstance(String url, String instanceId, HwWalletObject body) {
- // Construct the http header.
- HttpHeaders header = constructHttpHeaders();
- // Construct the http URL.
- String baseUrl = ConfigHelper.instants().getValue("walletServerBaseUrl");
- String walletServerUrl = baseUrl + url + instanceId;
- // Construct the http body.
- String hwLoyaltyInstance = CommonUtil.toJson(body);
- JSONObject jsonObj = JSONObject.parseObject(hwLoyaltyInstance);
-
- // Send the http request and get response.
- HttpEntity<JSONObject> entity = new HttpEntity<>(jsonObj, header);
- ResponseEntity<HwWalletObject> response =
- REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.PUT, entity, HwWalletObject.class);
-
- // Return the updated wallet instance.
- return response.getBody();
- }
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功