question

ed-dev avatar image
ed-dev asked

RemovePlayerTag not working

Hey!

I am playing around with PlayerTags, and I can't seem to remove tags I have created. I am trying with my cloud script, and using the "TryIt" buttons on the API page. Both return the code 200 but when I call GetPlayerTags it still has all of the tags.

https://api.playfab.com/documentation/server/method/RemovePlayerTag

https://api.playfab.com/documentation/server/method/GetPlayerTags

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Can you please provide the Title ID, PlayFab ID of the user account, and the Tags, so that we can investigate?

4 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.

ed-dev avatar image ed-dev commented ·

titleId: 7443

playFabId: 3E321C537E4B0CCB

These are the tags I receive when I call GetPlayerTags. (These are all just tags set from testing the API).

"Tags": [
   "title.7443.{ \"GauntletKey1\": \"1337\" }",
   "title.7443.GauntletKey.123ffg234123",
   "title.7443.YOUR NAME",
   "title.7443.Gauntlet.Timed.1P.Key1.1337",
   "title.7443.Gauntlet.Timed.1P.Key1.1338",
   "title.7443.title.7443.{ \"GauntletKey1\": \"1337\" }"
  ]
0 Likes 0 ·
brendan avatar image brendan ed-dev commented ·

I'm not seeing any problem removing the keys from the player. I think the problem here was that you had a key where the string was a JSON object (but stringified). So the call to remove the first string above had to be:

POST /server/RemovePlayerTag HTTP/1.1
Host: 7443.playfabapi.com
Content-Type: application/json
X-SecretKey: {SecretKey}
{
    "PlayFabId": "3E321C537E4B0CCB",
    "TagName": "{ \"GauntletKey1\": \"1337\" }"
}

Which worked, no problem.

0 Likes 0 ·
ed-dev avatar image ed-dev brendan commented ·

Oh! I worked it out!

I was calling the tag like so "title.7443.YOUR NAME", when it should be "YOUR NAME".

So when I get the player tags, I need to then remove the title id out of the tag.

0 Likes 0 ·
Show more comments

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.