メインコンテンツまでスキップ

Transaction の更新

 

作成されたトランザクションをオープンやクローズ、またはキャンセルします。

備考

Mobage Bank API の使い方
Bank API の詳細な使い方について、下記の各ページをご参照下さい。
ngCore SDK | Native SDK | Unity SDK

URI Fragment​

/bank/debit/@app/{transactionId}

署名方式​

OAuth2

備考

OAuth 認証についてはこちら、リクエストの署名や Authorization ヘッダーの作成についてはこちらを参照して下さい。

HTTP メソッド​

PUT

リクエストヘッダー​

  • Authorization は必須になります。例に示した "Authorization: bearer oauth2_token" を HTTP ヘッダーに追加して下さい。
  • Content-Type: application/json; charset=utf-8

URL クエリパラメータ​

パラメータ名型説明必須
filedsリスト"state"だけ指定可能No
format文字列"json"を指定して下さいNo

リクエスト本文​

下記キーと値を持つ JSON 文字列。

{
"state":"open" // either "open", "closed" or "canceled"
}

レスポンスコード​

HTTP Status CodeHTTP Status MessageMeaning
202AcceptedRequest was accepted for processing.
400Bad RequestCorrupt request data on the client side
401UnauthorizedAuthorization error
403ForbiddenThe resource exists, but access is not possible due to a reason other than an authorization error.
404Not FoundThe resource does not exist.
409ConflictIllegal state.
500Internal Server ErrorAn error on the API server side
503Service UnavailableThe API cannot be used temporarily

レスポンス本文​

  • 成功の場合、更新されたトランザクションが返ってきます。

  • Content-Type: application/json; charset=utf-8

    パラメータ名説明
    publishedトランザクションが作成された時間
    commentトランザクションに対するコメント
    idトランザクション ID
    updatedトランザクションが更新された時間
    itemsアイテム配列。ただいまアイテムは 1 つだけ指定可能
    items[].item下記パラメータを持つオブジェクト
    items[].item.imageUrlアイテム画像の URL
    items[].item.nameアイテム名
    items[].item.id購入対象アイテム ID
    items[].item.priceアイテム価格
    items[].item.descriptionアイテムの説明文
    items[].quantity本トランザクションで購入するアイテム個数
    stateトランザクションのステート

実例​

Base String

// OAuth2 認証では Base String は必要ありません。

Http リクエスト

PUT /social/api/restful/v2.02/bank/debit/@app/EBF8C5E8-D722-3F49-8F2F-60595A4C6F30?fields=state HTTP/1.1
Host: ssl.sb.sp.mbga-platform.jp
Accept-Encoding: gzip
Authorization: bearer c885aa1e5a99504e54843e5952fb5793
Accept: */*
Content-Type: application/json; charset=utf-8
Content-Length: 16
Expect: 100-continue

{"state":"open"}

HTTP レスポンス

HTTP/1.0 202 Accepted
Content-Type: application/json; charset=utf-8
Content-Length: 349
Connection: close
Date: Sun, 29 Sep 2013 12:29:36 GMT
Server: Unknown

{"published":"2013-09-29T12:28:26","comment":"Purchase of 2 Sample Item(s)","id":"EBF8C5E8-D722-3F49-8F2F-60595A4C6F30","updated":"2013-09-29T12:29:36","items":[{"item":{"imageUrl":"http://mobage.com/homepage-assets/images/icon.png","name":"Sample Item","id":"item_1","price":100,"description":"This is a sample item"},"quantity":2}],"state":"open"}
  • URI Fragment
  • 署名方式
  • HTTP メソッド
  • リクエストヘッダー
  • URL クエリパラメータ
  • リクエスト本文
  • レスポンスコード
  • レスポンス本文
  • 実例