Documentation

InviteToGroup

Invites a player to join a group

Request Details

Invites a player to join a group, if they are not blocked by the group. An optional role can be provided to automatically assign the player to the role if they accept the invitation. By default, if the entity has an application to the group outstanding, this will accept the application instead and return an error indicating such, rather than creating a duplicate invitation to join that will need to be cleaned up later. Returns information about the new invitation or an error indicating an existing application to join was accepted.

InviteToGroupRequest
Request Properties
AutoAcceptOutstandingApplication Boolean

Optional, default true. Automatically accept an application if one exists instead of creating an invitation

Entity (required) EntityKey

The entity to perform this action on.

Group (required) EntityKey

The identifier of the group

RoleId String

Optional. ID of an existing a role in the group to assign the user to. The group's default member role is used if this is not specified. Role IDs must be between 1 and 64 characters long.

POST https://{{TitleID}}.playfabapi.com/Group/InviteToGroup
    Content-Type: application/json
{
  "Group": {
    "Id": "ABC1234ABC"
  },
  "RoleId": "awesomepeople",
  "Entity": {
    "Id": "90901000",
    "Type": "title_player_account",
    "TypeString": "title_player_account"
  }
}
        

Response Details

InviteToGroupResponse
Result Properties
Expires (required) DateTime

When the invitation will expire and be deleted

Group EntityKey

The group that the entity invited to

InvitedByEntity EntityWithLineage

The entity that created the invitation

InvitedEntity EntityWithLineage

The entity that is invited

RoleId String

ID of the role in the group to assign the user to.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "InvitedEntity": {
      "Key": {
        "Id": "90901000",
        "Type": "title_player_account",
        "TypeString": "title_player_account"
      },
      "Lineage": {
        "master_player_account": {
          "Id": "800DED92",
          "Type": "master_player_account",
          "TypeString": "master_player_account"
        }
      }
    },
    "Group": {
      "Id": "ABC1234ABC"
    },
    "InvitedByEntity": {
      "Key": {
        "Id": "9023AFF3",
        "Type": "title_player_account",
        "TypeString": "title_player_account"
      },
      "Lineage": {
        "master_player_account": {
          "Id": "366AD424",
          "Type": "master_player_account",
          "TypeString": "master_player_account"
        }
      }
    },
    "RoleId": "awesomepeople",
    "Expires": "2017-12-31T11:59:59Z"
  }
}

Authentication

EntityToken

Possible Error Codes

Name Code
InvalidParams 1000
NotAuthenticated 1074
NotAuthorized 1089
OutstandingApplicationAcceptedInstead 1364