简体   繁体   中英

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
      ]
   }
}

when sending post request with this json data, the response is:

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

if I leave out the splitQuantity key & value, it works. is there something wrong with the JSON format?

The documentation states:

splitOption : (string) MULTIPLES
splitQuantity : (int) 1, 2, 3, or a divisor of quantity (if quantity is 10, splitQuantity can be 1, 2, 3, 5, or 10).

According to the StubHub listing API documentation , the splitQuantity value must be an integer. You set it to a list of integers, that is not a valid value for that key.

Set it to one integer instead. Because your quantity value is set to 4 , legal splitQuantity values are 1 , 2 , 3 or 4 :

"splitQuantity": 4,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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