Balaji
Balaji

Reputation: 67

Huawei IAP kit server side token error - HMS Core-In-App Purchases

When I do API call for cancel subscription, it is giving token expired error as response.

Request:

{"subscriptionId":"163912368****.7CA2****.****","purchaseToken":" 0000017da36282f5f6****aeac1cc6c128e7e787253****4da40c6e8837469b272c2e88eb48b32d9x494e.****","accountflag": 1} 

contentType - application/json
encoding - Encoding.UTF8
httpurl - https://subscr-at-dre.iap.dbankcloud.com/sub/applications/v2/purchases/stop
headers = {Authorization: Basic QVBQQVQ6Q3dFQUFBQUFFMF****dUYTdFVmhzaGhIU3ZseGVGMXloTHphQkhtbnQ0bmNUYk9JV1p****TUGtLcE83UXN6eG1ubm****s4YXhLU2MwMk1TUHBibjN5OFlBTXEwWT**********
}

Response:

{"responseCode":"6","responseMessage":"Token is expired or invalid"}

Please help to fix this issue.

Upvotes: 1

Views: 116

Answers (1)

siva1992
siva1992

Reputation: 373

The problem is caused might be by the access token expiration. So

  1. Please obtain the access token again and try the interface again.

The value of rootUrl varies depending on the site. You must select the subscription service address of the nearest site for access. For details, please refer to Site Information and Site Selection links below.

https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/api-common-statement-0000001050986127#section1741234185817

https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/api-common-statement-0000001050986127#section1954123781815

Upvotes: 1

Related Questions