Documentation

Player Names API

Version: v1

Player Names API

Version: v1

Player Names

The Player Names service allows users to manage player names and other text fields.
Download OpenAPI specification:

Get a player's name.


Get a player's name. The '/me' endpoint can be used to get the name of the calling player.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Get a player's name."

playerId

string
required
The player's ID.

Query parameters for "Get a player's name."

autoGenerate

boolean
Indicates if a player without a name should have one auto generated or not. Defaults to true.

showMetadata

boolean
If true, returns additional metadata like 'autoGenerated' with records. Defaults to false.

HTTP response status codes for "Get a player's name.":

Code samples for "Get a player's name.":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://social.services.api.unity.com/v1/names/{playerId}"

Response example

{ "id": "string", "name": "string", "autoGenerated": true}

Update a player's name.


Update a player's name, or create it if it doesn't exist. White space is not allowed in the name, and a random numeric suffix will automatically be added to it.
Authorizations
Use any one of the following options.
Client
HTTP: Client
HTTP Authorization Scheme: bearer
or
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "Update a player's name."

playerId

string
required
The player's ID.

Request body for "Update a player's name."

Media Type:
application/json

name

string
required
The player's updated name.
minLength: 1maxLength: 50pattern: ^[^\s]+$

HTTP response status codes for "Update a player's name.":

Code samples for "Update a player's name.":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "name": "string"}' \ "https://social.services.api.unity.com/v1/names/{playerId}"

Response example

{ "id": "string", "name": "string", "autoGenerated": true}