User Profile

DEPRECATED. Previously used to manage player profile data. This service is being phased out in favor of the more flexible Key/Value Store.

Fetch a user's profile

get

Returns the profile of the user making the request.

Authorizations
Header parameters
x-m2-organization-idstringRequired

The ID of an organization

Responses
200
The profile of a given user in an organization.
application/json
get
GET /api/profile/ HTTP/1.1
Host: your-organization-id.m2worlds.io
x-api-key: YOUR_API_KEY
x-m2-organization-id: text
Accept: */*
200

The profile of a given user in an organization.

{
  "username": "text",
  "profilePictureUrl": "text",
  "avatar": {
    "url": "text",
    "datasourceId": "text",
    "objectDefinitionId": "text"
  },
  "evmLinkedWalletAddress": "text"
}

Upserts a user's profile

put

Updates the profile of the user making the request. If the user does not have a profile, one will be created. The profile picture and avatar of a user can be unset using this endpoint.

The endpoint accepts a JSON object as body, which allows upserting various fields of the user's profile. An image from the user's collection can be set a profile picture by sending its datasource and object definition IDs in the body.

The endpoint also accepts a file (image) in binary format as body, which will be uploaded and saved as the user's profile picture. The Content-Type header has to be set to 'multipart/form-data' when sending a file.

Authorizations
Header parameters
x-m2-organization-idstringRequired

The ID of an organization

Body

The request body for PUT /profile

usernamestringOptional

The username of a user. It might have restricted length and characters, based on the organization's settings.

profilePictureanyOptional

This field is populated by a middleware when a file is sent as body. It should not be set by the client.

profilePictureObjectDefinitionIdany ofOptional

The datasource ID and object definition ID of the profile picture object. If null, the profile picture will be unset.

or
nullOptional
avatarObjectDefinitionIdany ofOptional

The datasource ID and object definition ID of the avatar object. If null, the avatar will be unset.

or
nullOptional
Responses
200
The user's profile after upserting it.
application/json
put
PUT /api/profile/ HTTP/1.1
Host: your-organization-id.m2worlds.io
x-api-key: YOUR_API_KEY
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 207

{
  "username": "text",
  "profilePicture": null,
  "profilePictureObjectDefinitionId": {
    "datasourceId": "text",
    "objectDefinitionId": "text"
  },
  "avatarObjectDefinitionId": {
    "datasourceId": "text",
    "objectDefinitionId": "text"
  }
}
200

The user's profile after upserting it.

{
  "username": "text",
  "profilePictureUrl": "text",
  "avatarObjectDefinitionId": {
    "datasourceId": "text",
    "objectDefinitionId": "text"
  }
}

Ban and replace usernames

post

This endpoint adds the provided list of usernames to the (possibly already existing) denylist. If a username is already in use, it is replaced with the provided replacement username. The request must contain a list of pairs of usernames: one to be added to the denylist, and the other to replace it if it is already in use. If a username is already in the denylist, it is skipped.

This operation can be totally or partially successful. If some usernames could not be added to the denylist, the response will contain a list of those usernames.

None of the usernames in the request need to obey the restrictions regarding length and allowed characters.

Important note: denylists rely on unique usernames being enforced at the organization level.

Authorizations
Header parameters
x-m2-organization-idstringRequired

The ID of an organization

Body

A record of usernames to add to the denylist, specifying replacements if they are already in use

Other propertiesstringOptional

The replacement username if the username is already in use

Responses
204
Default Response
application/json
Responseany
post
POST /api/profile/username/deny/ HTTP/1.1
Host: your-organization-id.m2worlds.io
x-api-key: YOUR_API_KEY
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "ANY_ADDITIONAL_PROPERTY": "text"
}

No content

Delete usernames from the denylist

delete

This endpoint removes the provided list of usernames from the denylist. If a username is in use and therefore cannot be removed from the denylist, it is skipped and returned as part of the response.

Important note: denylists rely on unique usernames being enforced at the organization level.

Authorizations
Header parameters
x-m2-organization-idstringRequired

The ID of an organization

Body
string[]Optional

An array of usernames to remove from the denylist

Responses
200
The response of deleting usernames from the denylist
application/json
delete
DELETE /api/profile/username/deny/ HTTP/1.1
Host: your-organization-id.m2worlds.io
x-api-key: YOUR_API_KEY
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "usernamesDeleted": [
    "text"
  ],
  "usernamesInUse": [
    "text"
  ]
}

Overwrite the list of denylisted usernames

put

This endpoint replaces the current denylist with the provided list of usernames. If the operation cannot be completed due to some usernames already being in use, the response will contain a list of those usernames. In this case, the denylist will not be modified, and an admin can first overwrite the usernames being used (see the POST api/profile/deny endpoint), and then try again.

None of the usernames in the request need to obey the restrictions regarding length and allowed characters.

Important note: denylists rely on unique usernames being enforced at the organization level.

Authorizations
Header parameters
x-m2-organization-idstringRequired

The ID of an organization

Body
string[]Optional

An array of usernames to add to the denylist

Responses
204
Default Response
application/json
Responseany
put
PUT /api/profile/username/denylist/ HTTP/1.1
Host: your-organization-id.m2worlds.io
x-api-key: YOUR_API_KEY
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]

No content

Last updated

Was this helpful?