Method: purchases.subscriptions.get

เลิกใช้งานแล้ว: ใช้ purchases.subscriptionsv2.get แทน ตรวจสอบว่าการสมัครใช้บริการของผู้ใช้ถูกต้องหรือไม่และแสดงเวลาหมดอายุ

คำขอ HTTP

GET https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}

URL ใช้ไวยากรณ์การแปลง gRPC

พารามิเตอร์เส้นทาง

พารามิเตอร์
packageName

string

ชื่อแพ็กเกจของแอปพลิเคชันที่ซื้อการสมัครใช้บริการนี้ (เช่น "com.some.thing")

subscriptionId

string

รหัสการสมัครใช้บริการที่ซื้อ (เช่น "monthly001")

token

string

โทเค็นที่ระบุให้กับอุปกรณ์ของผู้ใช้เมื่อซื้อการสมัครใช้บริการ

เนื้อความของคำขอ

เนื้อหาของคำขอต้องว่างเปล่า

เนื้อหาการตอบกลับ

หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ SubscriptionPurchase

ตัวอย่าง

ตัวอย่างคําขอมีดังนี้

curl -X GET \   'https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.example.app/purchases/subscriptions/monthly.premium/tokens/abcdefghijklmnopqrstuvwxyz.0123456789' \   -H 'Accept: application/json'

ตัวอย่างคำตอบมีดังนี้

{   "kind": "androidpublisher#subscriptionPurchase",   "startTimeMillis": "1678886400000",   "expiryTimeMillis": "1710470400000",   "autoRenewing": true,   "priceCurrencyCode": "USD",   "priceAmountMicros": "9990000",   "introductoryPriceInfo": {     "introductoryPriceCurrencyCode": "USD",     "introductoryPriceAmountMicros": "4990000",     "introductoryPricePeriod": "P1M",     "introductoryPriceCycles": 1   },   "countryCode": "US",   "developerPayload": "{\"userId\": \"user12345\", \"source\": \"app-promo\"}",   "paymentState": 1,   "cancelReason": 0,   "userCancellationTimeMillis": "1709251200000",   "cancelSurveyResult": {     "cancelSurveyReason": 3,     "userInputCancelReason": null   },   "orderId": "GPA.3344-5566-7788-99001",   "linkedPurchaseToken": null,   "purchaseType": 0,   "priceChange": null,   "profileName": "Jane Doe",   "emailAddress": "[email protected]",   "givenName": "Jane",   "familyName": "Doe",   "profileId": "109876543210987654321",   "acknowledgementState": 1,   "externalAccountId": "user-jane-doe-app-id",   "promotionType": 1,   "promotionCode": "WELCOME20",   "obfuscatedExternalAccountId": "obfUaCcOunTId123",   "obfuscatedExternalProfileId": "obfPrOfiLeId456",   "autoResumeTimeMillis": null }

ขอบเขตการให้สิทธิ์

ต้องใช้ขอบเขต OAuth ต่อไปนี้

  • https://www.googleapis.com/auth/androidpublisher