Sign In Register

How can we help you today?

Start a new topic
Answered

Insert virtual good through cloud code and dynamic forms

 Hello everyone,

  we'd like to make our designer and other team members life easier by being able to upload a list of virtual goods into GameSparks by processing a file uploaded through dynamic forms using cloud code. So far the only hint I could find in the docs is in the REST api, by making a post request to this entry point: /restv2/game/{apiKey}/config/~virtualGoods


I tried to to use SparkHttp to submit data to the API but I keep getting a "NO_RESPONSE" reply. Here's the code I am using:

Spark.getHttp("https://config.gamesparks.net/restv2/game/****/config/~virtualGoods").setBasicAuth(****, ****).postJson({shortCode: item.short_code});

Assume that item.short_code contains the correct code (I double checked the snippet and item is correctly populated)


It's also quite cumbersome that I would have to submit all fields when the bulk of the entry data might be simply the short code and maybe price. The rest can be filled in later.


Any thoughts or suggestions? Is there a Cloud Code api call that I missed?


Cheers!


Marco


Best Answer

Hi Marco, 


No there is no Cloud Code API for creating Virtual Goods, you don't have to supply all of the fields when creating them though. The minimum that can be supplied is the name, description, shortCode and type I believe, you should be able to create a Virtual Good with just those fields supplied leaving you to edit the rest later. I hope that helps, if you have any further questions just let me know.


Thanks,

Liam

1 Comment

Answer

Hi Marco, 


No there is no Cloud Code API for creating Virtual Goods, you don't have to supply all of the fields when creating them though. The minimum that can be supplied is the name, description, shortCode and type I believe, you should be able to create a Virtual Good with just those fields supplied leaving you to edit the rest later. I hope that helps, if you have any further questions just let me know.


Thanks,

Liam

Login to post a comment