Method: jwt.insert
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คำขอ HTTP
POST https://walletobjects.googleapis.com/walletobjects/v1/jwt
URL ใช้ไวยากรณ์การแปลง gRPC
เนื้อหาของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ JwtResource
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"saveUri": string,
"resources": {
object (Resources )
}
} |
ช่อง |
saveUri |
string
URI ที่เมื่อเปิดแล้วจะอนุญาตให้ผู้ใช้ปลายทางบันทึกออบเจ็กต์ที่ระบุใน JWT ไปยังบัญชี Google ของตนได้
|
resources |
object (Resources )
ข้อมูลที่สอดคล้องกับรหัสของคลาสและออบเจ็กต์ที่ระบุใน JWT ทรัพยากรจะรวมเฉพาะอาร์เรย์ที่ไม่ว่างเปล่า (เช่น หาก JWT มีเฉพาะ eventTicketObjects ฟิลด์ดังกล่าวจะเป็นฟิลด์เดียวที่จะอยู่ในทรัพยากร)
|
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/wallet_object.issuer
แหล่งข้อมูล
การแสดง JSON |
{
"eventTicketClasses": [
{
object (EventTicketClass )
}
],
"eventTicketObjects": [
{
object (EventTicketObject )
}
],
"flightClasses": [
{
object (FlightClass )
}
],
"flightObjects": [
{
object (FlightObject )
}
],
"giftCardClasses": [
{
object (GiftCardClass )
}
],
"giftCardObjects": [
{
object (GiftCardObject )
}
],
"loyaltyClasses": [
{
object (LoyaltyClass )
}
],
"loyaltyObjects": [
{
object (LoyaltyObject )
}
],
"offerClasses": [
{
object (OfferClass )
}
],
"offerObjects": [
{
object (OfferObject )
}
],
"transitClasses": [
{
object (TransitClass )
}
],
"transitObjects": [
{
object (TransitObject )
}
],
"genericClasses": [
{
object (GenericClass )
}
],
"genericObjects": [
{
object (GenericObject )
}
]
} |
ช่อง |
eventTicketClasses[] |
object (EventTicketClass )
รายการชั้นตั๋วเข้างาน
|
eventTicketObjects[] |
object (EventTicketObject )
รายการออบเจ็กต์ตั๋วเข้างาน
|
flightClasses[] |
object (FlightClass )
รายการชั้นโดยสารของเที่ยวบิน
|
flightObjects[] |
object (FlightObject )
รายการออบเจ็กต์เที่ยวบิน
|
giftCardClasses[] |
object (GiftCardClass )
รายการคลาสของบัตรของขวัญ
|
giftCardObjects[] |
object (GiftCardObject )
รายการออบเจ็กต์บัตรของขวัญ
|
loyaltyClasses[] |
object (LoyaltyClass )
รายการคลาสสะสมคะแนน
|
loyaltyObjects[] |
object (LoyaltyObject )
รายการออบเจ็กต์โปรแกรมสะสมคะแนน
|
offerClasses[] |
object (OfferClass )
รายการชั้นเรียนข้อเสนอ
|
offerObjects[] |
object (OfferObject )
รายการออบเจ็กต์ข้อเสนอ
|
transitClasses[] |
object (TransitClass )
รายการชั้นโดยสาร
|
transitObjects[] |
object (TransitObject )
รายการออบเจ็กต์การขนส่งสาธารณะ
|
genericClasses[] |
object (GenericClass )
รายการชั้นเรียนทั่วไป
|
genericObjects[] |
object (GenericObject )
รายการออบเจ็กต์ทั่วไป
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eInserts resources into a JWT for Google Wallet.\u003c/p\u003e\n"],["\u003cp\u003eUses a POST request to \u003ccode\u003ehttps://walletobjects.googleapis.com/walletobjects/v1/jwt\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/wallet_object.issuer\u003c/code\u003e authorization scope.\u003c/p\u003e\n"],["\u003cp\u003eThe request body contains a \u003ccode\u003eJwtResource\u003c/code\u003e object, and the response includes a save URI and inserted resource data.\u003c/p\u003e\n"],["\u003cp\u003eResource data in the response includes arrays of objects and classes for various Google Wallet pass types, like event tickets, flights, or loyalty cards.\u003c/p\u003e\n"]]],["This documentation details the process of inserting resources into a JWT via a `POST` request to `https://walletobjects.googleapis.com/walletobjects/v1/jwt`. The request body contains a `JwtResource` instance. The successful response includes a `saveUri` string for users to save objects and a `resources` object. This object contains arrays of classes and objects, including event tickets, flights, gift cards, loyalty programs, offers, transit options, and generic types, based on what's in the JWT. It requires the `https://www.googleapis.com/auth/wallet_object.issuer` OAuth scope.\n"],null,["# Method: jwt.insert\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.JwtInsertResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Resources](#Resources)\n - [JSON representation](#Resources.SCHEMA_REPRESENTATION)\n\nInserts the resources in the JWT.\n\n### HTTP request\n\n`POST https://walletobjects.googleapis.com/walletobjects/v1/jwt`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [JwtResource](/wallet/reference/rest/v1/jwt#JwtResource).\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------|\n| ``` { \"saveUri\": string, \"resources\": { object (/wallet/reference/rest/v1/jwt/insert#Resources) } } ``` |\n\n| Fields ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `saveUri` | `string` A URI that, when opened, will allow the end user to save the object(s) identified in the JWT to their Google account. |\n| `resources` | `object (`[Resources](/wallet/reference/rest/v1/jwt/insert#Resources)`)` Data that corresponds to the ids of the provided classes and objects in the JWT. resources will only include the non-empty arrays (i.e. if the JWT only includes eventTicketObjects, then that is the only field that will be present in resources). |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/wallet_object.issuer`\n\nResources\n---------\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"eventTicketClasses\": [ { object (/wallet/reference/rest/v1/eventticketclass#EventTicketClass) } ], \"eventTicketObjects\": [ { object (/wallet/reference/rest/v1/eventticketobject#EventTicketObject) } ], \"flightClasses\": [ { object (/wallet/reference/rest/v1/flightclass#FlightClass) } ], \"flightObjects\": [ { object (/wallet/reference/rest/v1/flightobject#FlightObject) } ], \"giftCardClasses\": [ { object (/wallet/reference/rest/v1/giftcardclass#GiftCardClass) } ], \"giftCardObjects\": [ { object (/wallet/reference/rest/v1/giftcardobject#GiftCardObject) } ], \"loyaltyClasses\": [ { object (/wallet/reference/rest/v1/loyaltyclass#LoyaltyClass) } ], \"loyaltyObjects\": [ { object (/wallet/reference/rest/v1/loyaltyobject#LoyaltyObject) } ], \"offerClasses\": [ { object (/wallet/reference/rest/v1/offerclass#OfferClass) } ], \"offerObjects\": [ { object (/wallet/reference/rest/v1/offerobject#OfferObject) } ], \"transitClasses\": [ { object (/wallet/reference/rest/v1/transitclass#TransitClass) } ], \"transitObjects\": [ { object (/wallet/reference/rest/v1/transitobject#TransitObject) } ], \"genericClasses\": [ { object (/wallet/reference/rest/v1/genericclass#GenericClass) } ], \"genericObjects\": [ { object (/wallet/reference/rest/v1/genericobject#GenericObject) } ] } ``` |\n\n| Fields ||\n|------------------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `eventTicketClasses[]` | `object (`[EventTicketClass](/wallet/reference/rest/v1/eventticketclass#EventTicketClass)`)` A list of event ticket classes. |\n| `eventTicketObjects[]` | `object (`[EventTicketObject](/wallet/reference/rest/v1/eventticketobject#EventTicketObject)`)` A list of event ticket objects. |\n| `flightClasses[]` | `object (`[FlightClass](/wallet/reference/rest/v1/flightclass#FlightClass)`)` A list of flight classes. |\n| `flightObjects[]` | `object (`[FlightObject](/wallet/reference/rest/v1/flightobject#FlightObject)`)` A list of flight objects. |\n| `giftCardClasses[]` | `object (`[GiftCardClass](/wallet/reference/rest/v1/giftcardclass#GiftCardClass)`)` A list of gift card classes. |\n| `giftCardObjects[]` | `object (`[GiftCardObject](/wallet/reference/rest/v1/giftcardobject#GiftCardObject)`)` A list of gift card objects. |\n| `loyaltyClasses[]` | `object (`[LoyaltyClass](/wallet/reference/rest/v1/loyaltyclass#LoyaltyClass)`)` A list of loyalty classes. |\n| `loyaltyObjects[]` | `object (`[LoyaltyObject](/wallet/reference/rest/v1/loyaltyobject#LoyaltyObject)`)` A list of loyalty objects. |\n| `offerClasses[]` | `object (`[OfferClass](/wallet/reference/rest/v1/offerclass#OfferClass)`)` A list of offer classes. |\n| `offerObjects[]` | `object (`[OfferObject](/wallet/reference/rest/v1/offerobject#OfferObject)`)` A list of offer objects. |\n| `transitClasses[]` | `object (`[TransitClass](/wallet/reference/rest/v1/transitclass#TransitClass)`)` A list of transit classes. |\n| `transitObjects[]` | `object (`[TransitObject](/wallet/reference/rest/v1/transitobject#TransitObject)`)` A list of transit objects. |\n| `genericClasses[]` | `object (`[GenericClass](/wallet/reference/rest/v1/genericclass#GenericClass)`)` A list of generic classes. |\n| `genericObjects[]` | `object (`[GenericObject](/wallet/reference/rest/v1/genericobject#GenericObject)`)` A list of generic objects. |"]]