You do not need to call this API if you have implemented the APIs described in Implementing NFC Capability APIs on Your Server. Before using this API, contact Huawei technical support for development and joint commissioning.
Protocol | HTTPS DELETE |
|---|---|
Direction | Developer server -> Huawei server |
URL | {url}/hmspass/v1/nfccard/personalizeddata/{serviceType}/{transId} Set the {url} variable based on the region where the server is located. For details, please refer to Wallet Server Addresses. |
Data Format | Request: Content-Type: application/json Response: Content-Type: application/json |
Parameter | Mandatory/Optional | Type | Description |
|---|---|---|---|
serviceType | Mandatory | String(32) | Service name. |
transId | Mandatory | String(32) | Transaction ID. |
Request Header
Parameter | Mandatory/Optional | Type | Description |
|---|---|---|---|
Authorization | Mandatory | String | Authorization code. For details about how to obtain the value, please refer to the Client Credentials mode in OAuth 2.0-based Authentication. In this mode, client_id and client_secret are respectively the App ID and App key of the app that you created in AppGallery Connect. Concatenate the value of access_token to the end of Bearer, with a space in between, to generate the value of Authorization. |
Content-Type | Mandatory | String | The value is always application/json;charset=utf-8. |
Accept | Mandatory | String | The value is always application/json;charset=utf-8. |
DELETE /hmspass/v1/nfccard/personalizeddata/amber_house/amberHouse10001 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
When the result code is 200:
Parameter | Type | Description |
|---|---|---|
returnCode | String | Return code. The value 0 indicates success. |
returnDesc | String | Return description. The value is success when the return code is 0. |
HTTP/1.1 200 OK
Content-Type: application/json
{
"returnCode": "0",
"returnDesc": "success"
} public String deleteFromWalletServer(String urlSegment) {
// Construct the HTTP header.
HttpHeaders header = constructHttpHeaders();
// Construct the HTTP URL.
String baseUrl = ConfigUtil.instants().getValue("walletServerBaseUrl");
String walletServerUrl = baseUrl + urlSegment;
HttpEntity<JSONObject> entity = new HttpEntity<>(null, header);
// Send the HTTP request and obtain the response.
ResponseEntity<String> exchange =REST_TEMPLATE.exchange(walletServerUrl, HttpMethod.DELETE, entity, String.class);
return exchange.getBody();
}