game/setPreferences is used to store values. The values are only available to the currently logged-in user for the specified game. Users must be logged in to make use of the method.
game/setPreferences is available at http://api.kidswb.com/data/game/setPreferences, and like most data API methods, accepts parameters via GET or POST (where POST is preferred).
While userID and sessionID are not parameters you need explicitly send, a valid matching set are required and expected to be passed via cookies to the request.
| Name | Required | Type | Range | Comments |
| asyncToken | no | string | 0 - 128 chars | Returns any value passed in the response. Can be used by client to identify which request this is the response for. |
| game | YES | string | n/a | game slug for the applicable game |
| names | YES | Pipe-separated strings | 0 - 128 chars per name | "|"-separated list of preference names. |
| values | YES | Pipe-separated strings | 0 - 2048 chars per value | "|"-separated list of preference values. The number of entries here should match the number of entries in "names". |
Sample Results
Successful Execution
{
"result": "ok"
}
Successful Execution w/asyncToken
{
"result": "ok",
"asyncToken": "sampleAsyncToken"
}
Unsuccessful Execution invalid parameters
{
"result": "error",
"error": {
"errorNum": 10000,
"errorMsg": "Invalid Parameters"
}
}
Unsuccessful Execution invalid user session
{
"result": "error",
"error": {
"errorNum": 10100,
"errorMsg": "Invalid User Session"
}
}
Unsuccessful Execution invalid game id
{
"result": "error",
"error": {
"errorNum": 10200,
"errorMsg": "Invalid Game"
}
}
Unsuccessful Execution name label excedes limit
{
"result": "error",
"error": {
"errorNum": 10300,
"errorMsg": "Pref name exceeds maximum allowed length"
}
}
Unsuccessful Execution value excedes limit
{
"result": "error",
"error": {
"errorNum": 10400,
"errorMsg": "Pref value exceeds maximum allowed length"
}
}