Groups - Invite To Group

Invites a player to join a group

POST https://titleId.playfabapi.com/Group/InviteToGroup

Request Header

Name Required Type Description
X-EntityToken True
  • string

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Request Body

Name Required Type Description
Entity True

The entity to perform this action on.

Group True

The identifier of the group

AutoAcceptOutstandingApplication
  • boolean

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

CustomTags
  • object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

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.

Responses

Name Type Description
200 OK

Describes an invitation to a group.

400 Bad Request

This is the outer wrapper for all responses with errors

Security

X-EntityToken

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Type: apiKey
In: header

Definitions

ApiErrorWrapper

The basic wrapper around every failed API response

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

EntityWithLineage

Entity wrapper class that contains the entity key and the entities that make up the lineage of the entity.

InviteToGroupRequest

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.

InviteToGroupResponse

Describes an invitation to a group.

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code
  • integer

Numerical HTTP code

error
  • string

Playfab error code

errorCode
  • integer

Numerical PlayFab error code

errorDetails
  • object

Detailed description of individual issues with the request object

errorMessage
  • string

Description for the PlayFab errorCode

status
  • string

String HTTP code

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

Name Type Description
Id
  • string

Unique ID of the entity.

Type
  • string

Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types

EntityWithLineage

Entity wrapper class that contains the entity key and the entities that make up the lineage of the entity.

Name Type Description
Key

The entity key for the specified entity

Lineage

Dictionary of entity keys for related entities. Dictionary key is entity type.

InviteToGroupRequest

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.

Name Type Description
AutoAcceptOutstandingApplication
  • boolean

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

CustomTags
  • object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Entity

The entity to perform this action on.

Group

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.

InviteToGroupResponse

Describes an invitation to a group.

Name Type Description
Expires
  • string

When the invitation will expire and be deleted

Group

The group that the entity invited to

InvitedByEntity

The entity that created the invitation

InvitedEntity

The entity that is invited

RoleId
  • string

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

Error Codes

Name Code
EntityBlockedByGroup 1357
EntityIsAlreadyMember 1359
OutstandingApplicationAcceptedInstead 1364
RoleDoesNotExist 1358