Method: jwt.insert
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
HTTP リクエスト
POST https://walletobjects.googleapis.com/walletobjects/v1/jwt
この URL は gRPC Transcoding 構文を使用します。
リクエスト本文
リクエストの本文には JwtResource
のインスタンスが含まれます。
レスポンスの本文
成功すると、レスポンスの本文に次の構造のデータが含まれます。
JSON 表現 |
{
"saveUri": string,
"resources": {
object (Resources )
}
} |
フィールド |
saveUri |
string
エンドユーザーが JWT で識別されたオブジェクトを自分の Google アカウントに保存するための URI。
|
resources |
object (Resources )
JWT で指定されたクラスとオブジェクトの ID に対応するデータ。リソースには空でない配列のみが含まれます(つまり、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 )
}
]
} |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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. |"]]