question

Bablu Gaur avatar image
Bablu Gaur asked

UpdateUserData make data delete

I am trying to update user playfab data using admin apis from postman.

When I get data using GetUserData then I am getting in below format:

{
    "code": 200,
    "status": "OK",
    "data": {
        "PlayFabId": "myflayfabid",
        "DataVersion": 168,
        "Data": {
            "AvatarIndex": {
                "Value": "0",
                "LastUpdated": "2019-05-07T07:32:12.518Z",
                "Permission": "Public"
            },
            "PlayerName": {
                "Value": "user1234",
                "LastUpdated": "2019-05-07T07:32:12.518Z",
                "Permission": "Public"
            },
            "Coins": {
                "Value": "1000",
                "LastUpdated": "2019-05-07T07:32:12.518Z",
                "Permission": "Public"
            },
	    "blah blah"{
		more data here like above
	    }
        }
    }
}

I want to change coins value from admin so I used UpdateUserData and add below data:

{
  "PlayFabId": "playfabid",
  "Data": {
    "Coins": {
	"Value": "2000",
        "LastUpdated": "2019-04-10T06:24:52.408Z",
        "Permission": "Public"
    }
  }
}

I got below response,

{
    "code": 200,
    "status": "OK",
    "data": {
        "DataVersion": 169
    }
}

and after updating below is my latest data

{
    "code": 200,
    "status": "OK",
    "data": {
        "PlayFabId": "A112C5FA2559FB2F",
        "DataVersion": 170,
        "Data": {
            "AvatarIndex": {
                "Value": "0",
                "LastUpdated": "2019-05-07T07:32:12.518Z",
                "Permission": "Public"
            },
            "PlayerName": {
                "Value": "AddCoins",
                "LastUpdated": "2019-05-07T07:32:12.518Z",
                "Permission": "Public"
            },
	    "blah blah"{
		more data here like above
	    }
        }
    }
}

See here, My coins value is missing.

So how could I update that coins value without deleting.

Thank you.

apisPlayer Data
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jital avatar image jital ♦ commented ·

Hello,

What does your GetUserData request look like? I was able to retrieve all of my UserData from Postman with the following:

{
  "PlayFabId": "8B87E49B5B76CBC3",
  "Keys": 
  [
  	"Race",
  	"Class"
  ]
}

With this I was able to get all the Data just by specifying all the Keys I wanted. Watch out when using the IfChangedFromDataVersion parameter because that can prevent you from getting some Keys

0 Likes 0 ·
Bablu Gaur avatar image Bablu Gaur commented ·

@jital

my GetUserData request gives me below datas

{    "code": 200,    "status": "OK",    "data": {        "PlayFabId": "myflayfabid",        "DataVersion": 168,        "Data": {            "AvatarIndex": {                "Value": "0",                "LastUpdated": "2019-05-07T07:32:12.518Z",                "Permission": "Public"            },            "PlayerName": {                "Value": "user1234",                "LastUpdated": "2019-05-07T07:32:12.518Z",                "Permission": "Public"            },            "Coins": {                "Value": "1000",                "LastUpdated": "2019-05-07T07:32:12.518Z",                "Permission": "Public"            },	    "blah blah"{		more data here like above	    }        }    }}


0 Likes 0 ·

1 Answer

·
Bablu Gaur avatar image
Bablu Gaur answered

Sorry I am not able to edit earlier comment,

I am getting in below formar : GetUserData

PS: Today I am getting all data but when I tried yesterday I didnt recieved any data. Is there any cache isuue? Also My data didnt modified/updated.

I am tring again and let you know result.

In meanwhile, does playfab store cached data and change data after some time?

{
    "code": 200,
    "status": "OK",
    "data": {
        "PlayFabId": "playfabid",
        "DataVersion": 174,
        "Data": {
            "AvatarIndex": {
                "Value": "0",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "Chats": {
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "Coins": {
                "Value": "5000",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "Emoji": {
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "FortuneWheelLastFreeTime": {
                "Value": "636928437198380670",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "FourPlayerWins": {
                "Value": "0",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "GamesPlayed": {
                "Value": "0",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "LoggedType": {
                "Value": "Guest",
                "LastUpdated": "2019-05-07T13:36:31.501Z",
                "Permission": "Public"
            },
            "PlayerName": {
                "Value": "AddCoins",
                "LastUpdated": "2019-05-07T07:32:12.518Z",
                "Permission": "Public"
            },
            "TitleFirstLogin": {
                "Value": "1",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "TotalEarnings": {
                "Value": "0",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            },
            "TwoPlayerWins": {
                "Value": "0",
                "LastUpdated": "2019-05-07T11:05:19.598Z",
                "Permission": "Public"
            }
        }
    }
}

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jital avatar image jital ♦ commented ·

No, UserData is not cached. I would also like to know if after you had made the UpdateUserData API call, were you able to see this results from within the GameManager?

0 Likes 0 ·
Bablu Gaur avatar image Bablu Gaur jital ♦ commented ·

No, In game manage I an not getting that data neither latest/updated nor old data.

0 Likes 0 ·
jital avatar image jital ♦ commented ·

Can you do the following please?

  1. Make a UpdateUserData and GetUserData API through Postman
  2. Post the request and response here
  3. Post a screenshot of the PlayerData from the GameManager after the UpdateUserData call
  4. If you are still unsuccessful send me the Postman Collection containing your exact call
  5. As well as a Wireshark capture so we can see exactly what happens when you're making these calls
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.