目录

Testing Server-Side Notifications

Function

Tests server-side notifications.

Scenario

When this API is called, the IAP server sends a test notification to your server.

  1. Only one call is allowed within a 5-minute window. Once your server receives the test notification, it is not recommended to call this API again.

  2. Test notifications can only be sent to a server in the production environment.

  3. The type of the test notification is TEST, and there is no notification subtype. For details, please refer to NotificationType.

Prototype

Request Parameters

[h2]Request Header

Parameter Mandatory Type Description
Content-Type Yes String Content type. The value is application/json;charset=UTF-8.
Authorization Yes String Authentication information. JWT is used for authentication. For details, please refer to Authorization Description.

Request Example

POST /harmony/v1/application/notifications/test
Content-Type: application/json;charset=UTF-8
Authorization: Bearer ***.***.***
Accept: application/json

Response Parameters

[h2]Response Header

Parameter Mandatory Type Description
Content-Type Yes String Content type. The value is application/json;charset=UTF-8.

[h2]Response Body

Parameter Mandatory Type Description
responseCode Yes String

Response code.

0: success

Other values: Failure. For details, please refer to error codes.

responseMessage No String Response description.
testNotificationId Yes String Test notification ID.

Response Example

HTTP/1.2 200 OK
Content-Type: application/json;charset=UTF-8
{
  "responseCode": "0",
  "testNotificationId": "***"
}

Sample Code

{
  "notificationType": "TEST", // The value is fixed at **TEST**.
  "notificationRequestId": "xxx",
  "notificationMetaData": {
    "environment": "NORMAL", // The value is fixed at **NORMAL**.
    "applicationId": "xxx", // App ID.
    "packageName": "testPackageName", // The value is fixed at **testPackageName**.
    "type": 0, // The value is fixed at **0**.
    "purchaseToken": "xxx", // The prefix is fixed at **testPurchaseToken**, followed by the app ID.
    "purchaseOrderId": "xxx" // The prefix is fixed at **testPurchaseOrderId**, followed by the app ID.
  },
  "notificationVersion": "v3", // The value is fixed at **v3**.
  "signedTime": 1747445946282
}