繁体   English   中英

StubHub JSON发布请求的正确格式是什么?

[英]What is the proper format for a StubHub JSON post request?

{  
   "listing":{  
      "deliveryOption":"option",
      "event":{  
         "date":"date",
         "name":"name of event",
         "venue":"venue"
      },
      "externalListingId":"000000000",
      "inhandDate":"inhand date",
      "pricePerTicket":{  
         "amount":"cost",
         "currency":"USD"
      },
      "quantity":4,
      "rows":"row",
      "section":"sec",
      "splitOption":"MULTIPLES",
      "splitQuantity":[  
         2,
         4
      ]
   }
}

使用此json数据发送发布请求时,响应为:

Can not deserialize instance of java.lang.Integer out of START_ARRAY token

如果我忽略splitQuantity键和值,它就可以工作。 JSON格式有问题吗?

文档指出:

splitOption :(字串) MULTIPLES
splitQuantity :(int)1、2、3或数量的除数(如果数量为10,则splitQuantity可以为1、2、3、5或10)。

根据StubHub列出的API文档splitQuantity必须为整数。 您将其设置为整数列表 ,而不是该键的有效值。

而是将其设置为一个整数。 因为你的quantity值设置为4 ,法律splitQuantity值是1234

"splitQuantity": 4,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM