Documentation

BanUsers

Bans users by PlayFab ID with optional IP address, or MAC address for the provided game.

Request Details

The existence of each user will not be verified. When banning by IP or MAC address, multiple players may be affected, so use this feature with caution. Returns information about the new bans.

BanUsersRequest
Request Properties
Bans (required) List<BanRequest>

List of ban requests to be applied. Maximum 100.

POST https://{{TitleID}}.playfabapi.com/Server/BanUsers
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "Bans": [
    {
      "PlayFabId": "1679AF5CD04BD838",
      "IPAddress": "192.168.1.1",
      "Reason": "You cheated!",
      "DurationInHours": 7
    },
    {
      "PlayFabId": "2329AF5CD04BF513",
      "Reason": "Caught you using speed hack!"
    }
  ]
}
        

Response Details

BanUsersResult
Result Properties
BanData List<BanInfo>

Information on the bans that were applied

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "BanData": [
      {
        "PlayFabId": "1679AF5CD04BD838",
        "BanId": "E0B5FF89542D413C",
        "IPAddress": "192.111.11.1",
        "Created": "2016-08-13T05:04:03Z",
        "Reason": "You cheated!",
        "Active": false
      },
      {
        "PlayFabId": "2329AF5CD04BF513",
        "BanId": "EF43FF89542G1546",
        "Created": "2016-05-13T05:04:03Z",
        "Expires": "2016-09-13T05:04:03Z",
        "Reason": "You used speed hack!",
        "Active": true
      }
    ]
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code