Documentation

UpdatePolicy

Changes a policy for a title

Request Details

Updates permissions for your title. Policies affect what is allowed to happen on your title. Your policy is a collection of statements that, together, govern particular area for your title. Today, the only allowed policy is called 'ApiPolicy' and it governs what calls players are allowed to make.

UpdatePolicyRequest
Request Properties
OverwritePolicy (required) Boolean

Whether to overwrite or append to the existing policy.

PolicyName (required) String

The name of the policy being updated. Only supported name is 'ApiPolicy'

Statements (required) List<PermissionStatement>

The new statements to include in the policy.

POST https://{{TitleID}}.playfabapi.com/Admin/UpdatePolicy
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PolicyName": "ApiPolicy",
  "Statements": [
    {
      "Resource": "pfrn:api--*",
      "Action": "*",
      "Effect": "Allow",
      "Principal": "*",
      "Comment": "The default allow all policy"
    },
    {
      "Resource": "pfrn:api--/Client/ConfirmPurchase",
      "Action": "*",
      "Effect": "Allow",
      "Principal": "*",
      "Comment": "This statement allows only request to ConfirmPurchase"
    }
  ],
  "OverwritePolicy": false
}
        

Response Details

UpdatePolicyResponse
Result Properties
PolicyName String

The name of the policy that was updated.

Statements List<PermissionStatement>

The statements included in the new version of the policy.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "PolicyName": "ApiPolicy",
    "Statements": [
      {
        "Resource": "pfrn:api--*",
        "Action": "*",
        "Effect": "Allow",
        "Principal": "*",
        "Comment": "The default allow all policy"
      },
      {
        "Resource": "pfrn:api--/Client/ConfirmPurchase",
        "Action": "*",
        "Effect": "Allow",
        "Principal": "*",
        "Comment": "This statement allows only request to ConfirmPurchase"
      }
    ]
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code