This API is used to delete an attachment configured in the current beacon.
This API is called to delete an attachment configured in the current beacon.
Protocol | HTTPS DELETE |
Direction | App server or app -> HUAWEI Nearby Service server |
URL | https://{Domain name}/WiseCloudNearbyBeaconService/v1/deleteAttachment/{beaconId}/{attachmentId}?projectId=[projectId] |
Data Format | Content-type: application/json |
You need to obtain the service account credential. For details, please refer to Service Account-based Authentication.
The beacon must be in activated state.
Parameter | Mandatory(M)/Optional(O) | Type | Description |
timeStamp | M | Long | Timestamp in the request header. |
srcTranID | M | String | Transaction ID in the request header. The value contains a maximum of 24 characters. |
Authorization | M | String | Parameter in the request header, which is used for gateway authentication. For details about how to obtain the JSON Web Token (JWT) of the parameter , please refer to Service Account-based Authentication. |
beaconId | M | String | Beacon ID in the URL. |
attachmentId | M | String | Beacon attachment ID in the URL. |
projectId | O | String | Project ID for query. |
If the request is successful, status code 200 is returned without a response body.
If the request fails, a status code other than 200 is returned with the following response body:
(1) A non-service request fails due to an exception (for example, the gateway verification fails or the token expires).
Parameter | Type | Description |
error | String | Error message that is not returned by the service. |
(2) A service request fails.
Parameter | Type | Description |
serviceError | object | Error message that is returned by the service. |
The JSON structure of serviceError is as follows.
Parameter | Type | Description |
code | int | Result code. For details, please refer to the following result code table. |
status | String | Error status. |
message | String | Error description. |
Result Code | Description | Suggestion |
400000001 | Incorrect parameter in the request header. | Verify the request header parameter. |
400000009 | The beacon is not activated. | Activate the beacon. |
400010001 | Incorrect request parameter. | Verify the request parameter. |
403000003 | The service account is unavailable. | Verify that the service account is available on the console of HUAWEI Developer. |
403000004 | You have no permission to perform operations on the beacon. | Verify that you have permission to perform operations the beacon using the service account. |
404000006 | The beacon does not exist. | Verify the request parameter. |
404010001 | The attachment is not found. | Ensure that the attachment to be deleted exists. |
500000001 | Internal service error. | Contact Huawei technical support. |
Request:
- DELETE /WiseCloudNearbyBeaconService/v1/deleteAttachment/abcdef35682/341999510744547537130152797520304377?projectId=id123 HTTP/1.1
- Host: Domain name.
- Content-Type: application/json
- srcTranId: 2019101819080462247750366
- timeStamp: 15794235347
- Accept: application/json
- Authorization: Bearer eyJraWQiOiIx---xxx.eyJhdWQiOiJodHR---xxx.QRodgXa2xeXSt4Gp---xxx
Response:
- HTTP/1.1 401 Unauthorized
- Content-type: application/json
- content-length: 27
- {"error":"session timeout"}
Request:
- DELETE /WiseCloudNearbyBeaconService/v1/deleteAttachment/abcdef12345/301486810597183989359886792140766410?projectId=id123 HTTP/1.1
- Host: Domain name.
- Content-Type: application/json
- srcTranId: 2019101819080462247750366
- timeStamp: 15794235347
- Accept: application/json
- Authorization: Bearer eyJraWQiOiIx---xxx.eyJhdWQiOiJodHR---xxx.QRodgXa2xeXSt4Gp---xxx
Response:
- HTTP/1.1 403 Forbidden
- Content-type: application/json
- content-length: 108
- {"serviceError":{"code":403000004,"message":"You have no permission to operate the beacon with ID abcdef12345.","status":"Forbidden"}}
Request:
- DELETE /WiseCloudNearbyBeaconService/v1/deleteAttachment/abcdef35682/341999510744547537130152797520304377?projectId=id123 HTTP/1.1
- Host: Domain name.
- Content-Type: application/json
- srcTranId: 2019101819080462247750366
- timeStamp: 15794235347
- Accept: application/json
- Authorization: Bearer eyJraWQiOiIx---xxx.eyJhdWQiOiJodHR---xxx.QRodgXa2xeXSt4Gp---xxx
Response:
- HTTP/1.1 200 OK
- content-length: 02
- Content-Type: application/json;charset=UTF-8