Sign In Register

How can we help you today?

Start a new topic
Answered

REST API POST error

Morning,

 we have been using the REST API to upload and update virtual goods from our tool. It all works correctly, but since yesterday, the POST call returns the following error:

{ "message" : "org.hibernate.collection.internal.PersistentBag cannot be cast to com.wagerz.devportal.domain.JsonRestObject" }

The baffling thing is that it works fine with curl and from the REST API documentation page, but if we try from other tools, we get the error above. This is a sample of the data we are trying to submit:

{"description": "description","name": "POST_TEST","shortCode": "test","tags": "test","type": "VGOOD"}

The headers for authentication, accept, content-length and content-type are set correctly.


What are we missing?


Cheers!


Best Answer

This looks like an issue if you have a trailing slash on the url you are POSTing to. Can you verify you are posting to 


https://portal.gamesparks.net/restv2/game/r298277ADC1M/config/~virtualGoods


and not


https://portal.gamesparks.net/restv2/game/r298277ADC1M/config/~virtualGoods/


We'll get this addressed shortly.


Answer

This looks like an issue if you have a trailing slash on the url you are POSTing to. Can you verify you are posting to 


https://portal.gamesparks.net/restv2/game/r298277ADC1M/config/~virtualGoods


and not


https://portal.gamesparks.net/restv2/game/r298277ADC1M/config/~virtualGoods/


We'll get this addressed shortly.

That did it. Thanks!!

 

Login to post a comment